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: 112589 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6I4Qboo026473 for ; Sun, 18 Jul 2010 04:26:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438Ab0GRE0g (ORCPT ); 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 18 Jul 2010 04:26:37 +0000 (UTC) --- 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) {