From patchwork Fri Jul 17 13:28:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BE42159A for ; Fri, 17 Jul 2020 13:25:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26759207DD for ; Fri, 17 Jul 2020 13:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbgGQNZl (ORCPT ); Fri, 17 Jul 2020 09:25:41 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:36237 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgGQNZk (ORCPT ); Fri, 17 Jul 2020 09:25:40 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 63C811C000D; Fri, 17 Jul 2020 13:25:36 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 01/13] dt-bindings: media: ov5640: Convert to json-schema Date: Fri, 17 Jul 2020 15:28:47 +0200 Message-Id: <20200717132859.237120-2-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Convert the ov5640 bindings document to json-schema. This commit ports the existing bindings, clean up patches will follow. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../devicetree/bindings/media/i2c/ov5640.txt | 92 --------- .../devicetree/bindings/media/i2c/ov5640.yaml | 181 ++++++++++++++++++ 2 files changed, 181 insertions(+), 92 deletions(-) delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov5640.txt create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5640.yaml diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.txt b/Documentation/devicetree/bindings/media/i2c/ov5640.txt deleted file mode 100644 index c97c2f2da12d..000000000000 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.txt +++ /dev/null @@ -1,92 +0,0 @@ -* Omnivision OV5640 MIPI CSI-2 / parallel sensor - -Required Properties: -- compatible: should be "ovti,ov5640" -- clocks: reference to the xclk input clock. -- clock-names: should be "xclk". -- DOVDD-supply: Digital I/O voltage supply, 1.8 volts -- AVDD-supply: Analog voltage supply, 2.8 volts -- DVDD-supply: Digital core voltage supply, 1.5 volts - -Optional Properties: -- reset-gpios: reference to the GPIO connected to the reset pin, if any. - This is an active low signal to the OV5640. -- powerdown-gpios: reference to the GPIO connected to the powerdown pin, - if any. This is an active high signal to the OV5640. -- rotation: as defined in - Documentation/devicetree/bindings/media/video-interfaces.txt, - valid values are 0 (sensor mounted upright) and 180 (sensor - mounted upside down). - -The device node must contain one 'port' child node for its digital output -video port, in accordance with the video interface bindings defined in -Documentation/devicetree/bindings/media/video-interfaces.txt. - -OV5640 can be connected to a MIPI CSI-2 bus or a parallel bus endpoint. - -Endpoint node required properties for CSI-2 connection are: -- remote-endpoint: a phandle to the bus receiver's endpoint node. -- clock-lanes: should be set to <0> (clock lane on hardware lane 0) -- data-lanes: should be set to <1> or <1 2> (one or two CSI-2 lanes supported) - -Endpoint node required properties for parallel connection are: -- remote-endpoint: a phandle to the bus receiver's endpoint node. -- bus-width: shall be set to <8> for 8 bits parallel bus - or <10> for 10 bits parallel bus -- data-shift: shall be set to <2> for 8 bits parallel bus - (lines 9:2 are used) or <0> for 10 bits parallel bus -- hsync-active: active state of the HSYNC signal, 0/1 for LOW/HIGH respectively. -- vsync-active: active state of the VSYNC signal, 0/1 for LOW/HIGH respectively. -- pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock - signal. - -Examples: - -&i2c1 { - ov5640: camera@3c { - compatible = "ovti,ov5640"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_ov5640>; - reg = <0x3c>; - clocks = <&clks IMX6QDL_CLK_CKO>; - clock-names = "xclk"; - DOVDD-supply = <&vgen4_reg>; /* 1.8v */ - AVDD-supply = <&vgen3_reg>; /* 2.8v */ - DVDD-supply = <&vgen2_reg>; /* 1.5v */ - powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; - rotation = <180>; - - port { - /* MIPI CSI-2 bus endpoint */ - ov5640_to_mipi_csi2: endpoint { - remote-endpoint = <&mipi_csi2_from_ov5640>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; - }; -}; - -&i2c1 { - ov5640: camera@3c { - compatible = "ovti,ov5640"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_ov5640>; - reg = <0x3c>; - clocks = <&clk_ext_camera>; - clock-names = "xclk"; - - port { - /* Parallel bus endpoint */ - ov5640_to_parallel: endpoint { - remote-endpoint = <¶llel_from_ov5640>; - bus-width = <8>; - data-shift = <2>; /* lines 9:2 are used */ - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <1>; - }; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml new file mode 100644 index 000000000000..ceeacc91c801 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/ov5640.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Omnivision OV5640 MIPI CSI-2 / parallel sensor + +maintainers: + - Steve Longerbeam + +description: -| + The OV5640 is a 5 megapixels image sensor capable of producing images in RGB, + RAW, YUV and compressed formats. It features a MIPI CSI-2 and a parallel data + interface and an I2C-compatible (CCI) control interface. + +properties: + compatible: + const: ovti,ov5640 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: xclk + + DOVDD-supply: + description: Digital I/O voltage supply, 1.8 volts. + maxItems: 1 + + AVDD-supply: + description: Analog voltage supply, 2.8 volts. + maxItems: 1 + + DVDD-supply: + description: Digital core voltage supply. + maxItems: 1 + + reset-gpios: + description: | + Reference to the GPIO connected to the reset pin, if any. This is an + active low signal to the OV5640. + maxItems: 1 + + powerdown-gpios: + description: | + Reference tot he GPIO connected to the powerdown pin, if any. This is an + active high signal to the OV5640. + maxItems: 1 + + rotation: + description: | + As defined in Documentation/devicetree/bindings/media/video-interfaces.txt + enum: [0, 180] + + port: + type: object + description: | + The device node must contain one 'port' child node for its digital output + video port, in accordance with the video interface bindings defined in + Documentation/devicetree/bindings/media/video-interfaces.txt. + + OV5640 can be connected to a MIPI CSI-2 bus or a parallel bus endpoint. + + properties: + endpoint: + type: object + properties: + remote-endpoint: + description: A phandle to the bus receiver's endpoint node. + + clock-lanes: + const: 0 + + data-lanes: + description: | + Should be set to <1> or <1 2> (one or two CSI-2 lanes supported). + oneOf: + - items: + - const: 1 + - items: + - const: 1 + - const: 2 + + bus-width: + description: | + Shall be set to <8> for 8 bits parallel bus or <10> for 10 bits + parallel bus. + enum: [8, 10] + + data-shift: + description: | + Shall be set to <2> for 8 bits parallel bus (lines 9:2 are used) or + <0> for 10 bits parallel bus. + enum: [0, 2] + + hsync-active: + enum: [0, 1] + + vsync-active: + enum: [0, 1] + + pclk-sample: + enum: [0, 1] + + required: + - remote-endpoint + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - DOVDD-supply + - AVDD-supply + - DVDD-supply + - port + +examples: + - | + #include + #include + + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&clks IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + DOVDD-supply = <&vgen4_reg>; /* 1.8v */ + AVDD-supply = <&vgen3_reg>; /* 2.8v */ + DVDD-supply = <&vgen2_reg>; /* 1.5v */ + powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; + rotation = <180>; + + port { + ov5640_to_mipi_csi2: endpoint { + remote-endpoint = <&mipi_csi2_from_ov5640>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; + }; + + i2c1 { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&clks IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + DOVDD-supply = <&vgen4_reg>; /* 1.8v */ + AVDD-supply = <&vgen3_reg>; /* 2.8v */ + DVDD-supply = <&vgen2_reg>; /* 1.5v */ + powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; + rotation = <180>; + + port { + ov5640_to_parallel: endpoint { + remote-endpoint = <¶llel_from_ov5640>; + bus-width = <10>; + }; + }; + }; + }; + +... From patchwork Fri Jul 17 13:28:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670165 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C83713B4 for ; Fri, 17 Jul 2020 13:25:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5011B2076A for ; Fri, 17 Jul 2020 13:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726426AbgGQNZn (ORCPT ); Fri, 17 Jul 2020 09:25:43 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:60637 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbgGQNZl (ORCPT ); Fri, 17 Jul 2020 09:25:41 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id D12AC1C000F; Fri, 17 Jul 2020 13:25:37 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, Andy Gross , Bjorn Andersson , Loic Poulain Subject: [PATCH 02/13] arm64: dts: qcom: apq8016-sbc: Fix CSI-2 lanes routing Date: Fri, 17 Jul 2020 15:28:48 +0200 Message-Id: <20200717132859.237120-3-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The ov5640 sensor does not support lanes reconfiguration according to version of the datasheet I have (version 2.03) and the driver does not parse the properties to try to reconfigure them. Fix the properties values in the camera and cci node. Signed-off-by: Jacopo Mondi --- Loic, I see you added the camera nodes in 39e0ce6cd1bf ("arm64: dts: qcom: apq8016-sbc: Add CCI/Sensor nodes") Do you have any idea how lanes could be swapped if, from my understanding, nor the sensor nor the driver supports that ? Thanks j --- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 8a4b790aa7ff..fe6613676e45 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -591,8 +591,8 @@ ports { port@0 { reg = <0>; csiphy0_ep: endpoint { - clock-lanes = <1>; - data-lanes = <0 2>; + clock-lanes = <0>; + data-lanes = <1 2>; remote-endpoint = <&ov5640_ep>; status = "okay"; }; @@ -627,8 +627,8 @@ camera_rear@3b { port { ov5640_ep: endpoint { - clock-lanes = <1>; - data-lanes = <0 2>; + clock-lanes = <0>; + data-lanes = <1 2>; remote-endpoint = <&csiphy0_ep>; }; }; From patchwork Fri Jul 17 13:28:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2500D13B4 for ; Fri, 17 Jul 2020 13:25:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 142502067D for ; Fri, 17 Jul 2020 13:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbgGQNZn (ORCPT ); Fri, 17 Jul 2020 09:25:43 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:48595 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbgGQNZm (ORCPT ); Fri, 17 Jul 2020 09:25:42 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 9E6AF1C0011; Fri, 17 Jul 2020 13:25:39 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 03/13] dt-bindings: media: ov5640: Do not limit rotation Date: Fri, 17 Jul 2020 15:28:49 +0200 Message-Id: <20200717132859.237120-4-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The 'rotation' property should not be limited to only support 0 and 180 degrees, as that limitation comes from the driver implementation and not from any device specific constraint. Remove the enumeration of supported values from 'rotation'. Signed-off-by: Jacopo Mondi --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index ceeacc91c801..503f8b78615c 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -55,7 +55,7 @@ properties: rotation: description: | As defined in Documentation/devicetree/bindings/media/video-interfaces.txt - enum: [0, 180] + maxItems: 1 port: type: object From patchwork Fri Jul 17 13:28:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17DE2138C for ; Fri, 17 Jul 2020 13:25:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3BC52076A for ; Fri, 17 Jul 2020 13:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgGQNZo (ORCPT ); Fri, 17 Jul 2020 09:25:44 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:60637 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgGQNZn (ORCPT ); Fri, 17 Jul 2020 09:25:43 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id F1DA71C0012; Fri, 17 Jul 2020 13:25:40 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, bparrot@ti.com Subject: [PATCH 04/13] dt-bindings: media: ti,cal: Remove sensor from example Date: Fri, 17 Jul 2020 15:28:50 +0200 Message-Id: <20200717132859.237120-5-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The newly introduced dt-schema bindings for the ov5640 image sensor triggered a warning in the ti,cal.yaml bindings file, which has a camera sensor node marked compatible with the sensor. As in the example is enough to report a node for the device that the bindings is about, and maintaining the sensor node up-to-date is a non-necessary burden, remove the image sensor node from the ti,cal bindings file. Signed-off-by: Jacopo Mondi Acked-by: Laurent Pinchart Reviewed-by: Rob Herring --- .../devicetree/bindings/media/ti,cal.yaml | 22 ------------------- 1 file changed, 22 deletions(-) -- 2.27.0 diff --git a/Documentation/devicetree/bindings/media/ti,cal.yaml b/Documentation/devicetree/bindings/media/ti,cal.yaml index 5e066629287d..fe5c74dd246e 100644 --- a/Documentation/devicetree/bindings/media/ti,cal.yaml +++ b/Documentation/devicetree/bindings/media/ti,cal.yaml @@ -177,26 +177,4 @@ examples: }; }; - i2c { - clock-frequency = <400000>; - #address-cells = <1>; - #size-cells = <0>; - - camera-sensor@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - - clocks = <&clk_ov5640_fixed>; - clock-names = "xclk"; - - port { - csi2_cam0: endpoint { - remote-endpoint = <&csi2_phy0>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; - }; - }; - ... From patchwork Fri Jul 17 13:28:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79F7B13B4 for ; Fri, 17 Jul 2020 13:25:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E38420717 for ; Fri, 17 Jul 2020 13:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726627AbgGQNZv (ORCPT ); Fri, 17 Jul 2020 09:25:51 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41171 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgGQNZv (ORCPT ); Fri, 17 Jul 2020 09:25:51 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 9746A1C000D; Fri, 17 Jul 2020 13:25:42 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , linux-omap@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), Maxime Ripard , Chen-Yu Tsai , Andy Gross , Bjorn Andersson , Tero Kristo , Nishanth Menon Subject: [PATCH 05/13] dt-bindings: media: ov5640: Make bus-type mandatory Date: Fri, 17 Jul 2020 15:28:51 +0200 Message-Id: <20200717132859.237120-6-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The ov5640 driver supports both a parallel data interface and a CSI-2 serial data interface. Depending on which interface is in use, the required endpoint properties are different. In order to be able to validate if a device node is compliant with the dt-schema bindings, start by making the bus-type a mandatory property, and add it to all the existing users of ov5640 in mainline DTS. On top of this, endpoint properties validation will be implemented, conditionally to the reported bus type. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 6 ++++++ arch/arm/boot/dts/dra72-evm-common.dtsi | 1 + arch/arm/boot/dts/dra76-evm.dts | 1 + arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi | 1 + arch/arm/boot/dts/imx6qdl-icore.dtsi | 1 + arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 1 + arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 1 + arch/arm/boot/dts/stm32mp157c-ev1.dts | 1 + arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts | 1 + arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 1 + arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 1 + arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 1 + 12 files changed, 17 insertions(+) -- 2.27.0 diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 503f8b78615c..16e6c2dc629a 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -73,6 +73,9 @@ properties: remote-endpoint: description: A phandle to the bus receiver's endpoint node. + bus-type: + enum: [4, 5] + clock-lanes: const: 0 @@ -109,6 +112,7 @@ properties: required: - remote-endpoint + - bus-type additionalProperties: false @@ -146,6 +150,7 @@ examples: port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_from_ov5640>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; @@ -172,6 +177,7 @@ examples: port { ov5640_to_parallel: endpoint { remote-endpoint = <¶llel_from_ov5640>; + bus-type = <5>; bus-width = <10>; }; }; diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi index c84b63bf0fc8..aba7eb55525d 100644 --- a/arch/arm/boot/dts/dra72-evm-common.dtsi +++ b/arch/arm/boot/dts/dra72-evm-common.dtsi @@ -287,6 +287,7 @@ ov5640@3c { port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts index 820a0ece20d4..ddf16e65ec7f 100644 --- a/arch/arm/boot/dts/dra76-evm.dts +++ b/arch/arm/boot/dts/dra76-evm.dts @@ -420,6 +420,7 @@ ov5640@3c { port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi index 9e027b9a5f91..dd5765778e87 100644 --- a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi +++ b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi @@ -274,6 +274,7 @@ ov5640: camera@10 { port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi index 756f3a9f1b4f..2b1f275b8cc4 100644 --- a/arch/arm/boot/dts/imx6qdl-icore.dtsi +++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi @@ -213,6 +213,7 @@ ov5640: camera@3c { port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index 8468216dae9b..5752abb48e68 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -382,6 +382,7 @@ ov5640: camera@40 { port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 28b35ccb3757..990f4cc345da 100644 --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -313,6 +313,7 @@ rev B board is VGEN5 */ port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts index b19056557ef0..613ede73b65b 100644 --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts @@ -190,6 +190,7 @@ ov5640: camera@3c { port { ov5640_0: endpoint { remote-endpoint = <&dcmi_0>; + bus-type = <5>; bus-width = <8>; data-shift = <2>; /* lines 9:2 are used */ hsync-active = <0>; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts index c7bd73f35ed8..6ef528bb5564 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts @@ -46,6 +46,7 @@ ov5640: camera@3c { port { ov5640_ep: endpoint { remote-endpoint = <&csi_ep>; + bus-type = <5>; bus-width = <8>; hsync-active = <1>; /* Active high */ vsync-active = <0>; /* Active low */ diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts index dc4ab6b434f9..8ebd6547786e 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts @@ -61,6 +61,7 @@ ov5640: camera@3c { port { ov5640_ep: endpoint { remote-endpoint = <&csi_ep>; + bus-type = <5>; bus-width = <8>; hsync-active = <1>; /* Active high */ vsync-active = <0>; /* Active low */ diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index fe6613676e45..5c79ad5e7b5d 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -627,6 +627,7 @@ camera_rear@3b { port { ov5640_ep: endpoint { + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; remote-endpoint = <&csiphy0_ep>; diff --git a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts index 2f3d3316a1cf..33f4eceffbe5 100644 --- a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts +++ b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts @@ -254,6 +254,7 @@ ov5640@3c { port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; + bus-type = <4>; clock-lanes = <0>; data-lanes = <1 2>; }; From patchwork Fri Jul 17 13:28:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA0B0138C for ; Fri, 17 Jul 2020 13:25:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C203620717 for ; Fri, 17 Jul 2020 13:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726675AbgGQNZw (ORCPT ); Fri, 17 Jul 2020 09:25:52 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:50569 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbgGQNZv (ORCPT ); Fri, 17 Jul 2020 09:25:51 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id A7B031C0012; Fri, 17 Jul 2020 13:25:48 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 06/13] dt-bindings: media: ov5640: Require ep properties Date: Fri, 17 Jul 2020 15:28:52 +0200 Message-Id: <20200717132859.237120-7-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Now that the bus-type property has been made mandatory for the ov5640 bindings, use the property value to mark endpoint properties as required depending on the data interface in use. Mark as 'required' all the properties that were defined as required in the original bindings in textual form. Adjust the example to comply with validation requirement but do not update the existing users as most of the required properties will be demoted in the next patches. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../devicetree/bindings/media/i2c/ov5640.yaml | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 16e6c2dc629a..8fd54575a1db 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -110,9 +110,40 @@ properties: pclk-sample: enum: [0, 1] - required: - - remote-endpoint - - bus-type + allOf: + - if: + properties: + bus-type: + const: 4 + then: + properties: + bus-width: false + data-shift: false + hsync-active: false + vsync-active: false + pclk-sample: false + required: + - remote-endpoint + - bus-type + - clock-lanes + - data-lanes + + - if: + properties: + bus-type: + const: 5 + then: + properties: + clock-lanes: false + data-lanes: false + required: + - remote-endpoint + - bus-type + - bus-width + - data-shift + - hsync-active + - vsync-active + - pclk-sample additionalProperties: false @@ -179,6 +210,10 @@ examples: remote-endpoint = <¶llel_from_ov5640>; bus-type = <5>; bus-width = <10>; + data-shift = <0>; + hsync-active = <1>; + vsync-active = <1>; + pclk-sample = <1>; }; }; }; From patchwork Fri Jul 17 13:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F16E13B4 for ; Fri, 17 Jul 2020 13:25:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 321242067D for ; Fri, 17 Jul 2020 13:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgGQNZ4 (ORCPT ); Fri, 17 Jul 2020 09:25:56 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:56803 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbgGQNZ4 (ORCPT ); Fri, 17 Jul 2020 09:25:56 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 0DDAB1C000C; Fri, 17 Jul 2020 13:25:49 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , linux-omap@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), Maxime Ripard , Chen-Yu Tsai , Andy Gross , Bjorn Andersson , Tero Kristo , Nishanth Menon Subject: [PATCH 07/13] dt-bindings: media: ov5640: Remove clock-lanes Date: Fri, 17 Jul 2020 15:28:53 +0200 Message-Id: <20200717132859.237120-8-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The ov5640 does not support routing the clock signal to a different lane, and the property has value fixed to 0. Remove the property from the bindings and update its users accordingly. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 6 ------ arch/arm/boot/dts/dra72-evm-common.dtsi | 1 - arch/arm/boot/dts/dra76-evm.dts | 1 - arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi | 1 - arch/arm/boot/dts/imx6qdl-icore.dtsi | 1 - arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 1 - arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 1 - arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 1 - arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 1 - 9 files changed, 14 deletions(-) -- 2.27.0 diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 8fd54575a1db..5e1662e848bd 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -76,9 +76,6 @@ properties: bus-type: enum: [4, 5] - clock-lanes: - const: 0 - data-lanes: description: | Should be set to <1> or <1 2> (one or two CSI-2 lanes supported). @@ -125,7 +122,6 @@ properties: required: - remote-endpoint - bus-type - - clock-lanes - data-lanes - if: @@ -134,7 +130,6 @@ properties: const: 5 then: properties: - clock-lanes: false data-lanes: false required: - remote-endpoint @@ -182,7 +177,6 @@ examples: ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_from_ov5640>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi index aba7eb55525d..b5b31dc927d4 100644 --- a/arch/arm/boot/dts/dra72-evm-common.dtsi +++ b/arch/arm/boot/dts/dra72-evm-common.dtsi @@ -288,7 +288,6 @@ port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts index ddf16e65ec7f..6fcb96abc41d 100644 --- a/arch/arm/boot/dts/dra76-evm.dts +++ b/arch/arm/boot/dts/dra76-evm.dts @@ -421,7 +421,6 @@ port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi index dd5765778e87..a12d80a2403e 100644 --- a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi +++ b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi @@ -275,7 +275,6 @@ port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi index 2b1f275b8cc4..05bd332f527b 100644 --- a/arch/arm/boot/dts/imx6qdl-icore.dtsi +++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi @@ -214,7 +214,6 @@ port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index 5752abb48e68..5eb7fbf33069 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -383,7 +383,6 @@ port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 990f4cc345da..02f78b46a8fd 100644 --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -314,7 +314,6 @@ port { ov5640_to_mipi_csi2: endpoint { remote-endpoint = <&mipi_csi2_in>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 5c79ad5e7b5d..8c24fd468a22 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -628,7 +628,6 @@ camera_rear@3b { port { ov5640_ep: endpoint { bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; remote-endpoint = <&csiphy0_ep>; }; diff --git a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts index 33f4eceffbe5..dd6a636ba3af 100644 --- a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts +++ b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts @@ -255,7 +255,6 @@ port { csi2_cam0: endpoint { remote-endpoint = <&csi2_phy0>; bus-type = <4>; - clock-lanes = <0>; data-lanes = <1 2>; }; }; From patchwork Fri Jul 17 13:28:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670193 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBDA1159A for ; Fri, 17 Jul 2020 13:25:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD2362076A for ; Fri, 17 Jul 2020 13:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbgGQNZ6 (ORCPT ); Fri, 17 Jul 2020 09:25:58 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46879 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgGQNZ6 (ORCPT ); Fri, 17 Jul 2020 09:25:58 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 51DC01C0012; Fri, 17 Jul 2020 13:25:54 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org, Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE) Subject: [PATCH 08/13] dt-bindings: media: ov5640: Remove data-shift Date: Fri, 17 Jul 2020 15:28:54 +0200 Message-Id: <20200717132859.237120-9-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The value of the data-shift property solely depend on the selected bus width and it's not freely configurable. Remove it from the bindings document and update its users accordingly. Signed-off-by: Jacopo Mondi --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 9 --------- arch/arm/boot/dts/stm32mp157c-ev1.dts | 1 - 2 files changed, 10 deletions(-) -- 2.27.0 diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 5e1662e848bd..ab700a1830aa 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -92,12 +92,6 @@ properties: parallel bus. enum: [8, 10] - data-shift: - description: | - Shall be set to <2> for 8 bits parallel bus (lines 9:2 are used) or - <0> for 10 bits parallel bus. - enum: [0, 2] - hsync-active: enum: [0, 1] @@ -115,7 +109,6 @@ properties: then: properties: bus-width: false - data-shift: false hsync-active: false vsync-active: false pclk-sample: false @@ -135,7 +128,6 @@ properties: - remote-endpoint - bus-type - bus-width - - data-shift - hsync-active - vsync-active - pclk-sample @@ -204,7 +196,6 @@ examples: remote-endpoint = <¶llel_from_ov5640>; bus-type = <5>; bus-width = <10>; - data-shift = <0>; hsync-active = <1>; vsync-active = <1>; pclk-sample = <1>; diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts index 613ede73b65b..96f96202ca63 100644 --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts @@ -192,7 +192,6 @@ ov5640_0: endpoint { remote-endpoint = <&dcmi_0>; bus-type = <5>; bus-width = <8>; - data-shift = <2>; /* lines 9:2 are used */ hsync-active = <0>; vsync-active = <0>; pclk-sample = <1>; From patchwork Fri Jul 17 13:28:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E08F0138C for ; Fri, 17 Jul 2020 13:26:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D321120775 for ; Fri, 17 Jul 2020 13:26:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgGQNZ7 (ORCPT ); Fri, 17 Jul 2020 09:25:59 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:42619 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgGQNZ7 (ORCPT ); Fri, 17 Jul 2020 09:25:59 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 39F871C0004; Fri, 17 Jul 2020 13:25:56 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 09/13] dt-bindings: media: ov5640: Add default for synch signals Date: Fri, 17 Jul 2020 15:28:55 +0200 Message-Id: <20200717132859.237120-10-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add defalt value for the DVP interface synchronism signals. The default values have been derived from register 0x4740 documentation (datasheet version 2.03) 0x4740 POLARITY CTRL00 default = 0x20 bit 5: pclk polarity = 1 active high bit 1: HREF polarity = 0 active low bit 0: VSYNC polarity = 0 active low Signed-off-by: Jacopo Mondi --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index ab700a1830aa..3c20cdd02f76 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -94,12 +94,15 @@ properties: hsync-active: enum: [0, 1] + default: 0 vsync-active: enum: [0, 1] + default: 0 pclk-sample: enum: [0, 1] + default: 1 allOf: - if: From patchwork Fri Jul 17 13:28:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670199 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1368C13B4 for ; Fri, 17 Jul 2020 13:26:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02417208DB for ; Fri, 17 Jul 2020 13:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbgGQN0B (ORCPT ); Fri, 17 Jul 2020 09:26:01 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44149 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgGQN0A (ORCPT ); Fri, 17 Jul 2020 09:26:00 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 8AE041C0017; Fri, 17 Jul 2020 13:25:57 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 10/13] dt-bindings: media: ov5640: Demote DVP required properties Date: Fri, 17 Jul 2020 15:28:56 +0200 Message-Id: <20200717132859.237120-11-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Now that properties have a default value assigned, do not mark them as required anymore in the bindings documentation. Signed-off-by: Jacopo Mondi --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 3c20cdd02f76..514f8150b52e 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -131,9 +131,6 @@ properties: - remote-endpoint - bus-type - bus-width - - hsync-active - - vsync-active - - pclk-sample additionalProperties: false From patchwork Fri Jul 17 13:28:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670205 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5F73159A for ; Fri, 17 Jul 2020 13:26:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B212C20717 for ; Fri, 17 Jul 2020 13:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbgGQN0C (ORCPT ); Fri, 17 Jul 2020 09:26:02 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:42619 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgGQN0B (ORCPT ); Fri, 17 Jul 2020 09:26:01 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E16A11C000C; Fri, 17 Jul 2020 13:25:58 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 11/13] media: i2c: ov5640: Initialize DVP polarities as default Date: Fri, 17 Jul 2020 15:28:57 +0200 Message-Id: <20200717132859.237120-12-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org With the bindings now updated to initialize the DVP synchronism signals to the values reported by the datasheet, update the driver to respect the same default values. The driver works-around a documentation bug and reports the VSYNC polarity control bit to be inverted. Regardless of the actual value written to the hardware register, initialize the DVP configuration to the defaults reported by the chip manual and the bindings document: - VSYNC: active low - HREF: active low - PCLK: active high Signed-off-by: Jacopo Mondi --- drivers/media/i2c/ov5640.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 2fe4a7ac0592..012ef1df59aa 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1212,9 +1212,9 @@ static int ov5640_set_stream_dvp(struct ov5640_dev *sensor, bool on) { int ret; unsigned int flags = sensor->ep.bus.parallel.flags; - u8 pclk_pol = 0; + u8 pclk_pol = 1; u8 hsync_pol = 0; - u8 vsync_pol = 0; + u8 vsync_pol = 1; /* * Note about parallel port configuration. @@ -1229,9 +1229,9 @@ static int ov5640_set_stream_dvp(struct ov5640_dev *sensor, bool on) * devicetree endpoint control lines properties. * If no endpoint control lines properties are set, * polarity will be as below: - * - VSYNC: active high + * - VSYNC: active low * - HREF: active low - * - PCLK: active low + * - PCLK: active high */ if (on) { @@ -1245,12 +1245,12 @@ static int ov5640_set_stream_dvp(struct ov5640_dev *sensor, bool on) * datasheet and hardware, 0 is active high * and 1 is active low...) */ - if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING) - pclk_pol = 1; + if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) + pclk_pol = 0; if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) hsync_pol = 1; - if (flags & V4L2_MBUS_VSYNC_ACTIVE_LOW) - vsync_pol = 1; + if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) + vsync_pol = 0; ret = ov5640_write_reg(sensor, OV5640_REG_POLARITY_CTRL00, From patchwork Fri Jul 17 13:28:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670209 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FCD8159A for ; Fri, 17 Jul 2020 13:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E05D2076A for ; Fri, 17 Jul 2020 13:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbgGQN0D (ORCPT ); Fri, 17 Jul 2020 09:26:03 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44149 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgGQN0C (ORCPT ); Fri, 17 Jul 2020 09:26:02 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 3E3841C0004; Fri, 17 Jul 2020 13:26:00 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 12/13] MAINTAINERS: ov5640: Add bindings file Date: Fri, 17 Jul 2020 15:28:58 +0200 Message-Id: <20200717132859.237120-13-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add the newly introduced bindings file to the list of files associated with the ov5640 driver in the MAINTAINERS file. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2730af1265ea..fc2a2129d18e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12604,6 +12604,7 @@ M: Steve Longerbeam L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git +F: Documentation/devicetree/bindings/media/i2c/ov5640.yaml F: drivers/media/i2c/ov5640.c OMNIVISION OV5647 SENSOR DRIVER From patchwork Fri Jul 17 13:28:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11670211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3D36138C for ; Fri, 17 Jul 2020 13:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4A952067D for ; Fri, 17 Jul 2020 13:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbgGQN0E (ORCPT ); Fri, 17 Jul 2020 09:26:04 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:42619 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgGQN0E (ORCPT ); Fri, 17 Jul 2020 09:26:04 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id AB49C1C0019; Fri, 17 Jul 2020 13:26:01 +0000 (UTC) From: Jacopo Mondi To: robh+dt@kernel.org, devicetree@vger.kernel.org Cc: Jacopo Mondi , slongerbeam@gmail.com, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-renesas-soc@vger.kernel.org Subject: [PATCH 13/13] dt-bindings: media: ov5640: Add myself as co-maintainer Date: Fri, 17 Jul 2020 15:28:59 +0200 Message-Id: <20200717132859.237120-14-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717132859.237120-1-jacopo+renesas@jmondi.org> References: <20200717132859.237120-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add myself as co-maintainer of the driver and the bindings file. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- Documentation/devicetree/bindings/media/i2c/ov5640.yaml | 1 + MAINTAINERS | 1 + 2 files changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml index 514f8150b52e..e28ea471bc00 100644 --- a/Documentation/devicetree/bindings/media/i2c/ov5640.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ov5640.yaml @@ -8,6 +8,7 @@ title: Omnivision OV5640 MIPI CSI-2 / parallel sensor maintainers: - Steve Longerbeam + - Jacopo Mondi description: -| The OV5640 is a 5 megapixels image sensor capable of producing images in RGB, diff --git a/MAINTAINERS b/MAINTAINERS index fc2a2129d18e..b5dd706d072b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12601,6 +12601,7 @@ F: drivers/media/i2c/ov2740.c OMNIVISION OV5640 SENSOR DRIVER M: Steve Longerbeam +M: Jacopo Mondi L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git