aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cafe_ccic.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2006-12-01 13:50:59 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 06:05:31 -0500
commitc8f5b2f5607e78c61df229259c539a5d9488a013 (patch)
tree918f87bf2f2a85e020bac3f45297a1f4c05a6208 /drivers/media/video/cafe_ccic.c
parenta66d23368068d6027feedc010304d510e6d1fe56 (diff)
V4L/DVB (4909): Add s/g_parm to cafe_ccic
Add s/g_parm support allowing applications to tweak the frame rate. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cafe_ccic.c')
-rw-r--r--drivers/media/video/cafe_ccic.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 9d9844e22951..e347c7ebc984 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -1671,6 +1671,37 @@ static int cafe_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id *a)
1671 return 0; 1671 return 0;
1672} 1672}
1673 1673
1674/*
1675 * G/S_PARM. Most of this is done by the sensor, but we are
1676 * the level which controls the number of read buffers.
1677 */
1678static int cafe_vidioc_g_parm(struct file *filp, void *priv,
1679 struct v4l2_streamparm *parms)
1680{
1681 struct cafe_camera *cam = priv;
1682 int ret;
1683
1684 mutex_lock(&cam->s_mutex);
1685 ret = __cafe_cam_cmd(cam, VIDIOC_G_PARM, parms);
1686 mutex_unlock(&cam->s_mutex);
1687 parms->parm.capture.readbuffers = n_dma_bufs;
1688 return ret;
1689}
1690
1691static int cafe_vidioc_s_parm(struct file *filp, void *priv,
1692 struct v4l2_streamparm *parms)
1693{
1694 struct cafe_camera *cam = priv;
1695 int ret;
1696
1697 mutex_lock(&cam->s_mutex);
1698 ret = __cafe_cam_cmd(cam, VIDIOC_S_PARM, parms);
1699 mutex_unlock(&cam->s_mutex);
1700 parms->parm.capture.readbuffers = n_dma_bufs;
1701 return ret;
1702}
1703
1704
1674static void cafe_v4l_dev_release(struct video_device *vd) 1705static void cafe_v4l_dev_release(struct video_device *vd)
1675{ 1706{
1676 struct cafe_camera *cam = container_of(vd, struct cafe_camera, v4ldev); 1707 struct cafe_camera *cam = container_of(vd, struct cafe_camera, v4ldev);
@@ -1724,7 +1755,8 @@ static struct video_device cafe_v4l_template = {
1724 .vidioc_queryctrl = cafe_vidioc_queryctrl, 1755 .vidioc_queryctrl = cafe_vidioc_queryctrl,
1725 .vidioc_g_ctrl = cafe_vidioc_g_ctrl, 1756 .vidioc_g_ctrl = cafe_vidioc_g_ctrl,
1726 .vidioc_s_ctrl = cafe_vidioc_s_ctrl, 1757 .vidioc_s_ctrl = cafe_vidioc_s_ctrl,
1727 /* Do cropping someday */ 1758 .vidioc_g_parm = cafe_vidioc_g_parm,
1759 .vidioc_s_parm = cafe_vidioc_s_parm,
1728}; 1760};
1729 1761
1730 1762