From patchwork Tue Aug 15 22:03:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9902573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFDD4603FB for ; Tue, 15 Aug 2017 22:04:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29102893B for ; Tue, 15 Aug 2017 22:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6F4128943; Tue, 15 Aug 2017 22:04:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02F0E28949 for ; Tue, 15 Aug 2017 22:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Zd+K6bKaVhiqGOm/heI+96QR4iImnVUMvJtgRQgXhOQ=; b=u0v3o5mbXL3E74/nS6mQb61TY 0ZXhyg5KaCqNwtvk2NatJPmbWgZpB/J0F1x3gYJl2MxSgLp4OGTUAwqNXvharEZkN3RAhuTJIJL9p ROKxlkL4e4J6I4cFUiyC8Kqgbzpz/ZBmKMRg42olPXz8iNOi53PDXn+sKZBvn7imF2v43NcDaJF59 iVE852P7CG1ufgEsaOKnNz9JhWZvoIQbe4lZNDNdc3ZN0n49R+uaw+VrtSVvxVqb+DPSc2PsrgdjU uX6qn1Sr863YNmry/4zAlEqeHJnVIUt50S/p3N8HjFzMdbKurU4clHLpi4g9Bb/ba9QRPqrvWJ7du 8aTMI01LA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dhjwm-0000en-T4; Tue, 15 Aug 2017 22:04:24 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhjwi-0000cD-0T for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2017 22:04:22 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id DD026827D0; Wed, 16 Aug 2017 00:03:49 +0200 (CEST) Date: Wed, 16 Aug 2017 00:03:49 +0200 From: Pavel Machek To: Sakari Ailus Subject: Re: [PATCH] nokia n900: update dts with camera support Message-ID: <20170815220349.GA15441@amd> References: <20170810204923.GA18442@amd> <20170814201950.sbtyuksn3ntuigyp@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 In-Reply-To: <20170814201950.sbtyuksn3ntuigyp@valkosipuli.retiisi.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170815_150420_384868_5F352E71 X-CRM114-Status: GOOD ( 22.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ivo.g.dimitrov.75@gmail.com, khilman@kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, kernel list , sre@kernel.org, abcloriens@gmail.com, pali.rohar@gmail.com, linux-omap@vger.kernel.org, patrikbachan@gmail.com, linux-arm-kernel , serge@hallyn.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > I understand Tony already applied this one. I'd have a few comments below, > could you address them in another patch, please? Yes. > > + rear_camera: camera@0 { > > + compatible = "linux,camera"; > > + > > + module { > > + model = "TCM8341MD"; > > + sensor = <&cam1>; > > + }; > > + }; > > There's no reference to rear_camera. I understand that this represents the > camera module but as we don't have any documented way to describe camera > modules (nor we have really discussed the matter), this should be removed > for now. > > Perhaps later on, but I be it'd look quite different. Ok, this is easy. > > + bus-type = <3>; /* CCP2 */ > > + clock-lanes = <1>; > > + data-lanes = <0>; > > + lane-polarity = <0 0>; > > + clock-inv = <0>; > > + /* Select strobe = <1> for back camera, <0> for front camera */ > > + strobe = <1>; > > + crc = <0>; > > crc is not a documented binding in video-interfaces.txt. Same for > clock-inv. clock-inv is used by v4l2-fwnode.c already. Describing both in > video-interfaces.txt would certainly make sense though, as well as adding > support for crc in CCP2 to V4L2 fwnode. > > Could you submit patches for that? I can do that as well but it'll probably > take some days at least. Ok, no longer that easy. But see below, something like that? Could you suggest better documentation lines? I'm afraid Rob will not like "not inverted" vs. "inverted"... would "camera sensor protects image data of each frame with crc" be suitable? Best regards, Signed-off-by: Pavel Machek Pavel diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt index 852041a..aade681 100644 --- a/Documentation/devicetree/bindings/media/video-interfaces.txt +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt @@ -119,6 +119,8 @@ Optional endpoint properties as 0 (normal). This property is valid for serial busses only. - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used with CCP2, for instance. +- clock-inv: polarity of clock/strobe signal. 0 - not inverted, 1 - inverted +- crc: crc is in use Example ------- diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index b1be53d..0c1ef5c 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts @@ -144,15 +144,6 @@ io-channel-names = "temp", "bsi", "vbat"; }; - rear_camera: camera@0 { - compatible = "linux,camera"; - - module { - model = "TCM8341MD"; - sensor = <&cam1>; - }; - }; - pwm9: dmtimer-pwm { compatible = "ti,omap-dmtimer-pwm"; #pwm-cells = <3>; @@ -192,7 +183,7 @@ clock-inv = <0>; /* Select strobe = <1> for back camera, <0> for front camera */ strobe = <1>; - crc = <0>; + crc = <1>; }; }; }; diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 6cb1f04..3e17d72 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2098,12 +2098,12 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.strobe_clk_pol = vep.bus.mipi_csi1.clock_inv; + buscfg->bus.ccp2.crc = + vep.bus.mipi_csi1.crc; buscfg->bus.ccp2.phy_layer = vep.bus.mipi_csi1.strobe; buscfg->bus.ccp2.ccp2_mode = vep.bus_type == V4L2_MBUS_CCP2; buscfg->bus.ccp2.vp_clk_pol = 1; - - buscfg->bus.ccp2.crc = 1; } else { buscfg->bus.csi2.lanecfg.clk.pos = vep.bus.mipi_csi2.clock_lane; diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 5cd2687..ce1af2d 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -170,6 +170,9 @@ v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode, if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) bus->clock_lane = v; + if (!fwnode_property_read_u32(fwnode, "crc", &v)) + bus->crc = v; + if (bus_type == V4L2_FWNODE_BUS_TYPE_CCP2) vep->bus_type = V4L2_MBUS_CCP2; else diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h index cb34dcb..eb820dc 100644 --- a/include/media/v4l2-fwnode.h +++ b/include/media/v4l2-fwnode.h @@ -66,11 +66,13 @@ struct v4l2_fwnode_bus_parallel { * index (1) * @data_lane: the number of the data lane * @clock_lane: the number of the clock lane + * @crc: crc is in use */ struct v4l2_fwnode_bus_mipi_csi1 { bool clock_inv; bool strobe; bool lane_polarity[2]; + bool crc; unsigned char data_lane; unsigned char clock_lane; };