From patchwork Sat Sep 11 01:26:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 4306 Return-path: Envelope-to: mchehab@pedra Delivery-date: Sat, 11 Sep 2010 10:18:50 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1OuPyj-00027h-PX for mchehab@pedra; Sat, 11 Sep 2010 10:18:50 -0300 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Sat, 11 Sep 2010 10:18:49 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OuErb-000757-7w; Sat, 11 Sep 2010 01:26:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293Ab0IKB0l (ORCPT + 1 other); Fri, 10 Sep 2010 21:26:41 -0400 Received: from d1.icnet.pl ([212.160.220.21]:41305 "EHLO d1.icnet.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353Ab0IKB0l (ORCPT ); Fri, 10 Sep 2010 21:26:41 -0400 Received: from 87-205-12-81.ip.netia.com.pl ([87.205.12.81] helo=vclass.intranet) by d1.icnet.pl with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1OuErY-0002fF-GX; Sat, 11 Sep 2010 03:26:40 +0200 From: Janusz Krzysztofik Organization: Tele-Info-System, Poznan, PL To: linux-media@vger.kernel.org Subject: [PATCH v2 4/6] SoC Camera: add support for g_parm / s_parm operations Date: Sat, 11 Sep 2010 03:26:16 +0200 User-Agent: KMail/1.9.10 Cc: Guennadi Liakhovetski , "Discussion of the Amstrad E3 emailer hardware/software" References: <201009110317.54899.jkrzyszt@tis.icnet.pl> In-Reply-To: <201009110317.54899.jkrzyszt@tis.icnet.pl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201009110326.17244.jkrzyszt@tis.icnet.pl> X-SA-Exim-Scanned: No (on d1.icnet); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab This patch adds support for g_parm / s_parm operations to the SoC Camera framework. It is usefull for checking/setting camera frame rate. Example usage can be found in the previous patch from this series, "SoC Camera: add driver for OV6650 sensor". Created and tested against linux-2.6.36-rc3 on Amstrad Delta. Signed-off-by: Janusz Krzysztofik --- v1->v2 changes: - no functional changes, - refreshed against linux-2.6.36-rc3. drivers/media/video/soc_camera.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -upr linux-2.6.36-rc3.orig/drivers/media/video/soc_camera.c linux-2.6.36-rc3/drivers/media/video/soc_camera.c --- linux-2.6.36-rc3.orig/drivers/media/video/soc_camera.c 2010-09-03 22:29:44.000000000 +0200 +++ linux-2.6.36-rc3/drivers/media/video/soc_camera.c 2010-09-03 22:34:03.000000000 +0200 @@ -1148,6 +1148,20 @@ static int default_s_crop(struct soc_cam return v4l2_subdev_call(sd, video, s_crop, a); } +static int default_g_parm(struct soc_camera_device *icd, + struct v4l2_streamparm *parm) +{ + struct v4l2_subdev *sd = soc_camera_to_subdev(icd); + return v4l2_subdev_call(sd, video, g_parm, parm); +} + +static int default_s_parm(struct soc_camera_device *icd, + struct v4l2_streamparm *parm) +{ + struct v4l2_subdev *sd = soc_camera_to_subdev(icd); + return v4l2_subdev_call(sd, video, s_parm, parm); +} + static void soc_camera_device_init(struct device *dev, void *pdata) { dev->platform_data = pdata; @@ -1179,6 +1193,10 @@ int soc_camera_host_register(struct soc_ ici->ops->get_crop = default_g_crop; if (!ici->ops->cropcap) ici->ops->cropcap = default_cropcap; + if (!ici->ops->set_parm) + ici->ops->set_parm = default_s_parm; + if (!ici->ops->get_parm) + ici->ops->get_parm = default_g_parm; mutex_lock(&list_lock); list_for_each_entry(ix, &hosts, list) {