From patchwork Sun Jul 18 04:26:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 3819 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 18 Jul 2010 04:26:38 +0000 Received: from bombadil.infradead.org [18.85.46.34] by localhost with IMAP (fetchmail-6.3.17) for (single-drop); Sun, 18 Jul 2010 01:30:15 -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 1OaLSY-00040m-2Z; Sun, 18 Jul 2010 04:26:38 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438Ab0GRE0g (ORCPT + 1 other); Sun, 18 Jul 2010 00:26:36 -0400 Received: from d1.icnet.pl ([212.160.220.21]:56527 "EHLO d1.icnet.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751381Ab0GRE0f (ORCPT ); Sun, 18 Jul 2010 00:26:35 -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 1OaLSU-0007TV-RB; Sun, 18 Jul 2010 06:26:34 +0200 From: Janusz Krzysztofik Organization: Tele-Info-System, Poznan, PL To: linux-media@vger.kernel.org Subject: [RFC] [PATCH 4/6] SoC Camera: add support for g_parm / s_parm operations Date: Sun, 18 Jul 2010 06:26:08 +0200 User-Agent: KMail/1.9.10 Cc: Guennadi Liakhovetski , "Discussion of the Amstrad E3 emailer hardware/software" References: <201007180618.08266.jkrzyszt@tis.icnet.pl> In-Reply-To: <201007180618.08266.jkrzyszt@tis.icnet.pl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201007180626.11370.jkrzyszt@tis.icnet.pl> X-SA-Exim-Scanned: No (on d1.icnet); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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.35-rc3 on Amstrad Delta. Signed-off-by: Janusz Krzysztofik --- 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 --- linux-2.6.35-rc3.orig/drivers/media/video/soc_camera.c 2010-06-26 15:55:34.000000000 +0200 +++ linux-2.6.35-rc3/drivers/media/video/soc_camera.c 2010-06-27 00:04:10.000000000 +0200 @@ -1144,6 +1144,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; @@ -1175,6 +1189,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) {