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: 170872 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 o8B1QhiO023858 for ; Sat, 11 Sep 2010 01:26:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293Ab0IKB0l (ORCPT ); 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 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 (demeter1.kernel.org [140.211.167.41]); Sat, 11 Sep 2010 01:26:43 +0000 (UTC) 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) {