From patchwork Mon Mar 15 16:30:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12139995 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 744FAC433E0 for ; Mon, 15 Mar 2021 16:31:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 412A164F2A for ; Mon, 15 Mar 2021 16:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231740AbhCOQa7 (ORCPT ); Mon, 15 Mar 2021 12:30:59 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:51503 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbhCOQar (ORCPT ); Mon, 15 Mar 2021 12:30:47 -0400 X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C082E240002; Mon, 15 Mar 2021 16:30:43 +0000 (UTC) From: Jacopo Mondi To: Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Kieran Bingham , Rob Herring Cc: Jacopo Mondi , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: media: max9286: Describe gpio-hog Date: Mon, 15 Mar 2021 17:30:25 +0100 Message-Id: <20210315163028.173148-2-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210315163028.173148-1-jacopo+renesas@jmondi.org> References: <20210315163028.173148-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The MAX9286 GMSL deserializer features gpio controller capabilities, as it provides 2 GPIO lines. As establishing a regulator that uses one of the GPIO lines and enabling/disabling it at run-time in the max9286 won't work due to a circular dependency on the gpio-controller/regulator creation, allow the usage of a gpio-hog for that purpose. The usage of the gpio-hog is required in designs where the MAX9286 GPIO lines control the remote cameras power. Signed-off-by: Jacopo Mondi --- .../bindings/media/i2c/maxim,max9286.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml index ee16102fdfe7..9038300e373c 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml @@ -177,6 +177,22 @@ properties: additionalProperties: false +patternProperties: + "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$": + type: object + properties: + gpio-hog: true + gpios: true + output-low: true + line-name: true + + required: + - gpio-hog + - gpios + - output-low + + additionalProperties: false + required: - compatible - reg From patchwork Mon Mar 15 16:30:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12139999 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D619C43381 for ; Mon, 15 Mar 2021 16:31:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F72764F40 for ; Mon, 15 Mar 2021 16:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhCOQa7 (ORCPT ); Mon, 15 Mar 2021 12:30:59 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:30893 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbhCOQat (ORCPT ); Mon, 15 Mar 2021 12:30:49 -0400 X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 44B6124000F; Mon, 15 Mar 2021 16:30:46 +0000 (UTC) From: Jacopo Mondi To: Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Kieran Bingham , Rob Herring Cc: Jacopo Mondi , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] arm64: dts: renesas: eagle: Enable MAX9286 Date: Mon, 15 Mar 2021 17:30:26 +0100 Message-Id: <20210315163028.173148-3-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210315163028.173148-1-jacopo+renesas@jmondi.org> References: <20210315163028.173148-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Enable the MAX9286 GMSL deserializer on the Eagle-V3M board. Connected cameras should be defined in a device-tree overlay or included after these definitions. Signed-off-by: Kieran Bingham Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- .../arm64/boot/dts/renesas/r8a77970-eagle.dts | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts index 874a7fc2730b..d2f63cccc238 100644 --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts @@ -6,6 +6,8 @@ * Copyright (C) 2017 Cogent Embedded, Inc. */ +#include + /dts-v1/; #include "r8a77970.dtsi" @@ -188,6 +190,11 @@ i2c0_pins: i2c0 { function = "i2c0"; }; + i2c3_pins: i2c3 { + groups = "i2c3_a"; + function = "i2c3"; + }; + qspi0_pins: qspi0 { groups = "qspi0_ctrl", "qspi0_data4"; function = "qspi0"; @@ -266,6 +273,131 @@ &rwdt { status = "okay"; }; +&csi40 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csi40_in: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&max9286_out0>; + }; + }; + }; +}; + +&i2c3 { + pinctrl-0 = <&i2c3_pins>; + pinctrl-names = "default"; + + status = "okay"; + clock-frequency = <400000>; + + gmsl: gmsl-deserializer@48 { + gpio-controller; + #gpio-cells = <2>; + + compatible = "maxim,max9286"; + reg = <0x48>; + + /* eagle-pca9654-max9286-pwdn */ + enable-gpios = <&io_expander 0 GPIO_ACTIVE_HIGH>; + + /* + * Workaround: Hog the CAMVDD line high as we can't establish a + * regulator-fixed on the gpio_chip exposed by &gmsl due to + * circular-dependency issues. + */ + camvdd-en-hog { + gpio-hog; + gpios = <0 0>; + output-low; + line-name = "CAMVDD_EN"; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + max9286_in0: endpoint { + }; + }; + + port@1 { + reg = <1>; + max9286_in1: endpoint { + }; + }; + + port@2 { + reg = <2>; + max9286_in2: endpoint { + }; + }; + + port@3 { + reg = <3>; + max9286_in3: endpoint { + }; + }; + + port@4 { + reg = <4>; + max9286_out0: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&csi40_in>; + }; + }; + }; + + i2c-mux { + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + status = "disabled"; + }; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + status = "disabled"; + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + status = "disabled"; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + status = "disabled"; + }; + }; + }; +}; + &scif0 { pinctrl-0 = <&scif0_pins>; pinctrl-names = "default"; From patchwork Mon Mar 15 16:30:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12140003 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E45C43332 for ; Mon, 15 Mar 2021 16:31:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3459B64F37 for ; Mon, 15 Mar 2021 16:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbhCOQbA (ORCPT ); Mon, 15 Mar 2021 12:31:00 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:64737 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbhCOQaw (ORCPT ); Mon, 15 Mar 2021 12:30:52 -0400 X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id DCB4E240012; Mon, 15 Mar 2021 16:30:48 +0000 (UTC) From: Jacopo Mondi To: Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Kieran Bingham , Rob Herring Cc: Jacopo Mondi , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] arm64: dts: renesas: eagle: Add GMSL .dtsi Date: Mon, 15 Mar 2021 17:30:27 +0100 Message-Id: <20210315163028.173148-4-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210315163028.173148-1-jacopo+renesas@jmondi.org> References: <20210315163028.173148-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Describe the FAKRA connector available on Eagle board that allows connecting GMSL camera modules such as IMI RDACM20 and RDACM21. Signed-off-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- arch/arm64/boot/dts/renesas/eagle-gmsl.dtsi | 186 ++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 arch/arm64/boot/dts/renesas/eagle-gmsl.dtsi diff --git a/arch/arm64/boot/dts/renesas/eagle-gmsl.dtsi b/arch/arm64/boot/dts/renesas/eagle-gmsl.dtsi new file mode 100644 index 000000000000..ec3e7493aa71 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/eagle-gmsl.dtsi @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Device Tree Source (overlay) for the Eagle V3M GMSL connectors + * + * Copyright (C) 2017 Ideas on Board + * Copyright (C) 2021 Jacopo Mondi + * + * This overlay allows you to define GMSL cameras connected to the FAKRA + * connectors on the Eagle-V3M (or compatible) board. + * + * The following cameras are currently supported: + * "imi,rdacm20" + * "imi,rdacm21" + */ + +#include + +/* + * Select which cameras are in use: + * #define EAGLE_CAMERA0_RDACM20 + * #define EAGLE_CAMERA0_RDACM21 + * + * The two camera modules are configured with different image formats + * and cannot be mixed. + */ +#define EAGLE_CAMERA0_RDACM20 +#define EAGLE_CAMERA1_RDACM20 +#define EAGLE_CAMERA2_RDACM20 +#define EAGLE_CAMERA3_RDACM20 + +/* Set the compatible string based on the camera model. */ +#if defined(EAGLE_CAMERA0_RDACM21) || defined(EAGLE_CAMERA1_RDACM21) || \ + defined(EAGLE_CAMERA2_RDACM21) || defined(EAGLE_CAMERA3_RDACM21) +#define EAGLE_CAMERA_MODEL "imi,rdacm21" +#define EAGLE_USE_RDACM21 +#elif defined(EAGLE_CAMERA0_RDACM20) || defined(EAGLE_CAMERA1_RDACM20) || \ + defined(EAGLE_CAMERA2_RDACM20) || defined(EAGLE_CAMERA3_RDACM20) +#define EAGLE_CAMERA_MODEL "imi,rdacm20" +#define EAGLE_USE_RDACM20 +#endif + +/* Define which cameras are available. */ +#if defined(EAGLE_CAMERA0_RDACM21) || defined(EAGLE_CAMERA0_RDACM20) +#define EAGLE_USE_CAMERA_0 +#endif + +#if defined(EAGLE_CAMERA1_RDACM21) || defined(EAGLE_CAMERA1_RDACM20) +#define EAGLE_USE_CAMERA_1 +#endif + +#if defined(EAGLE_CAMERA2_RDACM21) || defined(EAGLE_CAMERA2_RDACM20) +#define EAGLE_USE_CAMERA_2 +#endif + +#if defined(EAGLE_CAMERA3_RDACM21) || defined(EAGLE_CAMERA3_RDACM20) +#define EAGLE_USE_CAMERA_3 +#endif + +/* Define the endpoint links. */ +#ifdef EAGLE_USE_CAMERA_0 +&max9286_in0 { + remote-endpoint = <&fakra_con0>; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_1 +&max9286_in1 { + remote-endpoint = <&fakra_con1>; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_2 +&max9286_in2 { + remote-endpoint = <&fakra_con2>; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_3 +&max9286_in3 { + remote-endpoint = <&fakra_con3>; +}; +#endif + +/* Populate the GMSL i2c-mux bus with camera nodes. */ +#if defined(EAGLE_USE_RDACM21) || defined(EAGLE_USE_RDACM20) + +#ifdef EAGLE_USE_CAMERA_0 +&vin0 { + status = "okay"; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_1 +&vin1 { + status = "okay"; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_2 +&vin2 { + status = "okay"; +}; +#endif + +#ifdef EAGLE_USE_CAMERA_3 +&vin3 { + status = "okay"; +}; +#endif + +&gmsl { + + status = "okay"; + maxim,reverse-channel-microvolt = <100000>; + + i2c-mux { +#ifdef EAGLE_USE_CAMERA_0 + i2c@0 { + status = "okay"; + + camera@51 { + compatible = EAGLE_CAMERA_MODEL; + reg = <0x51>, <0x61>; + + port { + fakra_con0: endpoint { + remote-endpoint = <&max9286_in0>; + }; + }; + }; + }; +#endif + +#ifdef EAGLE_USE_CAMERA_1 + i2c@1 { + status = "okay"; + + camera@52 { + compatible = EAGLE_CAMERA_MODEL; + reg = <0x52>, <0x62>; + + port { + fakra_con1: endpoint { + remote-endpoint = <&max9286_in1>; + }; + }; + }; + }; +#endif + +#ifdef EAGLE_USE_CAMERA_2 + i2c@2 { + status = "okay"; + + camera@53 { + compatible = EAGLE_CAMERA_MODEL; + reg = <0x53>, <0x63>; + + port { + fakra_con2: endpoint { + remote-endpoint = <&max9286_in2>; + }; + }; + }; + }; +#endif + +#ifdef EAGLE_USE_CAMERA_3 + i2c@3 { + status = "okay"; + + camera@54 { + compatible = EAGLE_CAMERA_MODEL; + reg = <0x54>, <0x64>; + + port { + fakra_con3: endpoint { + remote-endpoint = <&max9286_in3>; + }; + }; + }; + }; +#endif + }; +}; +#endif From patchwork Mon Mar 15 16:30:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12140001 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17D2FC4332D for ; Mon, 15 Mar 2021 16:31:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 004D564F2A for ; Mon, 15 Mar 2021 16:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232602AbhCOQbA (ORCPT ); Mon, 15 Mar 2021 12:31:00 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:2673 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhCOQa5 (ORCPT ); Mon, 15 Mar 2021 12:30:57 -0400 X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A8F49240007; Mon, 15 Mar 2021 16:30:51 +0000 (UTC) From: Jacopo Mondi To: Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Kieran Bingham , Rob Herring Cc: Jacopo Mondi , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] arm64: dts: renesas: eagle: Include eagle-gmsl Date: Mon, 15 Mar 2021 17:30:28 +0100 Message-Id: <20210315163028.173148-5-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210315163028.173148-1-jacopo+renesas@jmondi.org> References: <20210315163028.173148-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Include the eagle-gmsl.dtsi to enable GMSL camera support on the Eagle-V3M platform. Signed-off-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts index d2f63cccc238..555070aae03d 100644 --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts @@ -404,3 +404,6 @@ &scif0 { status = "okay"; }; + +/* FAKRA Overlay */ +#include "eagle-gmsl.dtsi"