dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] dt-bindings: Add macros for video interface bus types
@ 2022-03-06 17:39 Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 1/3] dt-bindings: media: " Laurent Pinchart
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Laurent Pinchart @ 2022-03-06 17:39 UTC (permalink / raw)
  To: devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Alexandre Torgue,
	Shawn Guo, Lad Prabhakar, Rob Herring, Sakari Ailus,
	Eugen Hristev, linux-arm-kernel

Hello,

This small patch series is the result of me getting a bus-type numerical
value wrong in a device tree file and spending too long debugging the
issue. Hopefully there's nothing controversial here.

Compared to v1, the PARALLEL bus type has been renamed to BT601, and
patch 3/3 now converts existing DT sources. See individual patches for a
detailed changelog.

I can split patch 3/3 per architecture or per board if desired, but
given that this is a mechanical change, and the patch is fairly small,
I'd rather keep it as-is and merge it as part of the series.

When writing 3/3 I noticed that the anx7625 bindings and the
corresponding driver badly misuse the bus type (mapping CCP2 to mean
MIPI DPI, and PARALLEL - now BT601 - to mean MIPI DSI). This misuse
hasn't reached a released mainline kernel as it got merged in v5.17-rc1,
so there may still be a chance to fix it. Let's discuss this in [1],
I'll update this series and rebase it on v5.18-rc1 once released based
on the outcome of the discussion.

[1] https://lore.kernel.org/all/YiTruiCIkyxs3jTC@pendragon.ideasonboard.com/

Laurent Pinchart (3):
  dt-bindings: media: Add macros for video interface bus types
  dt-bindings: Use new video interface bus type macros in examples
  ARM: dts: Use new media bus type macros

 .../display/bridge/analogix,anx7625.yaml         |  3 ++-
 .../devicetree/bindings/media/i2c/mipi-ccs.yaml  |  3 ++-
 .../bindings/media/i2c/ovti,ov772x.yaml          |  3 ++-
 .../bindings/media/marvell,mmp2-ccic.yaml        |  3 ++-
 .../bindings/media/microchip,xisc.yaml           |  3 ++-
 .../devicetree/bindings/media/st,stm32-dcmi.yaml |  4 +++-
 arch/arm/boot/dts/imx6ul-14x14-evk.dtsi          |  4 +++-
 arch/arm/boot/dts/omap3-n900.dts                 |  5 +++--
 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts  | 11 +++++++----
 .../r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi    |  4 +++-
 .../r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi    |  4 +++-
 arch/arm/boot/dts/stm32429i-eval.dts             |  3 ++-
 arch/arm/boot/dts/stm32mp157c-ev1.dts            |  3 ++-
 include/dt-bindings/media/video-interfaces.h     | 16 ++++++++++++++++
 14 files changed, 52 insertions(+), 17 deletions(-)
 create mode 100644 include/dt-bindings/media/video-interfaces.h

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/3] dt-bindings: media: Add macros for video interface bus types
  2022-03-06 17:39 [PATCH v2 0/3] dt-bindings: Add macros for video interface bus types Laurent Pinchart
@ 2022-03-06 17:39 ` Laurent Pinchart
  2022-03-06 18:04   ` Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 2/3] dt-bindings: Use new video interface bus type macros in examples Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 3/3] ARM: dts: Use new media bus type macros Laurent Pinchart
  2 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2022-03-06 17:39 UTC (permalink / raw)
  To: devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Alexandre Torgue,
	Shawn Guo, Lad Prabhakar, Rob Herring, Sakari Ailus,
	Eugen Hristev, linux-arm-kernel

Add a new dt-bindings/media/video-interfaces.h header that defines
macros corresponding to the bus types from media/video-interfaces.yaml.
This allows avoiding hardcoded constants in device tree sources.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Dual-license under GPL-2.0-only or MIT
- Rename PARALLEL TO BT601
---
 include/dt-bindings/media/video-interfaces.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 include/dt-bindings/media/video-interfaces.h

diff --git a/include/dt-bindings/media/video-interfaces.h b/include/dt-bindings/media/video-interfaces.h
new file mode 100644
index 000000000000..4c3810edff4c
--- /dev/null
+++ b/include/dt-bindings/media/video-interfaces.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2022 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+ */
+
+#ifndef __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__
+#define __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__
+
+#define MEDIA_BUS_TYPE_CSI2_CPHY		1
+#define MEDIA_BUS_TYPE_CSI1			2
+#define MEDIA_BUS_TYPE_CCP2			3
+#define MEDIA_BUS_TYPE_CSI2_DPHY		4
+#define MEDIA_BUS_TYPE_BT601			5
+#define MEDIA_BUS_TYPE_BT656			6
+
+#endif /* __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ */
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/3] dt-bindings: Use new video interface bus type macros in examples
  2022-03-06 17:39 [PATCH v2 0/3] dt-bindings: Add macros for video interface bus types Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 1/3] dt-bindings: media: " Laurent Pinchart
@ 2022-03-06 17:39 ` Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 3/3] ARM: dts: Use new media bus type macros Laurent Pinchart
  2 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2022-03-06 17:39 UTC (permalink / raw)
  To: devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Alexandre Torgue,
	Shawn Guo, Lad Prabhakar, Rob Herring, Sakari Ailus,
	Eugen Hristev, linux-arm-kernel

Now that a header exists with macros for the media interface bus-type
values, replace hardcoding numerical constants with the corresponding
macros in the DT binding examples.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Rename PARALLEL to BT601
---
 .../devicetree/bindings/display/bridge/analogix,anx7625.yaml  | 3 ++-
 Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml     | 3 ++-
 Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml  | 3 ++-
 .../devicetree/bindings/media/marvell,mmp2-ccic.yaml          | 3 ++-
 Documentation/devicetree/bindings/media/microchip,xisc.yaml   | 3 ++-
 Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml    | 4 +++-
 6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml
index 1d3e88daca04..179a754b0fc4 100644
--- a/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml
@@ -130,6 +130,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
 
     i2c0 {
         #address-cells = <1>;
@@ -155,7 +156,7 @@ examples:
                     reg = <0>;
                     anx7625_in: endpoint {
                         remote-endpoint = <&mipi_dsi>;
-                        bus-type = <5>;
+                        bus-type = <MEDIA_BUS_TYPE_BT601>;
                         data-lanes = <0 1 2 3>;
                     };
                 };
diff --git a/Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml b/Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml
index 39395ea8c318..edde4201116f 100644
--- a/Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml
@@ -104,6 +104,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
 
     i2c2 {
         #address-cells = <1>;
@@ -124,7 +125,7 @@ examples:
                     remote-endpoint = <&csi2a_ep>;
                     link-frequencies = /bits/ 64 <199200000 210000000
                                                   499200000>;
-                    bus-type = <4>;
+                    bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
                 };
             };
         };
diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
index 44529425ce3a..c8bdda99ecb7 100644
--- a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
@@ -105,6 +105,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
 
     i2c0 {
         #address-cells = <1>;
@@ -118,7 +119,7 @@ examples:
 
             port {
                 ov772x_0: endpoint {
-                    bus-type = <5>;
+                    bus-type = <MEDIA_BUS_TYPE_BT601>;
                     vsync-active = <0>;
                     hsync-active = <0>;
                     pclk-sample = <0>;
diff --git a/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml b/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
index b39b84c5f012..c27b0198ac38 100644
--- a/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
+++ b/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
@@ -68,6 +68,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/marvell,mmp2.h>
+    #include <dt-bindings/media/video-interfaces.h>
     #include <dt-bindings/power/marvell,mmp2.h>
 
     camera@d420a000 {
@@ -83,7 +84,7 @@ examples:
       port {
         camera0_0: endpoint {
           remote-endpoint = <&ov7670_0>;
-          bus-type = <5>;      /* Parallel */
+          bus-type = <MEDIA_BUS_TYPE_BT601>;
           hsync-active = <1>;  /* Active high */
           vsync-active = <1>;  /* Active high */
           pclk-sample = <0>;   /* Falling */
diff --git a/Documentation/devicetree/bindings/media/microchip,xisc.yaml b/Documentation/devicetree/bindings/media/microchip,xisc.yaml
index 086e1430af4f..5eeb67dd0039 100644
--- a/Documentation/devicetree/bindings/media/microchip,xisc.yaml
+++ b/Documentation/devicetree/bindings/media/microchip,xisc.yaml
@@ -106,6 +106,7 @@ examples:
     #include <dt-bindings/interrupt-controller/arm-gic.h>
     #include <dt-bindings/clock/at91.h>
     #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/media/video-interfaces.h>
 
     xisc: xisc@e1408000 {
         compatible = "microchip,sama7g5-isc";
@@ -118,7 +119,7 @@ examples:
 
         port {
                 xisc_in: endpoint {
-                       bus-type = <5>; /* Parallel */
+                       bus-type = <MEDIA_BUS_TYPE_BT601>;
                        remote-endpoint = <&csi2dc_out>;
                        hsync-active = <1>;
                        vsync-active = <1>;
diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
index 9c1262a276b5..2f08abf6059d 100644
--- a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
+++ b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
@@ -90,7 +90,9 @@ examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
     #include <dt-bindings/clock/stm32mp1-clks.h>
+    #include <dt-bindings/media/video-interfaces.h>
     #include <dt-bindings/reset/stm32mp1-resets.h>
+    #
     dcmi: dcmi@4c006000 {
         compatible = "st,stm32-dcmi";
         reg = <0x4c006000 0x400>;
@@ -104,7 +106,7 @@ examples:
         port {
              dcmi_0: endpoint {
                    remote-endpoint = <&ov5640_0>;
-                   bus-type = <5>;
+                   bus-type = <MEDIA_BUS_TYPE_BT601>;
                    bus-width = <8>;
                    hsync-active = <0>;
                    vsync-active = <0>;
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/3] ARM: dts: Use new media bus type macros
  2022-03-06 17:39 [PATCH v2 0/3] dt-bindings: Add macros for video interface bus types Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 1/3] dt-bindings: media: " Laurent Pinchart
  2022-03-06 17:39 ` [PATCH v2 2/3] dt-bindings: Use new video interface bus type macros in examples Laurent Pinchart
@ 2022-03-06 17:39 ` Laurent Pinchart
  2022-04-07 12:41   ` Alexandre TORGUE
  2 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2022-03-06 17:39 UTC (permalink / raw)
  To: devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Alexandre Torgue,
	Shawn Guo, Lad Prabhakar, Rob Herring, Sakari Ailus,
	Eugen Hristev, linux-arm-kernel

Now that a header exists with macros for the media interface bus-type
values, replace hardcoding numerical constants with the corresponding
macros in the DT sources.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/boot/dts/imx6ul-14x14-evk.dtsi               |  4 +++-
 arch/arm/boot/dts/omap3-n900.dts                      |  5 +++--
 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
 .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
 .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
 arch/arm/boot/dts/stm32429i-eval.dts                  |  3 ++-
 arch/arm/boot/dts/stm32mp157c-ev1.dts                 |  3 ++-
 7 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
index a3fde3316c73..89234bbd02f4 100644
--- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
+++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
@@ -2,6 +2,8 @@
 //
 // Copyright (C) 2015 Freescale Semiconductor, Inc.
 
+#include <dt-bindings/media/video-interfaces.h>
+
 / {
 	chosen {
 		stdout-path = &uart1;
@@ -170,7 +172,7 @@ &csi {
 	port {
 		parallel_from_ov5640: endpoint {
 			remote-endpoint = <&ov5640_to_parallel>;
-			bus-type = <5>; /* Parallel bus */
+			bus-type = <MEDIA_BUS_TYPE_BT601>;
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index d40c3d2c4914..9cad9d6a83e2 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -9,6 +9,7 @@
 #include "omap34xx.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/media/video-interfaces.h>
 
 /*
  * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
@@ -194,7 +195,7 @@ port@1 {
 
 			csi_isp: endpoint {
 				remote-endpoint = <&csi_cam1>;
-				bus-type = <3>; /* CCP2 */
+				bus-type = <MEDIA_BUS_TYPE_CCP2>;
 				clock-lanes = <1>;
 				data-lanes = <0>;
 				lane-polarity = <0 0>;
@@ -835,7 +836,7 @@ cam1: camera@3e {
 
 		port {
 			csi_cam1: endpoint {
-				bus-type = <3>; /* CCP2 */
+				bus-type = <MEDIA_BUS_TYPE_CCP2>;
 				strobe = <1>;
 				clock-inv = <0>;
 				crc = <1>;
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 3c8a7c8b1fdd..1043603fc4a5 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
@@ -7,6 +7,9 @@
  */
 
 /dts-v1/;
+
+#include <dt-bindings/media/video-interfaces.h>
+
 #include "r8a7742-iwg21d-q7.dts"
 
 / {
@@ -242,7 +245,7 @@ port {
 		vin0ep: endpoint {
 			remote-endpoint = <&cam0ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -273,7 +276,7 @@ port {
 		vin1ep: endpoint {
 			remote-endpoint = <&cam1ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -305,7 +308,7 @@ vin2ep: endpoint {
 			remote-endpoint = <&cam2ep>;
 			bus-width = <8>;
 			data-shift = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
@@ -335,7 +338,7 @@ port {
 		vin3ep: endpoint {
 			remote-endpoint = <&cam3ep>;
 			bus-width = <8>;
-			bus-type = <6>;
+			bus-type = <MEDIA_BUS_TYPE_BT656>;
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
index 40cef0b1d1e6..c73160df619d 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
@@ -7,6 +7,8 @@
  * Copyright (C) 2020 Renesas Electronics Corp.
  */
 
+#include <dt-bindings/media/video-interfaces.h>
+
 #define CAM_ENABLED	1
 
 &CAM_PARENT_I2C {
@@ -26,7 +28,7 @@ port {
 			CAM_EP: endpoint {
 				bus-width = <8>;
 				data-shift = <2>;
-				bus-type = <6>;
+				bus-type = <MEDIA_BUS_TYPE_BT656>;
 				pclk-sample = <1>;
 				remote-endpoint = <&VIN_EP>;
 			};
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
index f5e77f024251..a7f5cfec64b8 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
@@ -7,6 +7,8 @@
  * Copyright (C) 2020 Renesas Electronics Corp.
  */
 
+#include <dt-bindings/media/video-interfaces.h>
+
 #define CAM_ENABLED	1
 
 &CAM_PARENT_I2C {
@@ -21,7 +23,7 @@ ov7725@21 {
 		port {
 			CAM_EP: endpoint {
 				bus-width = <8>;
-				bus-type = <6>;
+				bus-type = <MEDIA_BUS_TYPE_BT656>;
 				remote-endpoint = <&VIN_EP>;
 			};
 		};
diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
index cb46326a8c75..ecb10613d962 100644
--- a/arch/arm/boot/dts/stm32429i-eval.dts
+++ b/arch/arm/boot/dts/stm32429i-eval.dts
@@ -50,6 +50,7 @@
 #include "stm32f429-pinctrl.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/media/video-interfaces.h>
 
 / {
 	model = "STMicroelectronics STM32429i-EVAL board";
@@ -186,7 +187,7 @@ &dcmi {
 	port {
 		dcmi_0: endpoint {
 			remote-endpoint = <&ov2640_0>;
-			bus-type = <5>;
+			bus-type = <MEDIA_BUS_TYPE_BT601>;
 			bus-width = <8>;
 			hsync-active = <0>;
 			vsync-active = <0>;
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index e222d2d2cb44..24f59f3b15dc 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -8,6 +8,7 @@
 #include "stm32mp157c-ed1.dts"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/media/video-interfaces.h>
 
 / {
 	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
@@ -90,7 +91,7 @@ &dcmi {
 	port {
 		dcmi_0: endpoint {
 			remote-endpoint = <&ov5640_0>;
-			bus-type = <5>;
+			bus-type = <MEDIA_BUS_TYPE_BT601>;
 			bus-width = <8>;
 			hsync-active = <0>;
 			vsync-active = <0>;
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: media: Add macros for video interface bus types
  2022-03-06 17:39 ` [PATCH v2 1/3] dt-bindings: media: " Laurent Pinchart
@ 2022-03-06 18:04   ` Laurent Pinchart
  2022-03-08 23:18     ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2022-03-06 18:04 UTC (permalink / raw)
  To: devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Alexandre Torgue,
	Shawn Guo, Lad Prabhakar, Rob Herring, Sakari Ailus,
	Eugen Hristev, linux-arm-kernel

On Sun, Mar 06, 2022 at 07:39:03PM +0200, Laurent Pinchart wrote:
> Add a new dt-bindings/media/video-interfaces.h header that defines
> macros corresponding to the bus types from media/video-interfaces.yaml.
> This allows avoiding hardcoded constants in device tree sources.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> Changes since v1:
> 
> - Dual-license under GPL-2.0-only or MIT
> - Rename PARALLEL TO BT601

Contrary to popular belief, further investigation revealed that BT.601
doesn't define VSYNC and HSYNC (or HREF, as it is also commonly called)
signals. MEDIA_BUS_TYPE_BT601 is thus likely not a good name. I haven't
been able to find a standard for parallel camera interfaces that would
be a good match here. On the display side there's MIPI DPI, but on the
camera side it seems things have evolved quite organically. I may have
missed something though.

> ---
>  include/dt-bindings/media/video-interfaces.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>  create mode 100644 include/dt-bindings/media/video-interfaces.h
> 
> diff --git a/include/dt-bindings/media/video-interfaces.h b/include/dt-bindings/media/video-interfaces.h
> new file mode 100644
> index 000000000000..4c3810edff4c
> --- /dev/null
> +++ b/include/dt-bindings/media/video-interfaces.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> +/*
> + * Copyright (C) 2022 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + */
> +
> +#ifndef __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__
> +#define __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__
> +
> +#define MEDIA_BUS_TYPE_CSI2_CPHY		1
> +#define MEDIA_BUS_TYPE_CSI1			2
> +#define MEDIA_BUS_TYPE_CCP2			3
> +#define MEDIA_BUS_TYPE_CSI2_DPHY		4
> +#define MEDIA_BUS_TYPE_BT601			5
> +#define MEDIA_BUS_TYPE_BT656			6
> +
> +#endif /* __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ */

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: media: Add macros for video interface bus types
  2022-03-06 18:04   ` Laurent Pinchart
@ 2022-03-08 23:18     ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2022-03-08 23:18 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree, Jacopo Mondi, Maxime Coquelin, Hugues Fruchet,
	Alexandre Torgue, dri-devel, Lad Prabhakar, Sakari Ailus,
	Eugen Hristev, Shawn Guo, linux-arm-kernel, linux-media

On Sun, Mar 06, 2022 at 08:04:49PM +0200, Laurent Pinchart wrote:
> On Sun, Mar 06, 2022 at 07:39:03PM +0200, Laurent Pinchart wrote:
> > Add a new dt-bindings/media/video-interfaces.h header that defines
> > macros corresponding to the bus types from media/video-interfaces.yaml.
> > This allows avoiding hardcoded constants in device tree sources.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > Changes since v1:
> > 
> > - Dual-license under GPL-2.0-only or MIT
> > - Rename PARALLEL TO BT601
> 
> Contrary to popular belief, further investigation revealed that BT.601
> doesn't define VSYNC and HSYNC (or HREF, as it is also commonly called)
> signals. MEDIA_BUS_TYPE_BT601 is thus likely not a good name. I haven't
> been able to find a standard for parallel camera interfaces that would
> be a good match here. On the display side there's MIPI DPI, but on the
> camera side it seems things have evolved quite organically. I may have
> missed something though.

So keep 'PARALLEL' and anything less ambiguous will be a new type.

Rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] ARM: dts: Use new media bus type macros
  2022-03-06 17:39 ` [PATCH v2 3/3] ARM: dts: Use new media bus type macros Laurent Pinchart
@ 2022-04-07 12:41   ` Alexandre TORGUE
  2022-04-07 13:31     ` Laurent Pinchart
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre TORGUE @ 2022-04-07 12:41 UTC (permalink / raw)
  To: Laurent Pinchart, devicetree, linux-media, dri-devel
  Cc: Jacopo Mondi, Maxime Coquelin, Hugues Fruchet, Lad Prabhakar,
	Shawn Guo, Rob Herring, Sakari Ailus, Eugen Hristev,
	linux-arm-kernel

Hi Laurent

On 3/6/22 18:39, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>   arch/arm/boot/dts/imx6ul-14x14-evk.dtsi               |  4 +++-
>   arch/arm/boot/dts/omap3-n900.dts                      |  5 +++--
>   arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
>   .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
>   .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
>   arch/arm/boot/dts/stm32429i-eval.dts                  |  3 ++-
>   arch/arm/boot/dts/stm32mp157c-ev1.dts                 |  3 ++-
>   7 files changed, 23 insertions(+), 11 deletions(-)
> 

sorry for this late answer. Is it possible to split ARM DT patches by 
vendor ?

Thanks
Alex


> diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> index a3fde3316c73..89234bbd02f4 100644
> --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> @@ -2,6 +2,8 @@
>   //
>   // Copyright (C) 2015 Freescale Semiconductor, Inc.
>   
> +#include <dt-bindings/media/video-interfaces.h>
> +
>   / {
>   	chosen {
>   		stdout-path = &uart1;
> @@ -170,7 +172,7 @@ &csi {
>   	port {
>   		parallel_from_ov5640: endpoint {
>   			remote-endpoint = <&ov5640_to_parallel>;
> -			bus-type = <5>; /* Parallel bus */
> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>   		};
>   	};
>   };
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index d40c3d2c4914..9cad9d6a83e2 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -9,6 +9,7 @@
>   #include "omap34xx.dtsi"
>   #include <dt-bindings/input/input.h>
>   #include <dt-bindings/leds/common.h>
> +#include <dt-bindings/media/video-interfaces.h>
>   
>   /*
>    * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
> @@ -194,7 +195,7 @@ port@1 {
>   
>   			csi_isp: endpoint {
>   				remote-endpoint = <&csi_cam1>;
> -				bus-type = <3>; /* CCP2 */
> +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
>   				clock-lanes = <1>;
>   				data-lanes = <0>;
>   				lane-polarity = <0 0>;
> @@ -835,7 +836,7 @@ cam1: camera@3e {
>   
>   		port {
>   			csi_cam1: endpoint {
> -				bus-type = <3>; /* CCP2 */
> +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
>   				strobe = <1>;
>   				clock-inv = <0>;
>   				crc = <1>;
> 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 3c8a7c8b1fdd..1043603fc4a5 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> @@ -7,6 +7,9 @@
>    */
>   
>   /dts-v1/;
> +
> +#include <dt-bindings/media/video-interfaces.h>
> +
>   #include "r8a7742-iwg21d-q7.dts"
>   
>   / {
> @@ -242,7 +245,7 @@ port {
>   		vin0ep: endpoint {
>   			remote-endpoint = <&cam0ep>;
>   			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>   		};
>   	};
>   };
> @@ -273,7 +276,7 @@ port {
>   		vin1ep: endpoint {
>   			remote-endpoint = <&cam1ep>;
>   			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>   		};
>   	};
>   };
> @@ -305,7 +308,7 @@ vin2ep: endpoint {
>   			remote-endpoint = <&cam2ep>;
>   			bus-width = <8>;
>   			data-shift = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>   		};
>   	};
>   };
> @@ -335,7 +338,7 @@ port {
>   		vin3ep: endpoint {
>   			remote-endpoint = <&cam3ep>;
>   			bus-width = <8>;
> -			bus-type = <6>;
> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>   		};
>   	};
>   };
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> index 40cef0b1d1e6..c73160df619d 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> @@ -7,6 +7,8 @@
>    * Copyright (C) 2020 Renesas Electronics Corp.
>    */
>   
> +#include <dt-bindings/media/video-interfaces.h>
> +
>   #define CAM_ENABLED	1
>   
>   &CAM_PARENT_I2C {
> @@ -26,7 +28,7 @@ port {
>   			CAM_EP: endpoint {
>   				bus-width = <8>;
>   				data-shift = <2>;
> -				bus-type = <6>;
> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>   				pclk-sample = <1>;
>   				remote-endpoint = <&VIN_EP>;
>   			};
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> index f5e77f024251..a7f5cfec64b8 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> @@ -7,6 +7,8 @@
>    * Copyright (C) 2020 Renesas Electronics Corp.
>    */
>   
> +#include <dt-bindings/media/video-interfaces.h>
> +
>   #define CAM_ENABLED	1
>   
>   &CAM_PARENT_I2C {
> @@ -21,7 +23,7 @@ ov7725@21 {
>   		port {
>   			CAM_EP: endpoint {
>   				bus-width = <8>;
> -				bus-type = <6>;
> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>   				remote-endpoint = <&VIN_EP>;
>   			};
>   		};
> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
> index cb46326a8c75..ecb10613d962 100644
> --- a/arch/arm/boot/dts/stm32429i-eval.dts
> +++ b/arch/arm/boot/dts/stm32429i-eval.dts
> @@ -50,6 +50,7 @@
>   #include "stm32f429-pinctrl.dtsi"
>   #include <dt-bindings/input/input.h>
>   #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/media/video-interfaces.h>
>   
>   / {
>   	model = "STMicroelectronics STM32429i-EVAL board";
> @@ -186,7 +187,7 @@ &dcmi {
>   	port {
>   		dcmi_0: endpoint {
>   			remote-endpoint = <&ov2640_0>;
> -			bus-type = <5>;
> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>   			bus-width = <8>;
>   			hsync-active = <0>;
>   			vsync-active = <0>;
> diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> index e222d2d2cb44..24f59f3b15dc 100644
> --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
> +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> @@ -8,6 +8,7 @@
>   #include "stm32mp157c-ed1.dts"
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/input/input.h>
> +#include <dt-bindings/media/video-interfaces.h>
>   
>   / {
>   	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
> @@ -90,7 +91,7 @@ &dcmi {
>   	port {
>   		dcmi_0: endpoint {
>   			remote-endpoint = <&ov5640_0>;
> -			bus-type = <5>;
> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>   			bus-width = <8>;
>   			hsync-active = <0>;
>   			vsync-active = <0>;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] ARM: dts: Use new media bus type macros
  2022-04-07 12:41   ` Alexandre TORGUE
@ 2022-04-07 13:31     ` Laurent Pinchart
  2022-04-07 13:50       ` Alexandre TORGUE
  0 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2022-04-07 13:31 UTC (permalink / raw)
  To: Alexandre TORGUE
  Cc: devicetree, Jacopo Mondi, Maxime Coquelin, Hugues Fruchet,
	Lad Prabhakar, dri-devel, Rob Herring, Sakari Ailus,
	Eugen Hristev, Shawn Guo, linux-arm-kernel, linux-media

Hi Alexandre,

On Thu, Apr 07, 2022 at 02:41:58PM +0200, Alexandre TORGUE wrote:
> On 3/6/22 18:39, Laurent Pinchart wrote:
> > Now that a header exists with macros for the media interface bus-type
> > values, replace hardcoding numerical constants with the corresponding
> > macros in the DT sources.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >   arch/arm/boot/dts/imx6ul-14x14-evk.dtsi               |  4 +++-
> >   arch/arm/boot/dts/omap3-n900.dts                      |  5 +++--
> >   arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
> >   .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
> >   .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
> >   arch/arm/boot/dts/stm32429i-eval.dts                  |  3 ++-
> >   arch/arm/boot/dts/stm32mp157c-ev1.dts                 |  3 ++-
> >   7 files changed, 23 insertions(+), 11 deletions(-)
> 
> sorry for this late answer. Is it possible to split ARM DT patches by 
> vendor ?

Sure. Is that only to ease backporting, or do you want the ST part to be
merged through a different tree ?

> > diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > index a3fde3316c73..89234bbd02f4 100644
> > --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > @@ -2,6 +2,8 @@
> >   //
> >   // Copyright (C) 2015 Freescale Semiconductor, Inc.
> >   
> > +#include <dt-bindings/media/video-interfaces.h>
> > +
> >   / {
> >   	chosen {
> >   		stdout-path = &uart1;
> > @@ -170,7 +172,7 @@ &csi {
> >   	port {
> >   		parallel_from_ov5640: endpoint {
> >   			remote-endpoint = <&ov5640_to_parallel>;
> > -			bus-type = <5>; /* Parallel bus */
> > +			bus-type = <MEDIA_BUS_TYPE_BT601>;
> >   		};
> >   	};
> >   };
> > diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> > index d40c3d2c4914..9cad9d6a83e2 100644
> > --- a/arch/arm/boot/dts/omap3-n900.dts
> > +++ b/arch/arm/boot/dts/omap3-n900.dts
> > @@ -9,6 +9,7 @@
> >   #include "omap34xx.dtsi"
> >   #include <dt-bindings/input/input.h>
> >   #include <dt-bindings/leds/common.h>
> > +#include <dt-bindings/media/video-interfaces.h>
> >   
> >   /*
> >    * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
> > @@ -194,7 +195,7 @@ port@1 {
> >   
> >   			csi_isp: endpoint {
> >   				remote-endpoint = <&csi_cam1>;
> > -				bus-type = <3>; /* CCP2 */
> > +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
> >   				clock-lanes = <1>;
> >   				data-lanes = <0>;
> >   				lane-polarity = <0 0>;
> > @@ -835,7 +836,7 @@ cam1: camera@3e {
> >   
> >   		port {
> >   			csi_cam1: endpoint {
> > -				bus-type = <3>; /* CCP2 */
> > +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
> >   				strobe = <1>;
> >   				clock-inv = <0>;
> >   				crc = <1>;
> > 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 3c8a7c8b1fdd..1043603fc4a5 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> > @@ -7,6 +7,9 @@
> >    */
> >   
> >   /dts-v1/;
> > +
> > +#include <dt-bindings/media/video-interfaces.h>
> > +
> >   #include "r8a7742-iwg21d-q7.dts"
> >   
> >   / {
> > @@ -242,7 +245,7 @@ port {
> >   		vin0ep: endpoint {
> >   			remote-endpoint = <&cam0ep>;
> >   			bus-width = <8>;
> > -			bus-type = <6>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   		};
> >   	};
> >   };
> > @@ -273,7 +276,7 @@ port {
> >   		vin1ep: endpoint {
> >   			remote-endpoint = <&cam1ep>;
> >   			bus-width = <8>;
> > -			bus-type = <6>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   		};
> >   	};
> >   };
> > @@ -305,7 +308,7 @@ vin2ep: endpoint {
> >   			remote-endpoint = <&cam2ep>;
> >   			bus-width = <8>;
> >   			data-shift = <8>;
> > -			bus-type = <6>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   		};
> >   	};
> >   };
> > @@ -335,7 +338,7 @@ port {
> >   		vin3ep: endpoint {
> >   			remote-endpoint = <&cam3ep>;
> >   			bus-width = <8>;
> > -			bus-type = <6>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   		};
> >   	};
> >   };
> > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > index 40cef0b1d1e6..c73160df619d 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> > @@ -7,6 +7,8 @@
> >    * Copyright (C) 2020 Renesas Electronics Corp.
> >    */
> >   
> > +#include <dt-bindings/media/video-interfaces.h>
> > +
> >   #define CAM_ENABLED	1
> >   
> >   &CAM_PARENT_I2C {
> > @@ -26,7 +28,7 @@ port {
> >   			CAM_EP: endpoint {
> >   				bus-width = <8>;
> >   				data-shift = <2>;
> > -				bus-type = <6>;
> > +				bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   				pclk-sample = <1>;
> >   				remote-endpoint = <&VIN_EP>;
> >   			};
> > diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > index f5e77f024251..a7f5cfec64b8 100644
> > --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> > @@ -7,6 +7,8 @@
> >    * Copyright (C) 2020 Renesas Electronics Corp.
> >    */
> >   
> > +#include <dt-bindings/media/video-interfaces.h>
> > +
> >   #define CAM_ENABLED	1
> >   
> >   &CAM_PARENT_I2C {
> > @@ -21,7 +23,7 @@ ov7725@21 {
> >   		port {
> >   			CAM_EP: endpoint {
> >   				bus-width = <8>;
> > -				bus-type = <6>;
> > +				bus-type = <MEDIA_BUS_TYPE_BT656>;
> >   				remote-endpoint = <&VIN_EP>;
> >   			};
> >   		};
> > diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
> > index cb46326a8c75..ecb10613d962 100644
> > --- a/arch/arm/boot/dts/stm32429i-eval.dts
> > +++ b/arch/arm/boot/dts/stm32429i-eval.dts
> > @@ -50,6 +50,7 @@
> >   #include "stm32f429-pinctrl.dtsi"
> >   #include <dt-bindings/input/input.h>
> >   #include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/media/video-interfaces.h>
> >   
> >   / {
> >   	model = "STMicroelectronics STM32429i-EVAL board";
> > @@ -186,7 +187,7 @@ &dcmi {
> >   	port {
> >   		dcmi_0: endpoint {
> >   			remote-endpoint = <&ov2640_0>;
> > -			bus-type = <5>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT601>;
> >   			bus-width = <8>;
> >   			hsync-active = <0>;
> >   			vsync-active = <0>;
> > diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> > index e222d2d2cb44..24f59f3b15dc 100644
> > --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
> > +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> > @@ -8,6 +8,7 @@
> >   #include "stm32mp157c-ed1.dts"
> >   #include <dt-bindings/gpio/gpio.h>
> >   #include <dt-bindings/input/input.h>
> > +#include <dt-bindings/media/video-interfaces.h>
> >   
> >   / {
> >   	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
> > @@ -90,7 +91,7 @@ &dcmi {
> >   	port {
> >   		dcmi_0: endpoint {
> >   			remote-endpoint = <&ov5640_0>;
> > -			bus-type = <5>;
> > +			bus-type = <MEDIA_BUS_TYPE_BT601>;
> >   			bus-width = <8>;
> >   			hsync-active = <0>;
> >   			vsync-active = <0>;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] ARM: dts: Use new media bus type macros
  2022-04-07 13:31     ` Laurent Pinchart
@ 2022-04-07 13:50       ` Alexandre TORGUE
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre TORGUE @ 2022-04-07 13:50 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree, Jacopo Mondi, Maxime Coquelin, Hugues Fruchet,
	Lad Prabhakar, dri-devel, Rob Herring, Sakari Ailus,
	Eugen Hristev, Shawn Guo, linux-arm-kernel, linux-media

On 4/7/22 15:31, Laurent Pinchart wrote:
> Hi Alexandre,
> 
> On Thu, Apr 07, 2022 at 02:41:58PM +0200, Alexandre TORGUE wrote:
>> On 3/6/22 18:39, Laurent Pinchart wrote:
>>> Now that a header exists with macros for the media interface bus-type
>>> values, replace hardcoding numerical constants with the corresponding
>>> macros in the DT sources.
>>>
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> ---
>>>    arch/arm/boot/dts/imx6ul-14x14-evk.dtsi               |  4 +++-
>>>    arch/arm/boot/dts/omap3-n900.dts                      |  5 +++--
>>>    arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts       | 11 +++++++----
>>>    .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi     |  4 +++-
>>>    .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi     |  4 +++-
>>>    arch/arm/boot/dts/stm32429i-eval.dts                  |  3 ++-
>>>    arch/arm/boot/dts/stm32mp157c-ev1.dts                 |  3 ++-
>>>    7 files changed, 23 insertions(+), 11 deletions(-)
>>
>> sorry for this late answer. Is it possible to split ARM DT patches by
>> vendor ?
> 
> Sure. Is that only to ease backporting, or do you want the ST part to be
> merged through a different tree ?

I usually take all STM32 DT patches in my stm32-next branch. It's to 
avoid merge issue at arm-soc maintainer level.

thanks
alex

>>> diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
>>> index a3fde3316c73..89234bbd02f4 100644
>>> --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
>>> +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
>>> @@ -2,6 +2,8 @@
>>>    //
>>>    // Copyright (C) 2015 Freescale Semiconductor, Inc.
>>>    
>>> +#include <dt-bindings/media/video-interfaces.h>
>>> +
>>>    / {
>>>    	chosen {
>>>    		stdout-path = &uart1;
>>> @@ -170,7 +172,7 @@ &csi {
>>>    	port {
>>>    		parallel_from_ov5640: endpoint {
>>>    			remote-endpoint = <&ov5640_to_parallel>;
>>> -			bus-type = <5>; /* Parallel bus */
>>> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>>>    		};
>>>    	};
>>>    };
>>> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
>>> index d40c3d2c4914..9cad9d6a83e2 100644
>>> --- a/arch/arm/boot/dts/omap3-n900.dts
>>> +++ b/arch/arm/boot/dts/omap3-n900.dts
>>> @@ -9,6 +9,7 @@
>>>    #include "omap34xx.dtsi"
>>>    #include <dt-bindings/input/input.h>
>>>    #include <dt-bindings/leds/common.h>
>>> +#include <dt-bindings/media/video-interfaces.h>
>>>    
>>>    /*
>>>     * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
>>> @@ -194,7 +195,7 @@ port@1 {
>>>    
>>>    			csi_isp: endpoint {
>>>    				remote-endpoint = <&csi_cam1>;
>>> -				bus-type = <3>; /* CCP2 */
>>> +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
>>>    				clock-lanes = <1>;
>>>    				data-lanes = <0>;
>>>    				lane-polarity = <0 0>;
>>> @@ -835,7 +836,7 @@ cam1: camera@3e {
>>>    
>>>    		port {
>>>    			csi_cam1: endpoint {
>>> -				bus-type = <3>; /* CCP2 */
>>> +				bus-type = <MEDIA_BUS_TYPE_CCP2>;
>>>    				strobe = <1>;
>>>    				clock-inv = <0>;
>>>    				crc = <1>;
>>> 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 3c8a7c8b1fdd..1043603fc4a5 100644
>>> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
>>> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
>>> @@ -7,6 +7,9 @@
>>>     */
>>>    
>>>    /dts-v1/;
>>> +
>>> +#include <dt-bindings/media/video-interfaces.h>
>>> +
>>>    #include "r8a7742-iwg21d-q7.dts"
>>>    
>>>    / {
>>> @@ -242,7 +245,7 @@ port {
>>>    		vin0ep: endpoint {
>>>    			remote-endpoint = <&cam0ep>;
>>>    			bus-width = <8>;
>>> -			bus-type = <6>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    		};
>>>    	};
>>>    };
>>> @@ -273,7 +276,7 @@ port {
>>>    		vin1ep: endpoint {
>>>    			remote-endpoint = <&cam1ep>;
>>>    			bus-width = <8>;
>>> -			bus-type = <6>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    		};
>>>    	};
>>>    };
>>> @@ -305,7 +308,7 @@ vin2ep: endpoint {
>>>    			remote-endpoint = <&cam2ep>;
>>>    			bus-width = <8>;
>>>    			data-shift = <8>;
>>> -			bus-type = <6>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    		};
>>>    	};
>>>    };
>>> @@ -335,7 +338,7 @@ port {
>>>    		vin3ep: endpoint {
>>>    			remote-endpoint = <&cam3ep>;
>>>    			bus-width = <8>;
>>> -			bus-type = <6>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    		};
>>>    	};
>>>    };
>>> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
>>> index 40cef0b1d1e6..c73160df619d 100644
>>> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
>>> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
>>> @@ -7,6 +7,8 @@
>>>     * Copyright (C) 2020 Renesas Electronics Corp.
>>>     */
>>>    
>>> +#include <dt-bindings/media/video-interfaces.h>
>>> +
>>>    #define CAM_ENABLED	1
>>>    
>>>    &CAM_PARENT_I2C {
>>> @@ -26,7 +28,7 @@ port {
>>>    			CAM_EP: endpoint {
>>>    				bus-width = <8>;
>>>    				data-shift = <2>;
>>> -				bus-type = <6>;
>>> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    				pclk-sample = <1>;
>>>    				remote-endpoint = <&VIN_EP>;
>>>    			};
>>> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
>>> index f5e77f024251..a7f5cfec64b8 100644
>>> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
>>> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
>>> @@ -7,6 +7,8 @@
>>>     * Copyright (C) 2020 Renesas Electronics Corp.
>>>     */
>>>    
>>> +#include <dt-bindings/media/video-interfaces.h>
>>> +
>>>    #define CAM_ENABLED	1
>>>    
>>>    &CAM_PARENT_I2C {
>>> @@ -21,7 +23,7 @@ ov7725@21 {
>>>    		port {
>>>    			CAM_EP: endpoint {
>>>    				bus-width = <8>;
>>> -				bus-type = <6>;
>>> +				bus-type = <MEDIA_BUS_TYPE_BT656>;
>>>    				remote-endpoint = <&VIN_EP>;
>>>    			};
>>>    		};
>>> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
>>> index cb46326a8c75..ecb10613d962 100644
>>> --- a/arch/arm/boot/dts/stm32429i-eval.dts
>>> +++ b/arch/arm/boot/dts/stm32429i-eval.dts
>>> @@ -50,6 +50,7 @@
>>>    #include "stm32f429-pinctrl.dtsi"
>>>    #include <dt-bindings/input/input.h>
>>>    #include <dt-bindings/gpio/gpio.h>
>>> +#include <dt-bindings/media/video-interfaces.h>
>>>    
>>>    / {
>>>    	model = "STMicroelectronics STM32429i-EVAL board";
>>> @@ -186,7 +187,7 @@ &dcmi {
>>>    	port {
>>>    		dcmi_0: endpoint {
>>>    			remote-endpoint = <&ov2640_0>;
>>> -			bus-type = <5>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>>>    			bus-width = <8>;
>>>    			hsync-active = <0>;
>>>    			vsync-active = <0>;
>>> diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
>>> index e222d2d2cb44..24f59f3b15dc 100644
>>> --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
>>> +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
>>> @@ -8,6 +8,7 @@
>>>    #include "stm32mp157c-ed1.dts"
>>>    #include <dt-bindings/gpio/gpio.h>
>>>    #include <dt-bindings/input/input.h>
>>> +#include <dt-bindings/media/video-interfaces.h>
>>>    
>>>    / {
>>>    	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
>>> @@ -90,7 +91,7 @@ &dcmi {
>>>    	port {
>>>    		dcmi_0: endpoint {
>>>    			remote-endpoint = <&ov5640_0>;
>>> -			bus-type = <5>;
>>> +			bus-type = <MEDIA_BUS_TYPE_BT601>;
>>>    			bus-width = <8>;
>>>    			hsync-active = <0>;
>>>    			vsync-active = <0>;
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-07 13:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-06 17:39 [PATCH v2 0/3] dt-bindings: Add macros for video interface bus types Laurent Pinchart
2022-03-06 17:39 ` [PATCH v2 1/3] dt-bindings: media: " Laurent Pinchart
2022-03-06 18:04   ` Laurent Pinchart
2022-03-08 23:18     ` Rob Herring
2022-03-06 17:39 ` [PATCH v2 2/3] dt-bindings: Use new video interface bus type macros in examples Laurent Pinchart
2022-03-06 17:39 ` [PATCH v2 3/3] ARM: dts: Use new media bus type macros Laurent Pinchart
2022-04-07 12:41   ` Alexandre TORGUE
2022-04-07 13:31     ` Laurent Pinchart
2022-04-07 13:50       ` Alexandre TORGUE

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).