From patchwork Fri Sep 24 17:17:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 206652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8OHb6XA008522 for ; Fri, 24 Sep 2010 17:37:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756827Ab0IXRgL (ORCPT ); Fri, 24 Sep 2010 13:36:11 -0400 Received: from queueout04-winn.ispmail.ntl.com ([81.103.221.58]:53382 "EHLO queueout04-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756234Ab0IXRgJ (ORCPT ); Fri, 24 Sep 2010 13:36:09 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Sep 2010 17:37:06 +0000 (UTC) X-Greylist: delayed 1127 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Sep 2010 13:36:08 EDT Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100924171750.LOZQ3192.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Fri, 24 Sep 2010 18:17:50 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20100924171750.BRMT1807.aamtaout03-winn.ispmail.ntl.com@zog.reactivated.net>; Fri, 24 Sep 2010 18:17:50 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id DF4369D401C; Fri, 24 Sep 2010 18:17:47 +0100 (BST) From: Daniel Drake To: mchehab@infradead.org Cc: linux-media@vger.kernel.org Cc: corbet@lwn.net Subject: [PATCH 4/4] cafe_ccic: Implement VIDIOC_ENUM_FRAMEINTERVALS and ENUM_FRAMESIZES Message-Id: <20100924171747.DF4369D401C@zog.reactivated.net> Date: Fri, 24 Sep 2010 18:17:47 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=DhNl2YeytwJssBBGe49HJX82LNDFEEVkpVB34RXKaPo= c=1 sm=0 a=wtsZW6SwX9AA:10 a=Op-mwl0xAAAA:8 a=-4wBQL-GmhFNDnwk9C8A:9 a=NXgaJakpYCEpYilVle4A:7 a=r359BH6qRcycJvTk6HoMzgmjtzIA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 8ddd2b6..09ec476 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c @@ -1650,6 +1650,30 @@ static int cafe_vidioc_g_chip_ident(struct file *file, void *priv, return sensor_call(cam, core, g_chip_ident, chip); } +static int cafe_vidioc_enum_framesizes(struct file *filp, void *priv, + struct v4l2_frmsizeenum *sizes) +{ + struct cafe_camera *cam = priv; + int ret; + + mutex_lock(&cam->s_mutex); + ret = sensor_call(cam, video, enum_framesizes, sizes); + mutex_unlock(&cam->s_mutex); + return ret; +} + +static int cafe_vidioc_enum_frameintervals(struct file *filp, void *priv, + struct v4l2_frmivalenum *interval) +{ + struct cafe_camera *cam = priv; + int ret; + + mutex_lock(&cam->s_mutex); + ret = sensor_call(cam, video, enum_frameintervals, interval); + mutex_unlock(&cam->s_mutex); + return ret; +} + #ifdef CONFIG_VIDEO_ADV_DEBUG static int cafe_vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg) @@ -1713,6 +1737,8 @@ static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = { .vidioc_s_ctrl = cafe_vidioc_s_ctrl, .vidioc_g_parm = cafe_vidioc_g_parm, .vidioc_s_parm = cafe_vidioc_s_parm, + .vidioc_enum_framesizes = cafe_vidioc_enum_framesizes, + .vidioc_enum_frameintervals = cafe_vidioc_enum_frameintervals, .vidioc_g_chip_ident = cafe_vidioc_g_chip_ident, #ifdef CONFIG_VIDEO_ADV_DEBUG .vidioc_g_register = cafe_vidioc_g_register,