firmware-utils: bump to git HEAD
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0796-media-i2c-Use-the-new-get_mbus_config-pad-op.patch
1 From 87fde70ab0ba99860153b127e6821be5ae74e73b Mon Sep 17 00:00:00 2001
2 From: Jacopo Mondi <jacopo+renesas@jmondi.org>
3 Date: Tue, 16 Jun 2020 16:12:37 +0200
4 Subject: [PATCH] media: i2c: Use the new get_mbus_config pad op
5
6 Upstream https://patchwork.linuxtv.org/patch/64669/
7
8 Move the existing users of the g_mbus_config video operation to use the
9 newly introduced get_mbus_config pad operations.
10
11 All the ported drivers report a static media bus configuration and do no
12 support s_mbus_config so the operation implementation has not changed.
13
14 Bridge drivers needs to call the new pad operation and will receive an
15 -ENOICTLCMD when calling the old g_mbus_config video operation
16
17 Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
18 ---
19 drivers/media/i2c/adv7180.c | 7 ++++---
20 drivers/media/i2c/ml86v7667.c | 7 ++++---
21 drivers/media/i2c/mt9m001.c | 7 ++++---
22 drivers/media/i2c/mt9m111.c | 7 ++++---
23 drivers/media/i2c/ov9640.c | 7 ++++---
24 drivers/media/i2c/tc358743.c | 7 ++++---
25 drivers/media/i2c/tvp5150.c | 7 ++++---
26 7 files changed, 28 insertions(+), 21 deletions(-)
27
28 --- a/drivers/media/i2c/adv7180.c
29 +++ b/drivers/media/i2c/adv7180.c
30 @@ -749,8 +749,9 @@ static int adv7180_set_pad_format(struct
31 return ret;
32 }
33
34 -static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
35 - struct v4l2_mbus_config *cfg)
36 +static int adv7180_get_mbus_config(struct v4l2_subdev *sd,
37 + unsigned int pad,
38 + struct v4l2_mbus_config *cfg)
39 {
40 struct adv7180_state *state = to_state(sd);
41
42 @@ -841,7 +842,6 @@ static const struct v4l2_subdev_video_op
43 .querystd = adv7180_querystd,
44 .g_input_status = adv7180_g_input_status,
45 .s_routing = adv7180_s_routing,
46 - .g_mbus_config = adv7180_g_mbus_config,
47 .g_pixelaspect = adv7180_g_pixelaspect,
48 .g_tvnorms = adv7180_g_tvnorms,
49 .s_stream = adv7180_s_stream,
50 @@ -857,6 +857,7 @@ static const struct v4l2_subdev_pad_ops
51 .enum_mbus_code = adv7180_enum_mbus_code,
52 .set_fmt = adv7180_set_pad_format,
53 .get_fmt = adv7180_get_pad_format,
54 + .get_mbus_config = adv7180_get_mbus_config,
55 };
56
57 static const struct v4l2_subdev_sensor_ops adv7180_sensor_ops = {
58 --- a/drivers/media/i2c/ml86v7667.c
59 +++ b/drivers/media/i2c/ml86v7667.c
60 @@ -219,8 +219,9 @@ static int ml86v7667_fill_fmt(struct v4l
61 return 0;
62 }
63
64 -static int ml86v7667_g_mbus_config(struct v4l2_subdev *sd,
65 - struct v4l2_mbus_config *cfg)
66 +static int ml86v7667_get_mbus_config(struct v4l2_subdev *sd,
67 + unsigned int pad,
68 + struct v4l2_mbus_config *cfg)
69 {
70 cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING |
71 V4L2_MBUS_DATA_ACTIVE_HIGH;
72 @@ -291,13 +292,13 @@ static const struct v4l2_subdev_video_op
73 .s_std = ml86v7667_s_std,
74 .querystd = ml86v7667_querystd,
75 .g_input_status = ml86v7667_g_input_status,
76 - .g_mbus_config = ml86v7667_g_mbus_config,
77 };
78
79 static const struct v4l2_subdev_pad_ops ml86v7667_subdev_pad_ops = {
80 .enum_mbus_code = ml86v7667_enum_mbus_code,
81 .get_fmt = ml86v7667_fill_fmt,
82 .set_fmt = ml86v7667_fill_fmt,
83 + .get_mbus_config = ml86v7667_get_mbus_config,
84 };
85
86 static const struct v4l2_subdev_core_ops ml86v7667_subdev_core_ops = {
87 --- a/drivers/media/i2c/mt9m001.c
88 +++ b/drivers/media/i2c/mt9m001.c
89 @@ -689,8 +689,9 @@ static int mt9m001_enum_mbus_code(struct
90 return 0;
91 }
92
93 -static int mt9m001_g_mbus_config(struct v4l2_subdev *sd,
94 - struct v4l2_mbus_config *cfg)
95 +static int mt9m001_get_mbus_config(struct v4l2_subdev *sd,
96 + unsigned int pad,
97 + struct v4l2_mbus_config *cfg)
98 {
99 /* MT9M001 has all capture_format parameters fixed */
100 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
101 @@ -703,7 +704,6 @@ static int mt9m001_g_mbus_config(struct
102
103 static const struct v4l2_subdev_video_ops mt9m001_subdev_video_ops = {
104 .s_stream = mt9m001_s_stream,
105 - .g_mbus_config = mt9m001_g_mbus_config,
106 };
107
108 static const struct v4l2_subdev_sensor_ops mt9m001_subdev_sensor_ops = {
109 @@ -717,6 +717,7 @@ static const struct v4l2_subdev_pad_ops
110 .set_selection = mt9m001_set_selection,
111 .get_fmt = mt9m001_get_fmt,
112 .set_fmt = mt9m001_set_fmt,
113 + .get_mbus_config = mt9m001_get_mbus_config,
114 };
115
116 static const struct v4l2_subdev_ops mt9m001_subdev_ops = {
117 --- a/drivers/media/i2c/mt9m111.c
118 +++ b/drivers/media/i2c/mt9m111.c
119 @@ -1137,8 +1137,9 @@ static int mt9m111_init_cfg(struct v4l2_
120 return 0;
121 }
122
123 -static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
124 - struct v4l2_mbus_config *cfg)
125 +static int mt9m111_get_mbus_config(struct v4l2_subdev *sd,
126 + unsigned int pad,
127 + struct v4l2_mbus_config *cfg)
128 {
129 struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);
130
131 @@ -1155,7 +1156,6 @@ static int mt9m111_g_mbus_config(struct
132 }
133
134 static const struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = {
135 - .g_mbus_config = mt9m111_g_mbus_config,
136 .s_stream = mt9m111_s_stream,
137 .g_frame_interval = mt9m111_g_frame_interval,
138 .s_frame_interval = mt9m111_s_frame_interval,
139 @@ -1168,6 +1168,7 @@ static const struct v4l2_subdev_pad_ops
140 .set_selection = mt9m111_set_selection,
141 .get_fmt = mt9m111_get_fmt,
142 .set_fmt = mt9m111_set_fmt,
143 + .get_mbus_config = mt9m111_get_mbus_config,
144 };
145
146 static const struct v4l2_subdev_ops mt9m111_subdev_ops = {
147 --- a/drivers/media/i2c/ov9640.c
148 +++ b/drivers/media/i2c/ov9640.c
149 @@ -648,8 +648,9 @@ static const struct v4l2_subdev_core_ops
150 };
151
152 /* Request bus settings on camera side */
153 -static int ov9640_g_mbus_config(struct v4l2_subdev *sd,
154 - struct v4l2_mbus_config *cfg)
155 +static int ov9640_get_mbus_config(struct v4l2_subdev *sd,
156 + unsigned int pad,
157 + struct v4l2_mbus_config *cfg)
158 {
159 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
160 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
161 @@ -661,13 +662,13 @@ static int ov9640_g_mbus_config(struct v
162
163 static const struct v4l2_subdev_video_ops ov9640_video_ops = {
164 .s_stream = ov9640_s_stream,
165 - .g_mbus_config = ov9640_g_mbus_config,
166 };
167
168 static const struct v4l2_subdev_pad_ops ov9640_pad_ops = {
169 .enum_mbus_code = ov9640_enum_mbus_code,
170 .get_selection = ov9640_get_selection,
171 .set_fmt = ov9640_set_fmt,
172 + .get_mbus_config = ov9640_get_mbus_config,
173 };
174
175 static const struct v4l2_subdev_ops ov9640_subdev_ops = {
176 --- a/drivers/media/i2c/tc358743.c
177 +++ b/drivers/media/i2c/tc358743.c
178 @@ -1621,8 +1621,9 @@ static int tc358743_dv_timings_cap(struc
179 return 0;
180 }
181
182 -static int tc358743_g_mbus_config(struct v4l2_subdev *sd,
183 - struct v4l2_mbus_config *cfg)
184 +static int tc358743_get_mbus_config(struct v4l2_subdev *sd,
185 + unsigned int pad,
186 + struct v4l2_mbus_config *cfg)
187 {
188 struct tc358743_state *state = to_state(sd);
189 const u32 mask = V4L2_MBUS_CSI2_LANE_MASK;
190 @@ -1852,7 +1853,6 @@ static const struct v4l2_subdev_video_op
191 .s_dv_timings = tc358743_s_dv_timings,
192 .g_dv_timings = tc358743_g_dv_timings,
193 .query_dv_timings = tc358743_query_dv_timings,
194 - .g_mbus_config = tc358743_g_mbus_config,
195 .s_stream = tc358743_s_stream,
196 };
197
198 @@ -1864,6 +1864,7 @@ static const struct v4l2_subdev_pad_ops
199 .set_edid = tc358743_s_edid,
200 .enum_dv_timings = tc358743_enum_dv_timings,
201 .dv_timings_cap = tc358743_dv_timings_cap,
202 + .get_mbus_config = tc358743_get_mbus_config,
203 };
204
205 static const struct v4l2_subdev_ops tc358743_ops = {
206 --- a/drivers/media/i2c/tvp5150.c
207 +++ b/drivers/media/i2c/tvp5150.c
208 @@ -1104,8 +1104,9 @@ static int tvp5150_get_selection(struct
209 }
210 }
211
212 -static int tvp5150_g_mbus_config(struct v4l2_subdev *sd,
213 - struct v4l2_mbus_config *cfg)
214 +static int tvp5150_get_mbus_config(struct v4l2_subdev *sd,
215 + unsigned int pad,
216 + struct v4l2_mbus_config *cfg)
217 {
218 struct tvp5150 *decoder = to_tvp5150(sd);
219
220 @@ -1411,7 +1412,6 @@ static const struct v4l2_subdev_video_op
221 .querystd = tvp5150_querystd,
222 .s_stream = tvp5150_s_stream,
223 .s_routing = tvp5150_s_routing,
224 - .g_mbus_config = tvp5150_g_mbus_config,
225 };
226
227 static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {
228 @@ -1429,6 +1429,7 @@ static const struct v4l2_subdev_pad_ops
229 .get_fmt = tvp5150_fill_fmt,
230 .get_selection = tvp5150_get_selection,
231 .set_selection = tvp5150_set_selection,
232 + .get_mbus_config = tvp5150_get_mbus_config,
233 };
234
235 static const struct v4l2_subdev_ops tvp5150_ops = {