* [PATCH v3 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors @ 2020-11-26 10:30 Lad Prabhakar 2020-11-26 10:30 ` [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes Lad Prabhakar 2020-11-26 10:30 ` [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors Lad Prabhakar 0 siblings, 2 replies; 8+ messages in thread From: Lad Prabhakar @ 2020-11-26 10:30 UTC (permalink / raw) To: Geert Uytterhoeven, Magnus Damm, Rob Herring, linux-renesas-soc, devicetree Cc: linux-kernel, Biju Das, Prabhakar, Lad Prabhakar Hi All, This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven board. This patch is based on top of [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/ renesas-devel.git/log/?h=renesas-arm-dt-for-v5.11 Changes for v3: * Added support to mix and match the cameras connected to VINx interfaces. Changes for v2: * Separated out ov5640 ep into a new dtsi v1: https://patchwork.kernel.org/project/linux-renesas-soc/patch/ 20201120151343.24175-1-prabhakar.mahadev-lad.rj@bp.renesas.com/ Cheers, Prabhakar Lad Prabhakar (2): ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 166 +++++++++--------- .../dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi | 124 +++++++++++++ .../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 112 ++++++++++++ 3 files changed, 322 insertions(+), 80 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi -- 2.17.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes 2020-11-26 10:30 [PATCH v3 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors Lad Prabhakar @ 2020-11-26 10:30 ` Lad Prabhakar 2020-11-26 13:39 ` Geert Uytterhoeven 2020-11-26 10:30 ` [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors Lad Prabhakar 1 sibling, 1 reply; 8+ messages in thread From: Lad Prabhakar @ 2020-11-26 10:30 UTC (permalink / raw) To: Geert Uytterhoeven, Magnus Damm, Rob Herring, linux-renesas-soc, devicetree Cc: linux-kernel, Biju Das, Prabhakar, Lad Prabhakar The camera daughter board can also be connected to 8-bit ov7725 sensors, so in preparation for configurable option to choose depending on the camera's connected separate out ov5640 nodes in a dtsi file. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> --- .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 159 +++++++++--------- .../dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi | 124 ++++++++++++++ 2 files changed, 203 insertions(+), 80 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts index 98c3fbd89fa6..1ab4f9771a34 100644 --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts @@ -9,6 +9,77 @@ /dts-v1/; #include "r8a7742-iwg21d-q7.dts" +#define SENSOR_NONE 1 +#define SENSOR_OV5640 2 + +/* 8bit CMOS Camera 1 (J13) */ +#define CAM1_PARENT_I2C i2c0 +#define MCLK_CAM1 mclk_cam1 +#define VIN0_EP vin0ep + +/* 8bit CMOS Camera 2 (J14) */ +#define CAM2_PARENT_I2C i2c1 +#define MCLK_CAM2 mclk_cam2 +#define VIN1_EP vin1ep + +/* 8bit CMOS Camera 3 (J12) */ +#define CAM3_PARENT_I2C i2c2 +#define MCLK_CAM3 mclk_cam3 +#define VIN2_EP vin2ep + +/* 8bit CMOS Camera 4 (J11) */ +#define CAM4_PARENT_I2C i2c3 +#define MCLK_CAM4 mclk_cam4 +#define VIN3_EP vin3ep + +/* + * Below configuration ties VINx endpoints to ov5640_x endpoints + * + * To disable a VINx set VINx_SENSOR to SENSOR_NONE for example if no + * sensor is connected to VIN2 interface set the below (this disables the + * VIN2 interface and also the ov5640 node connected to it) + * #define VIN2_SENSOR SENSOR_NONE + * + */ +#define VIN0_SENSOR SENSOR_OV5640 +#define VIN1_SENSOR SENSOR_OV5640 +#define VIN2_SENSOR SENSOR_OV5640 +#define VIN3_SENSOR SENSOR_OV5640 + +#include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi" + +#if (VIN0_SENSOR == SENSOR_NONE) +#undef VIN0_REMOTE_EP +#define VIN0_REMOTE_EP 0 +#define VIN0_STATUS "disabled" +#else +#define VIN0_STATUS "okay" +#endif + +#if (VIN1_SENSOR == SENSOR_NONE) +#undef VIN1_REMOTE_EP +#define VIN1_REMOTE_EP 0 +#define VIN1_STATUS "disabled" +#else +#define VIN1_STATUS "okay" +#endif + +#if (VIN2_SENSOR == SENSOR_NONE) +#undef VIN2_REMOTE_EP +#define VIN2_REMOTE_EP 0 +#define VIN2_STATUS "disabled" +#else +#define VIN2_STATUS "okay" +#endif + +#if (VIN3_SENSOR == SENSOR_NONE) +#undef VIN3_REMOTE_EP +#define VIN3_REMOTE_EP 0 +#define VIN3_STATUS "disabled" +#else +#define VIN3_STATUS "okay" +#endif + / { model = "iWave Systems RZ/G1H Qseven development platform with camera add-on"; compatible = "iwave,g21d", "iwave,g21m", "renesas,r8a7742"; @@ -91,67 +162,12 @@ status = "okay"; }; -&i2c0 { - ov5640@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - clocks = <&mclk_cam1>; - clock-names = "xclk"; - - port { - ov5640_0: endpoint { - bus-width = <8>; - data-shift = <2>; - bus-type = <6>; - pclk-sample = <1>; - remote-endpoint = <&vin0ep>; - }; - }; - }; -}; - &i2c1 { pinctrl-0 = <&i2c1_pins>; pinctrl-names = "default"; status = "okay"; clock-frequency = <400000>; - - ov5640@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - clocks = <&mclk_cam2>; - clock-names = "xclk"; - - port { - ov5640_1: endpoint { - bus-width = <8>; - data-shift = <2>; - bus-type = <6>; - pclk-sample = <1>; - remote-endpoint = <&vin1ep>; - }; - }; - }; -}; - -&i2c2 { - ov5640@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - clocks = <&mclk_cam3>; - clock-names = "xclk"; - - port { - ov5640_2: endpoint { - bus-width = <8>; - data-shift = <2>; - bus-type = <6>; - pclk-sample = <1>; - remote-endpoint = <&vin2ep>; - }; - }; - }; }; &i2c3 { @@ -160,23 +176,6 @@ status = "okay"; clock-frequency = <400000>; - - ov5640@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - clocks = <&mclk_cam4>; - clock-names = "xclk"; - - port { - ov5640_3: endpoint { - bus-width = <8>; - data-shift = <2>; - bus-type = <6>; - pclk-sample = <1>; - remote-endpoint = <&vin3ep>; - }; - }; - }; }; &pfc { @@ -272,13 +271,13 @@ * Set SW2 switch on the SOM to 'ON' * Set SW1 switch on camera board to 'OFF' as we are using 8bit mode */ - status = "okay"; + status = VIN0_STATUS; pinctrl-0 = <&vin0_8bit_pins>; pinctrl-names = "default"; port { vin0ep: endpoint { - remote-endpoint = <&ov5640_0>; + remote-endpoint = <VIN0_REMOTE_EP>; bus-width = <8>; bus-type = <6>; }; @@ -287,13 +286,13 @@ &vin1 { /* Set SW1 switch on the SOM to 'ON' */ - status = "okay"; + status = VIN1_STATUS; pinctrl-0 = <&vin1_8bit_pins>; pinctrl-names = "default"; port { vin1ep: endpoint { - remote-endpoint = <&ov5640_1>; + remote-endpoint = <VIN1_REMOTE_EP>; bus-width = <8>; bus-type = <6>; }; @@ -301,13 +300,13 @@ }; &vin2 { - status = "okay"; + status = VIN2_STATUS; pinctrl-0 = <&vin2_pins>; pinctrl-names = "default"; port { vin2ep: endpoint { - remote-endpoint = <&ov5640_2>; + remote-endpoint = <VIN2_REMOTE_EP>; bus-width = <8>; data-shift = <8>; bus-type = <6>; @@ -316,13 +315,13 @@ }; &vin3 { - status = "okay"; + status = VIN3_STATUS; pinctrl-0 = <&vin3_pins>; pinctrl-names = "default"; port { vin3ep: endpoint { - remote-endpoint = <&ov5640_3>; + remote-endpoint = <VIN3_REMOTE_EP>; bus-width = <8>; bus-type = <6>; }; diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi new file mode 100644 index 000000000000..fa2d55f259ec --- /dev/null +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This include file ties VIN interfaces with ov5640 sensors on + * iWave-RZ/G1H Qseven board development platform connected with + * camera daughter board. + * + * Copyright (C) 2020 Renesas Electronics Corp. + */ + +#if (VIN0_SENSOR == SENSOR_OV5640) +#define OV5640_0_STATUS "okay" +#define OV5640_0_REMOTE_EP &VIN0_EP +#define VIN0_REMOTE_EP &ov5640_0 +#else +#define OV5640_0_STATUS "disabled" +#define OV5640_0_REMOTE_EP 0 +#endif + +#if (VIN1_SENSOR == SENSOR_OV5640) +#define OV5640_1_STATUS "okay" +#define OV5640_1_REMOTE_EP &VIN1_EP +#define VIN1_REMOTE_EP &ov5640_1 +#else +#define OV5640_1_STATUS "disabled" +#define OV5640_1_REMOTE_EP 0 +#endif + +#if (VIN2_SENSOR == SENSOR_OV5640) +#define OV5640_2_STATUS "okay" +#define OV5640_2_REMOTE_EP &VIN2_EP +#define VIN2_REMOTE_EP &ov5640_2 +#else +#define OV5640_2_STATUS "disabled" +#define OV5640_2_REMOTE_EP 0 +#endif + +#if (VIN3_SENSOR == SENSOR_OV5640) +#define OV5640_3_STATUS "okay" +#define OV5640_3_REMOTE_EP &VIN3_EP +#define VIN3_REMOTE_EP &ov5640_3 +#else +#define OV5640_3_STATUS "disabled" +#define OV5640_3_REMOTE_EP 0 +#endif + +&CAM1_PARENT_I2C { + ov5640@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&MCLK_CAM1>; + clock-names = "xclk"; + status = OV5640_0_STATUS; + + port { + ov5640_0: endpoint { + bus-width = <8>; + data-shift = <2>; + bus-type = <6>; + pclk-sample = <1>; + remote-endpoint = <OV5640_0_REMOTE_EP>; + }; + }; + }; +}; + +&CAM2_PARENT_I2C { + ov5640@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&MCLK_CAM2>; + clock-names = "xclk"; + status = OV5640_1_STATUS; + + port { + ov5640_1: endpoint { + bus-width = <8>; + data-shift = <2>; + bus-type = <6>; + pclk-sample = <1>; + remote-endpoint = <OV5640_1_REMOTE_EP>; + }; + }; + }; +}; + +&CAM3_PARENT_I2C { + ov5640@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&MCLK_CAM3>; + clock-names = "xclk"; + status = OV5640_2_STATUS; + + port { + ov5640_2: endpoint { + bus-width = <8>; + data-shift = <2>; + bus-type = <6>; + pclk-sample = <1>; + remote-endpoint = <OV5640_2_REMOTE_EP>; + }; + }; + }; +}; + +&CAM4_PARENT_I2C { + ov5640@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + clocks = <&MCLK_CAM4>; + clock-names = "xclk"; + status = OV5640_3_STATUS; + + port { + ov5640_3: endpoint { + bus-width = <8>; + data-shift = <2>; + bus-type = <6>; + pclk-sample = <1>; + remote-endpoint = <OV5640_3_REMOTE_EP>; + }; + }; + }; +}; -- 2.17.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes 2020-11-26 10:30 ` [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes Lad Prabhakar @ 2020-11-26 13:39 ` Geert Uytterhoeven 0 siblings, 0 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2020-11-26 13:39 UTC (permalink / raw) To: Lad Prabhakar Cc: Magnus Damm, Rob Herring, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Linux Kernel Mailing List, Biju Das, Prabhakar Hi Prabhakar, On Thu, Nov 26, 2020 at 11:31 AM Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > The camera daughter board can also be connected to 8-bit ov7725 sensors, > so in preparation for configurable option to choose depending on the > camera's connected separate out ov5640 nodes in a dtsi file. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Thanks for your patch! Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> However, I think this can still be improved upon. As it's a bit difficult to explain, I'll send an updated version of your series with my suggestions applied. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors 2020-11-26 10:30 [PATCH v3 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors Lad Prabhakar 2020-11-26 10:30 ` [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes Lad Prabhakar @ 2020-11-26 10:30 ` Lad Prabhakar 2020-11-26 13:39 ` Geert Uytterhoeven 2020-12-15 11:49 ` Jacopo Mondi 1 sibling, 2 replies; 8+ messages in thread From: Lad Prabhakar @ 2020-11-26 10:30 UTC (permalink / raw) To: Geert Uytterhoeven, Magnus Damm, Rob Herring, linux-renesas-soc, devicetree Cc: linux-kernel, Biju Das, Prabhakar, Lad Prabhakar The 8-bit ov7725 sensors can also be connected to the camera daughter board. This patch creates a separate dtsi file for ov7725 sensors and is included in r8a7742-iwg21d-q7-dbcm-ca.dts. The user can set VINx_SENSOR depending on the cameras connected. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> --- .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 7 ++ .../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 112 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts index 1ab4f9771a34..915ff5fd437c 100644 --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts @@ -11,6 +11,7 @@ #define SENSOR_NONE 1 #define SENSOR_OV5640 2 +#define SENSOR_OV7725 3 /* 8bit CMOS Camera 1 (J13) */ #define CAM1_PARENT_I2C i2c0 @@ -40,6 +41,11 @@ * VIN2 interface and also the ov5640 node connected to it) * #define VIN2_SENSOR SENSOR_NONE * + * To tie VINx endpoints to ov7725_x endpoints set VINx_SENSOR to + * SENSOR_OV7725 for example if ov7725_3 is connected to the VIN3 + * interface set the below (this disables the ov5640_3) + * #define VIN3_SENSOR SENSOR_OV7725 + * */ #define VIN0_SENSOR SENSOR_OV5640 #define VIN1_SENSOR SENSOR_OV5640 @@ -47,6 +53,7 @@ #define VIN3_SENSOR SENSOR_OV5640 #include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi" +#include "r8a7742-iwg21d-q7-dbcm-ov7725.dtsi" #if (VIN0_SENSOR == SENSOR_NONE) #undef VIN0_REMOTE_EP diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi new file mode 100644 index 000000000000..054d0a7cc5ce --- /dev/null +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This include file ties VIN interfaces with ov7725 sensors on + * iWave-RZ/G1H Qseven board development platform connected with + * camera daughter board. + * + * Copyright (C) 2020 Renesas Electronics Corp. + */ + +#if (VIN0_SENSOR == SENSOR_OV7725) +#define OV7725_0_STATUS "okay" +#define OV7725_0_REMOTE_EP &VIN0_EP +#define VIN0_REMOTE_EP &ov7725_0 +#else +#define OV7725_0_STATUS "disabled" +#define OV7725_0_REMOTE_EP 0 +#endif + +#if (VIN1_SENSOR == SENSOR_OV7725) +#define OV7725_1_STATUS "okay" +#define OV7725_1_REMOTE_EP &VIN1_EP +#define VIN1_REMOTE_EP &ov7725_1 +#else +#define OV7725_1_STATUS "disabled" +#define OV7725_1_REMOTE_EP 0 +#endif + +#if (VIN2_SENSOR == SENSOR_OV7725) +#define OV7725_2_STATUS "okay" +#define OV7725_2_REMOTE_EP &VIN2_EP +#define VIN2_REMOTE_EP &ov7725_2 +#else +#define OV7725_2_STATUS "disabled" +#define OV7725_2_REMOTE_EP 0 +#endif + +#if (VIN3_SENSOR == SENSOR_OV7725) +#define OV7725_3_STATUS "okay" +#define OV7725_3_REMOTE_EP &VIN3_EP +#define VIN3_REMOTE_EP &ov7725_3 +#else +#define OV7725_3_STATUS "disabled" +#define OV7725_3_REMOTE_EP 0 +#endif + +&CAM1_PARENT_I2C { + ov7725@21 { + compatible = "ovti,ov7725"; + reg = <0x21>; + clocks = <&MCLK_CAM1>; + status = OV7725_0_STATUS; + + port { + ov7725_0: endpoint { + bus-width = <8>; + bus-type = <6>; + remote-endpoint = <OV7725_0_REMOTE_EP>; + }; + }; + }; +}; + +&CAM2_PARENT_I2C { + ov7725@21 { + compatible = "ovti,ov7725"; + reg = <0x21>; + clocks = <&MCLK_CAM2>; + status = OV7725_1_STATUS; + + port { + ov7725_1: endpoint { + bus-width = <8>; + bus-type = <6>; + remote-endpoint = <OV7725_1_REMOTE_EP>; + }; + }; + }; +}; + +&CAM3_PARENT_I2C { + ov7725@21 { + compatible = "ovti,ov7725"; + reg = <0x21>; + clocks = <&MCLK_CAM3>; + status = OV7725_2_STATUS; + + port { + ov7725_2: endpoint { + bus-width = <8>; + bus-type = <6>; + remote-endpoint = <OV7725_2_REMOTE_EP>; + }; + }; + }; +}; + +&CAM4_PARENT_I2C { + ov7725@21 { + compatible = "ovti,ov7725"; + reg = <0x21>; + clocks = <&MCLK_CAM4>; + status = OV7725_3_STATUS; + + port { + ov7725_3: endpoint { + bus-width = <8>; + bus-type = <6>; + remote-endpoint = <OV7725_3_REMOTE_EP>; + }; + }; + }; +}; -- 2.17.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors 2020-11-26 10:30 ` [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors Lad Prabhakar @ 2020-11-26 13:39 ` Geert Uytterhoeven 2020-12-15 11:49 ` Jacopo Mondi 1 sibling, 0 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2020-11-26 13:39 UTC (permalink / raw) To: Lad Prabhakar Cc: Magnus Damm, Rob Herring, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Linux Kernel Mailing List, Biju Das, Prabhakar Hi Prabhakar, On Thu, Nov 26, 2020 at 11:31 AM Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > The 8-bit ov7725 sensors can also be connected to the camera daughter > board. > > This patch creates a separate dtsi file for ov7725 sensors and is included > in r8a7742-iwg21d-q7-dbcm-ca.dts. The user can set VINx_SENSOR depending > on the cameras connected. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Thanks for your patch! Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> However, I think this can still be improved upon. As it's a bit difficult to explain, I'll send an updated version of your series with my suggestions applied. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors 2020-11-26 10:30 ` [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors Lad Prabhakar 2020-11-26 13:39 ` Geert Uytterhoeven @ 2020-12-15 11:49 ` Jacopo Mondi 2020-12-15 15:57 ` Lad, Prabhakar 1 sibling, 1 reply; 8+ messages in thread From: Jacopo Mondi @ 2020-12-15 11:49 UTC (permalink / raw) To: Lad Prabhakar Cc: Geert Uytterhoeven, Magnus Damm, Rob Herring, linux-renesas-soc, devicetree, linux-kernel, Biju Das, Prabhakar Hello, On Thu, Nov 26, 2020 at 10:30:53AM +0000, Lad Prabhakar wrote: > The 8-bit ov7725 sensors can also be connected to the camera daughter > board. > > This patch creates a separate dtsi file for ov7725 sensors and is included > in r8a7742-iwg21d-q7-dbcm-ca.dts. The user can set VINx_SENSOR depending > on the cameras connected. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> > --- > .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 7 ++ > .../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 112 ++++++++++++++++++ > 2 files changed, 119 insertions(+) > create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > index 1ab4f9771a34..915ff5fd437c 100644 > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > @@ -11,6 +11,7 @@ > > #define SENSOR_NONE 1 > #define SENSOR_OV5640 2 > +#define SENSOR_OV7725 3 > > /* 8bit CMOS Camera 1 (J13) */ > #define CAM1_PARENT_I2C i2c0 > @@ -40,6 +41,11 @@ > * VIN2 interface and also the ov5640 node connected to it) > * #define VIN2_SENSOR SENSOR_NONE > * > + * To tie VINx endpoints to ov7725_x endpoints set VINx_SENSOR to > + * SENSOR_OV7725 for example if ov7725_3 is connected to the VIN3 > + * interface set the below (this disables the ov5640_3) > + * #define VIN3_SENSOR SENSOR_OV7725 > + * > */ > #define VIN0_SENSOR SENSOR_OV5640 > #define VIN1_SENSOR SENSOR_OV5640 > @@ -47,6 +53,7 @@ > #define VIN3_SENSOR SENSOR_OV5640 > > #include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi" > +#include "r8a7742-iwg21d-q7-dbcm-ov7725.dtsi" Mmm, can't we alternatively include one .dtsi or the other depending on a define symbol ? The .dtsi describe pluggable expansion boards, they cannot be mixed, right ? Thanks j > > #if (VIN0_SENSOR == SENSOR_NONE) > #undef VIN0_REMOTE_EP > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi > new file mode 100644 > index 000000000000..054d0a7cc5ce > --- /dev/null > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi > @@ -0,0 +1,112 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * This include file ties VIN interfaces with ov7725 sensors on > + * iWave-RZ/G1H Qseven board development platform connected with > + * camera daughter board. > + * > + * Copyright (C) 2020 Renesas Electronics Corp. > + */ > + > +#if (VIN0_SENSOR == SENSOR_OV7725) > +#define OV7725_0_STATUS "okay" > +#define OV7725_0_REMOTE_EP &VIN0_EP > +#define VIN0_REMOTE_EP &ov7725_0 > +#else > +#define OV7725_0_STATUS "disabled" > +#define OV7725_0_REMOTE_EP 0 > +#endif > + > +#if (VIN1_SENSOR == SENSOR_OV7725) > +#define OV7725_1_STATUS "okay" > +#define OV7725_1_REMOTE_EP &VIN1_EP > +#define VIN1_REMOTE_EP &ov7725_1 > +#else > +#define OV7725_1_STATUS "disabled" > +#define OV7725_1_REMOTE_EP 0 > +#endif > + > +#if (VIN2_SENSOR == SENSOR_OV7725) > +#define OV7725_2_STATUS "okay" > +#define OV7725_2_REMOTE_EP &VIN2_EP > +#define VIN2_REMOTE_EP &ov7725_2 > +#else > +#define OV7725_2_STATUS "disabled" > +#define OV7725_2_REMOTE_EP 0 > +#endif > + > +#if (VIN3_SENSOR == SENSOR_OV7725) > +#define OV7725_3_STATUS "okay" > +#define OV7725_3_REMOTE_EP &VIN3_EP > +#define VIN3_REMOTE_EP &ov7725_3 > +#else > +#define OV7725_3_STATUS "disabled" > +#define OV7725_3_REMOTE_EP 0 > +#endif > + > +&CAM1_PARENT_I2C { > + ov7725@21 { > + compatible = "ovti,ov7725"; > + reg = <0x21>; > + clocks = <&MCLK_CAM1>; > + status = OV7725_0_STATUS; > + > + port { > + ov7725_0: endpoint { > + bus-width = <8>; > + bus-type = <6>; > + remote-endpoint = <OV7725_0_REMOTE_EP>; > + }; > + }; > + }; > +}; > + > +&CAM2_PARENT_I2C { > + ov7725@21 { > + compatible = "ovti,ov7725"; > + reg = <0x21>; > + clocks = <&MCLK_CAM2>; > + status = OV7725_1_STATUS; > + > + port { > + ov7725_1: endpoint { > + bus-width = <8>; > + bus-type = <6>; > + remote-endpoint = <OV7725_1_REMOTE_EP>; > + }; > + }; > + }; > +}; > + > +&CAM3_PARENT_I2C { > + ov7725@21 { > + compatible = "ovti,ov7725"; > + reg = <0x21>; > + clocks = <&MCLK_CAM3>; > + status = OV7725_2_STATUS; > + > + port { > + ov7725_2: endpoint { > + bus-width = <8>; > + bus-type = <6>; > + remote-endpoint = <OV7725_2_REMOTE_EP>; > + }; > + }; > + }; > +}; > + > +&CAM4_PARENT_I2C { > + ov7725@21 { > + compatible = "ovti,ov7725"; > + reg = <0x21>; > + clocks = <&MCLK_CAM4>; > + status = OV7725_3_STATUS; > + > + port { > + ov7725_3: endpoint { > + bus-width = <8>; > + bus-type = <6>; > + remote-endpoint = <OV7725_3_REMOTE_EP>; > + }; > + }; > + }; > +}; > -- > 2.17.1 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors 2020-12-15 11:49 ` Jacopo Mondi @ 2020-12-15 15:57 ` Lad, Prabhakar 2020-12-15 16:27 ` Jacopo Mondi 0 siblings, 1 reply; 8+ messages in thread From: Lad, Prabhakar @ 2020-12-15 15:57 UTC (permalink / raw) To: Jacopo Mondi Cc: Lad Prabhakar, Geert Uytterhoeven, Magnus Damm, Rob Herring, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML, Biju Das Hi Jacopo, Thank you for the review. On Tue, Dec 15, 2020 at 11:49 AM Jacopo Mondi <jacopo@jmondi.org> wrote: > > Hello, > > On Thu, Nov 26, 2020 at 10:30:53AM +0000, Lad Prabhakar wrote: > > The 8-bit ov7725 sensors can also be connected to the camera daughter > > board. > > > > This patch creates a separate dtsi file for ov7725 sensors and is included > > in r8a7742-iwg21d-q7-dbcm-ca.dts. The user can set VINx_SENSOR depending > > on the cameras connected. > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> > > --- > > .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 7 ++ > > .../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 112 ++++++++++++++++++ > > 2 files changed, 119 insertions(+) > > create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > index 1ab4f9771a34..915ff5fd437c 100644 > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > @@ -11,6 +11,7 @@ > > > > #define SENSOR_NONE 1 > > #define SENSOR_OV5640 2 > > +#define SENSOR_OV7725 3 > > > > /* 8bit CMOS Camera 1 (J13) */ > > #define CAM1_PARENT_I2C i2c0 > > @@ -40,6 +41,11 @@ > > * VIN2 interface and also the ov5640 node connected to it) > > * #define VIN2_SENSOR SENSOR_NONE > > * > > + * To tie VINx endpoints to ov7725_x endpoints set VINx_SENSOR to > > + * SENSOR_OV7725 for example if ov7725_3 is connected to the VIN3 > > + * interface set the below (this disables the ov5640_3) > > + * #define VIN3_SENSOR SENSOR_OV7725 > > + * > > */ > > #define VIN0_SENSOR SENSOR_OV5640 > > #define VIN1_SENSOR SENSOR_OV5640 > > @@ -47,6 +53,7 @@ > > #define VIN3_SENSOR SENSOR_OV5640 > > > > #include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi" > > +#include "r8a7742-iwg21d-q7-dbcm-ov7725.dtsi" > > Mmm, can't we alternatively include one .dtsi or the other depending > on a define symbol ? The .dtsi describe pluggable expansion boards, > they cannot be mixed, right ? > Since the cameras on the daughter can be mixed and matched a much better version of the patches [1] which handle this case elegantly has been posted by Geert. [1] https://patchwork.kernel.org/project/linux-renesas-soc/cover/20201126134031.4115211-1-geert@linux-m68k.org/ Cheers, Prabhakar ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors 2020-12-15 15:57 ` Lad, Prabhakar @ 2020-12-15 16:27 ` Jacopo Mondi 0 siblings, 0 replies; 8+ messages in thread From: Jacopo Mondi @ 2020-12-15 16:27 UTC (permalink / raw) To: Lad, Prabhakar Cc: Lad Prabhakar, Geert Uytterhoeven, Magnus Damm, Rob Herring, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML, Biju Das Hi Prabhakar, On Tue, Dec 15, 2020 at 03:57:32PM +0000, Lad, Prabhakar wrote: > Hi Jacopo, > > Thank you for the review. > > On Tue, Dec 15, 2020 at 11:49 AM Jacopo Mondi <jacopo@jmondi.org> wrote: > > > > Hello, > > > > On Thu, Nov 26, 2020 at 10:30:53AM +0000, Lad Prabhakar wrote: > > > The 8-bit ov7725 sensors can also be connected to the camera daughter > > > board. > > > > > > This patch creates a separate dtsi file for ov7725 sensors and is included > > > in r8a7742-iwg21d-q7-dbcm-ca.dts. The user can set VINx_SENSOR depending > > > on the cameras connected. > > > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> > > > --- > > > .../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 7 ++ > > > .../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 112 ++++++++++++++++++ > > > 2 files changed, 119 insertions(+) > > > create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi > > > > > > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > > index 1ab4f9771a34..915ff5fd437c 100644 > > > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts > > > @@ -11,6 +11,7 @@ > > > > > > #define SENSOR_NONE 1 > > > #define SENSOR_OV5640 2 > > > +#define SENSOR_OV7725 3 > > > > > > /* 8bit CMOS Camera 1 (J13) */ > > > #define CAM1_PARENT_I2C i2c0 > > > @@ -40,6 +41,11 @@ > > > * VIN2 interface and also the ov5640 node connected to it) > > > * #define VIN2_SENSOR SENSOR_NONE > > > * > > > + * To tie VINx endpoints to ov7725_x endpoints set VINx_SENSOR to > > > + * SENSOR_OV7725 for example if ov7725_3 is connected to the VIN3 > > > + * interface set the below (this disables the ov5640_3) > > > + * #define VIN3_SENSOR SENSOR_OV7725 > > > + * > > > */ > > > #define VIN0_SENSOR SENSOR_OV5640 > > > #define VIN1_SENSOR SENSOR_OV5640 > > > @@ -47,6 +53,7 @@ > > > #define VIN3_SENSOR SENSOR_OV5640 > > > > > > #include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi" > > > +#include "r8a7742-iwg21d-q7-dbcm-ov7725.dtsi" > > > > Mmm, can't we alternatively include one .dtsi or the other depending > > on a define symbol ? The .dtsi describe pluggable expansion boards, > > they cannot be mixed, right ? > > > Since the cameras on the daughter can be mixed and matched a much > better version of the patches [1] which handle this case elegantly has > been posted by Geert. > > [1] https://patchwork.kernel.org/project/linux-renesas-soc/cover/20201126134031.4115211-1-geert@linux-m68k.org/ Oh, I see the discussion know, sorry for the noise. > > Cheers, > Prabhakar ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-12-15 16:28 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-11-26 10:30 [PATCH v3 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors Lad Prabhakar 2020-11-26 10:30 ` [PATCH v3 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes Lad Prabhakar 2020-11-26 13:39 ` Geert Uytterhoeven 2020-11-26 10:30 ` [PATCH v3 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors Lad Prabhakar 2020-11-26 13:39 ` Geert Uytterhoeven 2020-12-15 11:49 ` Jacopo Mondi 2020-12-15 15:57 ` Lad, Prabhakar 2020-12-15 16:27 ` Jacopo Mondi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).