aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-03-04 04:47:58 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-23 14:48:55 -0400
commit5778e749c152567ac15201fcd988bc1604878021 (patch)
tree3d9c769fbe9f342f4b6f2f925635e90e2c51814e /drivers/media/i2c
parent3f1ccf16f3ea015e57c326c2b14010bf119b6184 (diff)
[media] v4l2-subdev: add support for the new enum_frame_size 'which' field
Support the new 'which' field in the enum_frame_size ops. Most drivers do not need to be changed since they always returns the same enumeration regardless of the 'which' field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/s5c73m3/s5c73m3-core.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index 257a335c0ece..08b234bd2962 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1251,6 +1251,7 @@ static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd,
1251 struct v4l2_subdev_pad_config *cfg, 1251 struct v4l2_subdev_pad_config *cfg,
1252 struct v4l2_subdev_frame_size_enum *fse) 1252 struct v4l2_subdev_frame_size_enum *fse)
1253{ 1253{
1254 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd);
1254 int idx; 1255 int idx;
1255 1256
1256 if (fse->pad == OIF_SOURCE_PAD) { 1257 if (fse->pad == OIF_SOURCE_PAD) {
@@ -1260,11 +1261,25 @@ static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd,
1260 switch (fse->code) { 1261 switch (fse->code) {
1261 case S5C73M3_JPEG_FMT: 1262 case S5C73M3_JPEG_FMT:
1262 case S5C73M3_ISP_FMT: { 1263 case S5C73M3_ISP_FMT: {
1263 struct v4l2_mbus_framefmt *mf = 1264 unsigned w, h;
1264 v4l2_subdev_get_try_format(sd, cfg, OIF_ISP_PAD); 1265
1266 if (fse->which == V4L2_SUBDEV_FORMAT_TRY) {
1267 struct v4l2_mbus_framefmt *mf;
1268
1269 mf = v4l2_subdev_get_try_format(sd, cfg,
1270 OIF_ISP_PAD);
1271
1272 w = mf->width;
1273 h = mf->height;
1274 } else {
1275 const struct s5c73m3_frame_size *fs;
1265 1276
1266 fse->max_width = fse->min_width = mf->width; 1277 fs = state->oif_pix_size[RES_ISP];
1267 fse->max_height = fse->min_height = mf->height; 1278 w = fs->width;
1279 h = fs->height;
1280 }
1281 fse->max_width = fse->min_width = w;
1282 fse->max_height = fse->min_height = h;
1268 return 0; 1283 return 0;
1269 } 1284 }
1270 default: 1285 default: