From patchwork Tue Feb 9 09:25:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 77986 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o199PD9t008846 for ; Tue, 9 Feb 2010 09:25:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753907Ab0BIJZL (ORCPT ); Tue, 9 Feb 2010 04:25:11 -0500 Received: from mail.gmx.net ([213.165.64.20]:35498 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752234Ab0BIJZK (ORCPT ); Tue, 9 Feb 2010 04:25:10 -0500 Received: (qmail invoked by alias); 09 Feb 2010 09:25:08 -0000 Received: from p57BD1864.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.24.100] by mail.gmx.net (mp058) with SMTP; 09 Feb 2010 10:25:08 +0100 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/6rPMKYwH6lLsxSNWoHbIOz2XYzWPQ4g2aeuktvl KopF3u0K9+UDji Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1NemLq-0001PA-2D; Tue, 09 Feb 2010 10:25:46 +0100 Date: Tue, 9 Feb 2010 10:25:46 +0100 (CET) From: Guennadi Liakhovetski To: Kuninori Morimoto cc: Linux-V4L2 , Magnus Damm Subject: [PATCH 1/2] soc-camera: add support for VIDIOC_S_PARM and VIDIOC_G_PARM ioctls In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53000000000000003 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Feb 2010 09:25:13 +0000 (UTC) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 6b3fbcc..abce210 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -781,6 +781,32 @@ static int soc_camera_s_crop(struct file *file, void *fh, return ret; } +static int soc_camera_g_parm(struct file *file, void *fh, + struct v4l2_streamparm *a) +{ + struct soc_camera_file *icf = file->private_data; + struct soc_camera_device *icd = icf->icd; + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); + + if (ici->ops->get_parm) + return ici->ops->get_parm(icd, a); + + return -ENOIOCTLCMD; +} + +static int soc_camera_s_parm(struct file *file, void *fh, + struct v4l2_streamparm *a) +{ + struct soc_camera_file *icf = file->private_data; + struct soc_camera_device *icd = icf->icd; + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); + + if (ici->ops->set_parm) + return ici->ops->set_parm(icd, a); + + return -ENOIOCTLCMD; +} + static int soc_camera_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident *id) { @@ -1260,6 +1286,8 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = { .vidioc_cropcap = soc_camera_cropcap, .vidioc_g_crop = soc_camera_g_crop, .vidioc_s_crop = soc_camera_s_crop, + .vidioc_g_parm = soc_camera_g_parm, + .vidioc_s_parm = soc_camera_s_parm, .vidioc_g_chip_ident = soc_camera_g_chip_ident, #ifdef CONFIG_VIDEO_ADV_DEBUG .vidioc_g_register = soc_camera_g_register, diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index dcc5b86..5a17365 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -81,6 +81,8 @@ struct soc_camera_host_ops { int (*set_bus_param)(struct soc_camera_device *, __u32); int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); + int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); + int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); unsigned int (*poll)(struct file *, poll_table *); const struct v4l2_queryctrl *controls; int num_controls;