diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-21 08:39:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-05-01 07:52:34 -0400 |
commit | 6e80c4738aa12701a5714cb3e4a685f95c1ffe5f (patch) | |
tree | 51afb520ab85c708d1b2dbfb2093d76dffea5e43 /drivers/media/i2c/cx25840 | |
parent | 717fd5b4907ada90ceb069d484068aaa01c58bb0 (diff) |
[media] v4l2: replace s_mbus_fmt by set_fmt
The s_mbus_fmt video op is a duplicate of the pad op. Replace all uses
in sub-devices by the set_fmt() pad op.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/cx25840')
-rw-r--r-- | drivers/media/i2c/cx25840/cx25840-core.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index 18e3615737f2..e15a789ad596 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c | |||
@@ -1366,14 +1366,17 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | |||
1366 | 1366 | ||
1367 | /* ----------------------------------------------------------------------- */ | 1367 | /* ----------------------------------------------------------------------- */ |
1368 | 1368 | ||
1369 | static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt) | 1369 | static int cx25840_set_fmt(struct v4l2_subdev *sd, |
1370 | struct v4l2_subdev_pad_config *cfg, | ||
1371 | struct v4l2_subdev_format *format) | ||
1370 | { | 1372 | { |
1373 | struct v4l2_mbus_framefmt *fmt = &format->format; | ||
1371 | struct cx25840_state *state = to_state(sd); | 1374 | struct cx25840_state *state = to_state(sd); |
1372 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1375 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1373 | int HSC, VSC, Vsrc, Hsrc, filter, Vlines; | 1376 | int HSC, VSC, Vsrc, Hsrc, filter, Vlines; |
1374 | int is_50Hz = !(state->std & V4L2_STD_525_60); | 1377 | int is_50Hz = !(state->std & V4L2_STD_525_60); |
1375 | 1378 | ||
1376 | if (fmt->code != MEDIA_BUS_FMT_FIXED) | 1379 | if (format->pad || fmt->code != MEDIA_BUS_FMT_FIXED) |
1377 | return -EINVAL; | 1380 | return -EINVAL; |
1378 | 1381 | ||
1379 | fmt->field = V4L2_FIELD_INTERLACED; | 1382 | fmt->field = V4L2_FIELD_INTERLACED; |
@@ -1403,6 +1406,8 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt | |||
1403 | fmt->width, fmt->height); | 1406 | fmt->width, fmt->height); |
1404 | return -ERANGE; | 1407 | return -ERANGE; |
1405 | } | 1408 | } |
1409 | if (format->which == V4L2_SUBDEV_FORMAT_TRY) | ||
1410 | return 0; | ||
1406 | 1411 | ||
1407 | HSC = (Hsrc * (1 << 20)) / fmt->width - (1 << 20); | 1412 | HSC = (Hsrc * (1 << 20)) / fmt->width - (1 << 20); |
1408 | VSC = (1 << 16) - (Vsrc * (1 << 9) / Vlines - (1 << 9)); | 1413 | VSC = (1 << 16) - (Vsrc * (1 << 9) / Vlines - (1 << 9)); |
@@ -5068,7 +5073,6 @@ static const struct v4l2_subdev_video_ops cx25840_video_ops = { | |||
5068 | .s_std = cx25840_s_std, | 5073 | .s_std = cx25840_s_std, |
5069 | .g_std = cx25840_g_std, | 5074 | .g_std = cx25840_g_std, |
5070 | .s_routing = cx25840_s_video_routing, | 5075 | .s_routing = cx25840_s_video_routing, |
5071 | .s_mbus_fmt = cx25840_s_mbus_fmt, | ||
5072 | .s_stream = cx25840_s_stream, | 5076 | .s_stream = cx25840_s_stream, |
5073 | .g_input_status = cx25840_g_input_status, | 5077 | .g_input_status = cx25840_g_input_status, |
5074 | }; | 5078 | }; |
@@ -5080,12 +5084,17 @@ static const struct v4l2_subdev_vbi_ops cx25840_vbi_ops = { | |||
5080 | .g_sliced_fmt = cx25840_g_sliced_fmt, | 5084 | .g_sliced_fmt = cx25840_g_sliced_fmt, |
5081 | }; | 5085 | }; |
5082 | 5086 | ||
5087 | static const struct v4l2_subdev_pad_ops cx25840_pad_ops = { | ||
5088 | .set_fmt = cx25840_set_fmt, | ||
5089 | }; | ||
5090 | |||
5083 | static const struct v4l2_subdev_ops cx25840_ops = { | 5091 | static const struct v4l2_subdev_ops cx25840_ops = { |
5084 | .core = &cx25840_core_ops, | 5092 | .core = &cx25840_core_ops, |
5085 | .tuner = &cx25840_tuner_ops, | 5093 | .tuner = &cx25840_tuner_ops, |
5086 | .audio = &cx25840_audio_ops, | 5094 | .audio = &cx25840_audio_ops, |
5087 | .video = &cx25840_video_ops, | 5095 | .video = &cx25840_video_ops, |
5088 | .vbi = &cx25840_vbi_ops, | 5096 | .vbi = &cx25840_vbi_ops, |
5097 | .pad = &cx25840_pad_ops, | ||
5089 | .ir = &cx25840_ir_ops, | 5098 | .ir = &cx25840_ir_ops, |
5090 | }; | 5099 | }; |
5091 | 5100 | ||