diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-04 10:48:00 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-23 20:01:15 +0100 |
commit | 17bef885249db5db921ac8cf6e23938a91a6cd7b (patch) | |
tree | 23f58ecb46904cc3fbe4f5f4fbbe53a6dc4c9735 /drivers/media/platform/via-camera.c | |
parent | [media] DocBook media: document the new 'which' field (diff) | |
download | linux-17bef885249db5db921ac8cf6e23938a91a6cd7b.tar.xz linux-17bef885249db5db921ac8cf6e23938a91a6cd7b.zip |
[media] v4l2-subdev: add support for the new enum_frame_interval 'which' field
Support the new 'which' field in the enum_frame_interval ops. Most drivers do not
need to be changed since they always returns the same enumeration regardless
of the 'which' field.
Tested for ov7670 and marvell-ccic on a OLPC XO-1 laptop.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/via-camera.c')
-rw-r--r-- | drivers/media/platform/via-camera.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c index 86989d86abfa..678ed9f353cb 100644 --- a/drivers/media/platform/via-camera.c +++ b/drivers/media/platform/via-camera.c @@ -1147,12 +1147,23 @@ static int viacam_enum_frameintervals(struct file *filp, void *priv, struct v4l2_frmivalenum *interval) { struct via_camera *cam = priv; + struct v4l2_subdev_frame_interval_enum fie = { + .index = interval->index, + .code = cam->mbus_code, + .width = cam->sensor_format.width, + .height = cam->sensor_format.height, + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + }; int ret; mutex_lock(&cam->lock); - ret = sensor_call(cam, video, enum_frameintervals, interval); + ret = sensor_call(cam, pad, enum_frame_interval, NULL, &fie); mutex_unlock(&cam->lock); - return ret; + if (ret) + return ret; + interval->type = V4L2_FRMIVAL_TYPE_DISCRETE; + interval->discrete = fie.interval; + return 0; } |