From patchwork Fri Jul 29 10:56:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1019742 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6TAvOGj007584 for ; Fri, 29 Jul 2011 10:57:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756353Ab1G2K5T (ORCPT ); Fri, 29 Jul 2011 06:57:19 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:50004 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756169Ab1G2K5E (ORCPT ); Fri, 29 Jul 2011 06:57:04 -0400 Received: from axis700.grange (dslb-084-061-105-216.pools.arcor-ip.net [84.61.105.216]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lualk-1RUiNy2ZYe-010Fgr; Fri, 29 Jul 2011 12:57:03 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id ABF1918B043 for ; Fri, 29 Jul 2011 12:57:00 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1QmkkW-0007nq-Et for linux-media@vger.kernel.org; Fri, 29 Jul 2011 12:57:00 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Subject: [PATCH 18/59] V4L: ov9740: support the new mbus-config subdev ops Date: Fri, 29 Jul 2011 12:56:18 +0200 Message-Id: <1311937019-29914-19-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1311937019-29914-1-git-send-email-g.liakhovetski@gmx.de> References: <1311937019-29914-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:AvpQdQJBfGjYQK3VNiXh2+Hkup3nh13tWk5ykrBSY1j 9dB+d3gU8lFrsv6BRb1nTgaAWhTcfp3IO/nr5YtCTJ2H9NIxdO PL9KQGrC0kfgdMTknfjr4YRzANs4+SRgyur9KoGwjFFuVM/nx+ TQ83dGxI87LlK8oTQr/FeztO2Y7AQTnZq7FNHQ2/gYM9d96mya RlzmXxv+BqoY7ui1bPRHGtRSHMLcNdh/eFPXy3ZsFQ= 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Jul 2011 10:57:24 +0000 (UTC) Extend the driver to also support [gs]_mbus_config() subdevice video operations. Signed-off-by: Guennadi Liakhovetski --- drivers/media/video/ov9740.c | 33 ++++++++++++++++++++++++++------- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/ov9740.c b/drivers/media/video/ov9740.c index edd1ffc..67b7020 100644 --- a/drivers/media/video/ov9740.c +++ b/drivers/media/video/ov9740.c @@ -14,8 +14,10 @@ #include #include #include -#include + #include +#include +#include #define to_ov9740(sd) container_of(sd, struct ov9740_priv, subdev) @@ -949,13 +951,30 @@ static struct soc_camera_ops ov9740_ops = { .num_controls = ARRAY_SIZE(ov9740_controls), }; +static int ov9740_g_mbus_config(struct v4l2_subdev *sd, + struct v4l2_mbus_config *cfg) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + struct soc_camera_device *icd = client->dev.platform_data; + struct soc_camera_link *icl = to_soc_camera_link(icd); + + cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | + V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | + V4L2_MBUS_DATA_ACTIVE_HIGH; + cfg->type = V4L2_MBUS_PARALLEL; + cfg->flags = soc_camera_apply_board_flags(icl, cfg); + + return 0; +} + static struct v4l2_subdev_video_ops ov9740_video_ops = { - .s_stream = ov9740_s_stream, - .s_mbus_fmt = ov9740_s_fmt, - .try_mbus_fmt = ov9740_try_fmt, - .enum_mbus_fmt = ov9740_enum_fmt, - .cropcap = ov9740_cropcap, - .g_crop = ov9740_g_crop, + .s_stream = ov9740_s_stream, + .s_mbus_fmt = ov9740_s_fmt, + .try_mbus_fmt = ov9740_try_fmt, + .enum_mbus_fmt = ov9740_enum_fmt, + .cropcap = ov9740_cropcap, + .g_crop = ov9740_g_crop, + .g_mbus_config = ov9740_g_mbus_config, }; static struct v4l2_subdev_core_ops ov9740_core_ops = {