Devicetree
 help / color / mirror / Atom feed
* [PATCH 06/16] ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together
with its function definitions in sama5d2.dtsi. Boards will just fill
the pins and enable the desired functions.

There is a single functional change in this patch. With the move of the
flx0 uart5 definition in the SoC dtsi, the uart5 from
at91-sama5d27_wlsom1_ek.dts inherits the following optional property:
atmel,fifo-size = <32>;
This particular change was tested by Codrin.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi    | 13 ------
 arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts | 12 ------
 arch/arm/boot/dts/at91-sama5d2_icp.dts        |  6 ---
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     |  7 ----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   |  7 +---
 arch/arm/boot/dts/sama5d2.dtsi                | 40 +++++++++++++++++++
 6 files changed, 41 insertions(+), 44 deletions(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index 4351a8d32225..7c3076e245ef 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -299,21 +299,8 @@
 	status = "disabled";
 
 	uart5: serial@200  {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x400>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(11))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(12))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "usart";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx0_default>;
-		atmel,fifo-size = <32>;
 		atmel,use-dma-rx;
 		atmel,use-dma-tx;
 		status = "disabled";
diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
index 6b8461278950..6b38fa3f5568 100644
--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
@@ -77,18 +77,6 @@
 	status = "okay";
 
 	uart5: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x200>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(11))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(12))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "usart";
 		pinctrl-0 = <&pinctrl_flx0_default>;
 		pinctrl-names = "default";
 		atmel,use-dma-rx;
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 23f413afb333..4a01ab8e7e70 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -105,15 +105,9 @@
 	status = "okay";
 
 	spi2: spi@400 {
-		compatible = "atmel,at91rm9200-spi";
-		reg = <0x400 0x200>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "spi_clk";
 		cs-gpios = <&pioA PIN_PC0 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus2_spi &pinctrl_ksz_spi_cs>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 		#address-cells = <1>;
 		#size-cells = <0>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 32435ce1dab2..8ad3a9c6c536 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -191,20 +191,13 @@
 				status = "okay";
 
 				i2c2: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
 					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					pinctrl-1 = <&pinctrl_flx0_gpio>;
 					sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>;
 					scl-gpios = <&pioA PIN_PB29 GPIO_ACTIVE_HIGH>;
-					atmel,fifo-size = <16>;
 					status = "okay";
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index a5046f8257ad..da4442715ea5 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -327,14 +327,9 @@
 				status = "disabled"; /* conflict with ISC_D2 & ISC_D3 data pins */
 
 				uart5: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-					clock-names = "usart";
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx0_default>;
-					atmel,fifo-size = <32>;
 					status = "okay";
 				};
 			};
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 79ed7bd02df6..acb91908bd74 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -635,6 +635,46 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xf8034000 0x800>;
 				status = "disabled";
+
+				uart5: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi2: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c2: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx1: flexcom@f8038000 {
-- 
2.23.0

^ permalink raw reply related

* [PATCH 10/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Spare boards of duplicating the DMA bindings. Describe the flx1
DMA bindings in the SoC dtsi. Users that don't want to use DMA
for their flexcom functions have to overwrite the flexcom DMA
bindings in their board device tree.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 -
 arch/arm/boot/dts/sama5d2.dtsi              | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 1aa8b79d618b..0e159f879c15 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -127,7 +127,6 @@
 
 				i2c3: i2c@600 {
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
 					i2c-analog-filter;
 					i2c-digital-filter;
 					i2c-digital-filter-width-ns = <35>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5a0162915ae7..855846c74a32 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -712,6 +712,15 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(13))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(14))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 08/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Spare boards of duplicating the DMA bindings. Describe the flx4
DMA bindings in the SoC dtsi. Users that don't want to use DMA
for their flexcom functions have to overwrite the flexcom DMA
bindings in their board device tree.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |  2 ++
 arch/arm/boot/dts/sama5d2.dtsi              | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index a0deff15fb9a..6ad66d034305 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -190,12 +190,14 @@
 				status = "okay";
 
 				uart9: serial@200 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
 				spi6: spi@400 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
 					status = "okay"; /* Conflict with uart5 and i2c6. */
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index dde969a140b4..66aa8d6502d3 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -939,6 +939,15 @@
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
@@ -949,6 +958,15 @@
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 15/16] ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Users can choose which flexcom function to use. Describe the I2C
Flexcom0 function. Add alias for the i2c2 node in order to not rely
on probe order for the i2c device numbering. The sama5d2 SoC has
two dedicated i2c buses and five flexcoms that can function as i2c.
The i2c0 and i2c1 aliases are kept for the dedicated i2c buses,
the i2c flexcom functions can be numbered in order starting from i2c2.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 01ffbddd4ab8..77e5d4f5a102 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -18,6 +18,7 @@
 
 	aliases {
 		serial0 = &uart1;	/* DBGU */
+		i2c2 = &i2c2;		/* XPRO EXT2 */
 	};
 
 	chosen {
@@ -336,6 +337,20 @@
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					status = "okay";
 				};
+
+				i2c2: i2c@600 {
+					dmas = <0>, <0>;
+					pinctrl-names = "default", "gpio";
+					pinctrl-0 = <&pinctrl_flx0_default>;
+					pinctrl-1 = <&pinctrl_i2c2_gpio>;
+					sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>;
+					scl-gpios = <&pioA PIN_PB29 GPIO_ACTIVE_HIGH>;
+					i2c-sda-hold-time-ns = <350>;
+					i2c-analog-filter;
+					i2c-digital-filter;
+					i2c-digital-filter-width-ns = <35>;
+					status = "disabled"; /* conflict with ISC_D2 & ISC_D3 data pins */
+				};
 			};
 
 			shdwc@f8048010 {
@@ -523,6 +538,12 @@
 					bias-disable;
 				};
 
+				pinctrl_i2c2_gpio: i2c2_gpio {
+					pinmux = <PIN_PB28__GPIO>,
+						 <PIN_PB29__GPIO>;
+					bias-disable;
+				};
+
 				pinctrl_i2s0_default: i2s0_default {
 					pinmux = <PIN_PC1__I2SC0_CK>,
 						 <PIN_PC2__I2SC0_MCK>,
-- 
2.23.0

^ permalink raw reply related

* [PATCH 12/16] ARM: dts: at91: sama5d2: Add missing flexcom definitions
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Describe all the flexcom functions for all the flexcom nodes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 79 ++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5bba8024f485..b8cdeedee6bc 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -723,6 +723,25 @@
 					status = "disabled";
 				};
 
+				spi3: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(13))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(14))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
 				i2c3: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
@@ -910,6 +929,45 @@
 					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
+
+				spi4: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(15))>,
+						<&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(16))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c4: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(15))>,
+						<&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(16))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx3: flexcom@fc014000 {
@@ -958,6 +1016,27 @@
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
+
+				i2c5: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
 			};
 
 			flx4: flexcom@fc018000 {
-- 
2.23.0

^ permalink raw reply related

* [PATCH 13/16] ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Device aliases are board-specific, if needed one should define them
in board dts rather than in the SoC dtsi. If an alias from the SoC
dtsi is addressed by a driver that does not use any of the of_alias*()
methods, we can drop it. This is the case for the i2s aliases, drop
them. tcb aliases point to nodes that are not enabled in any of the
sama5d2 based platforms. atmel_tclib.c is scheduled to go away, any
board using that alias is already broken, so get rid of the tcb aliases
too.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index b8cdeedee6bc..c0a3ca8f9bf7 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -21,10 +21,6 @@
 	aliases {
 		serial0 = &uart1;
 		serial1 = &uart3;
-		tcb0 = &tcb0;
-		tcb1 = &tcb1;
-		i2s0 = &i2s0;
-		i2s1 = &i2s1;
 	};
 
 	cpus {
-- 
2.23.0

^ permalink raw reply related

* [PATCH 16/16] ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Indicate which i2c alias is for which connector on the board.
Specify that serial0 is for DBGU. This eases tester's life.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 0e0341c83aa5..45c671a2bcf2 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -18,9 +18,9 @@
 	compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5";
 
 	aliases {
-		serial0 = &uart0;
-		i2c0	= &i2c0;
-		i2c1	= &i2c1;
+		serial0 = &uart0;	/* DBGU */
+		i2c0	= &i2c0;	/* mikroBUS 1 */
+		i2c1	= &i2c1;	/* XPRO EXT1 */
 		i2c2	= &i2c2;
 	};
 
-- 
2.23.0

^ permalink raw reply related

* [PATCH 07/16] ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The UART submodule in Flexcom has 32-byte Transmit and Receive FIFOs.
Tested uart7 on sama5d2-icp, which has both DMA and FIFO enabled.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index acb91908bd74..dde969a140b4 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -701,6 +701,7 @@
 						 AT91_XDMAC_DT_PER_IF(1) |
 						 AT91_XDMAC_DT_PERID(14))>;
 					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
 
@@ -879,6 +880,7 @@
 						 AT91_XDMAC_DT_PER_IF(1) |
 						 AT91_XDMAC_DT_PERID(16))>;
 					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
 			};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 09/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Spare boards of duplicating the DMA bindings. Describe the flx3
DMA bindings in the SoC dtsi. Users that don't want to use DMA
for their flexcom functions have to overwrite the flexcom DMA
bindings in their board device tree.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 arch/arm/boot/dts/at91-sama5d2_icp.dts      | 1 +
 arch/arm/boot/dts/sama5d2.dtsi              | 9 +++++++++
 3 files changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 6ad66d034305..1aa8b79d618b 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -179,6 +179,7 @@
 				};
 
 				spi5: spi@400 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
 					status = "disabled"; /* Conflict with isc. */
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 4a01ab8e7e70..559d8ae93af9 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -167,6 +167,7 @@
 	status = "okay";
 
 	spi5: spi@400 {
+		dmas = <0>, <0>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus1_spi &pinctrl_mikrobus1_spi_cs>;
 		status = "okay";
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 66aa8d6502d3..5a0162915ae7 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -919,6 +919,15 @@
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 11/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Spare boards of duplicating the DMA bindings. Describe the flx0
DMA bindings in the SoC dtsi. Users that don't want to use DMA
for their flexcom functions have to overwrite the flexcom DMA
bindings in their board device tree.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_icp.dts    |  1 +
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts |  1 -
 arch/arm/boot/dts/sama5d2.dtsi            | 18 ++++++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 559d8ae93af9..8d19925fc09e 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -105,6 +105,7 @@
 	status = "okay";
 
 	spi2: spi@400 {
+		dmas = <0>, <0>;
 		cs-gpios = <&pioA PIN_PC0 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus2_spi &pinctrl_ksz_spi_cs>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 8ad3a9c6c536..0e0341c83aa5 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -192,7 +192,6 @@
 
 				i2c2: i2c@600 {
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					pinctrl-1 = <&pinctrl_flx0_gpio>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 855846c74a32..5bba8024f485 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -661,6 +661,15 @@
 					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
@@ -672,6 +681,15 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 14/16] ARM: dts: at91: sama5d2_xplained: Add alias for DBGU
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The aliases should be defined in the board dts rather than in the
SoC dtsi. Don't rely on the aliases defined in the SoC dtsi and define
the alias for the Serial DBGU in the board dts file. sama5d2 boards use
the "serial0" alias for the Serial DBGU, do the same for sama5d2_xplained.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index da4442715ea5..01ffbddd4ab8 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -16,6 +16,10 @@
 	model = "Atmel SAMA5D2 Xplained";
 	compatible = "atmel,sama5d2-xplained", "atmel,sama5d2", "atmel,sama5";
 
+	aliases {
+		serial0 = &uart1;	/* DBGU */
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
-- 
2.23.0

^ permalink raw reply related

* [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sama5d2 SoC has the following IPs: [uart0, uart4], {spi0, spi1}, {i2c0, i2c1}.
Label the flexcom functions in order:
flx0: uart5, spi2, i2c2
flx1: uart6, spi3, i2c3
flx2: uart7, spi4, i2c4
flx3: uart8, spi5, i2c5
flx4: uart9, spi6, i2c6

Some boards respected this scheme, others not. Fix the ones that didn't.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-kizbox3-hs.dts       |  4 ++--
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  |  8 ++++----
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 20 ++++++++++----------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  8 ++++----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3-hs.dts b/arch/arm/boot/dts/at91-kizbox3-hs.dts
index 8734e7f8939e..0da1f0557eaf 100644
--- a/arch/arm/boot/dts/at91-kizbox3-hs.dts
+++ b/arch/arm/boot/dts/at91-kizbox3-hs.dts
@@ -283,7 +283,7 @@
 
 &flx3 {
 	status = "okay";
-	uart6: serial@200 {
+	uart8: serial@200 {
 		status = "okay";
 	};
 };
@@ -291,7 +291,7 @@
 &flx4 {
 	status = "okay";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		status = "okay";
 	};
 };
diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index 299e74d23184..d7a6c972bdac 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -28,7 +28,7 @@
 		serial3 = &uart3;
 		serial4 = &uart4;
 		serial5 = &uart5;
-		serial6 = &uart6;
+		serial6 = &uart8;
 	};
 
 	chosen {
@@ -207,7 +207,7 @@
 		};
 	};
 
-	pinctrl_flx4_default: flx4_i2c2_default {
+	pinctrl_flx4_default: flx4_i2c6_default {
 		pinmux = <PIN_PD12__FLEXCOM4_IO0>, //DATA
 		<PIN_PD13__FLEXCOM4_IO1>; //CLK
 		bias-disable;
@@ -324,7 +324,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "disabled";
 
-	uart6: serial@200 {
+	uart8: serial@200 {
 		compatible = "atmel,at91sam9260-usart";
 		reg = <0x200 0x400>;
 		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -350,7 +350,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "disabled";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		compatible = "atmel,sama5d2-i2c";
 		reg = <0x600 0x200>;
 		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index b0853bf7901c..d215243fe163 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -21,7 +21,7 @@
 		serial1 = &uart4;	/* mikro BUS 1 */
 		serial2 = &uart2;	/* mikro BUS 2 */
 		i2c1	= &i2c1;
-		i2c2	= &i2c2;
+		i2c2	= &i2c3;
 	};
 
 	chosen {
@@ -125,7 +125,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
-				i2c2: i2c@600 {
+				i2c3: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -178,7 +178,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 				status = "disabled";
 
-				uart7: serial@200 {
+				uart8: serial@200 {
 					compatible = "atmel,at91sam9260-usart";
 					reg = <0x200 0x200>;
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -190,7 +190,7 @@
 					status = "disabled"; /* Conflict with isc. */
 				};
 
-				spi2: spi@400 {
+				spi5: spi@400 {
 					compatible = "atmel,at91rm9200-spi";
 					reg = <0x400 0x200>;
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -207,7 +207,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 				status = "okay";
 
-				uart6: serial@200 {
+				uart9: serial@200 {
 					compatible = "atmel,at91sam9260-usart";
 					reg = <0x200 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -216,10 +216,10 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					atmel,fifo-size = <32>;
-					status = "disabled"; /* Conflict with spi3 and i2c3. */
+					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
-				spi3: spi@400 {
+				spi6: spi@400 {
 					compatible = "atmel,at91rm9200-spi";
 					reg = <0x400 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -228,10 +228,10 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
 					atmel,fifo-size = <16>;
-					status = "okay"; /* Conflict with uart6 and i2c3. */
+					status = "okay"; /* Conflict with uart5 and i2c6. */
 				};
 
-				i2c3: i2c@600 {
+				i2c6: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -243,7 +243,7 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					atmel,fifo-size = <16>;
-					status = "disabled"; /* Conflict with uart6 and spi3. */
+					status = "disabled"; /* Conflict with uart5 and spi6. */
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index cc9fa700eafb..1d9556dbbd63 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -22,7 +22,7 @@
 		serial0 = &uart0;	/* debug uart0 + mikro BUS 1 */
 		serial1 = &uart1;	/* mikro BUS 3 */
 		serial3 = &uart3;	/* mikro BUS 2 */
-		serial5 = &uart5;	/* flx2 */
+		serial5 = &uart7;	/* flx2 */
 		i2c0	= &i2c0;
 		i2c1	= &i2c1;
 	};
@@ -159,7 +159,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "okay";
 
-	uart5: serial@200 {
+	uart7: serial@200 {
 		compatible = "atmel,at91sam9260-usart";
 		reg = <0x200 0x200>;
 		interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -184,7 +184,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 	status = "okay";
 
-	spi3: spi@400 {
+	spi5: spi@400 {
 		compatible = "atmel,at91rm9200-spi";
 		reg = <0x400 0x200>;
 		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -201,7 +201,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		compatible = "atmel,sama5d2-i2c";
 		reg = <0x600 0x200>;
 		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index e0c6cff1a312..0666708b05f9 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -377,7 +377,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
-				i2c2: i2c@600 {
+				i2c6: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-- 
2.23.0

^ permalink raw reply related

* [PATCH 02/16] ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together
with its function definitions in sama5d2.dtsi. Boards will just fill
the pins and enable the desired functions.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  | 14 --------
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 20 -----------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  8 -----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts |  8 -----
 arch/arm/boot/dts/sama5d2.dtsi              | 40 +++++++++++++++++++++
 5 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index d7a6c972bdac..ee6f036aa008 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -351,22 +351,8 @@
 	status = "disabled";
 
 	i2c6: i2c@600 {
-		compatible = "atmel,sama5d2-i2c";
-		reg = <0x600 0x200>;
-		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(19))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(20))>;
-		dma-names = "tx", "rx";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx4_default>;
-		atmel,fifo-size = <16>;
 		status = "disabled";
 	};
 };
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index d215243fe163..5f4a7c8725f3 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -208,41 +208,21 @@
 				status = "okay";
 
 				uart9: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
-					clock-names = "usart";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
-					atmel,fifo-size = <32>;
 					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
 				spi6: spi@400 {
-					compatible = "atmel,at91rm9200-spi";
-					reg = <0x400 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
-					clock-names = "spi_clk";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
-					atmel,fifo-size = <16>;
 					status = "okay"; /* Conflict with uart5 and i2c6. */
 				};
 
 				i2c6: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
-					atmel,fifo-size = <16>;
 					status = "disabled"; /* Conflict with uart5 and spi6. */
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 1d9556dbbd63..7216a794f4f6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -202,17 +202,9 @@
 	status = "okay";
 
 	i2c6: i2c@600 {
-		compatible = "atmel,sama5d2-i2c";
-		reg = <0x600 0x200>;
-		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 		dmas = <0>, <0>;
-		dma-names = "tx", "rx";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx4_default>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 
 		mcp16502@5b {
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 0666708b05f9..a5046f8257ad 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -378,20 +378,12 @@
 				status = "okay";
 
 				i2c6: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					pinctrl-1 = <&pinctrl_flx4_gpio>;
 					sda-gpios = <&pioA PIN_PD12 GPIO_ACTIVE_HIGH>;
 					scl-gpios = <&pioA PIN_PD13 GPIO_ACTIVE_HIGH>;
-					atmel,fifo-size = <16>;
 					i2c-analog-filter;
 					i2c-digital-filter;
 					i2c-digital-filter-width-ns = <35>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index ab550d69db91..5c31e4068eb5 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -814,6 +814,46 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xfc018000 0x800>;
 				status = "disabled";
+
+				uart9: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					clock-names = "usart";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi6: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c6: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			trng@fc01c000 {
-- 
2.23.0

^ permalink raw reply related

* [PATCH 03/16] ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus
In-Reply-To: <20200514050301.147442-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The Flexcom IP is part of the sama5d2 SoC. Move the flx3 node together
with its function definitions in sama5d2.dtsi. Boards will just fill
the pins and enable the desired functions.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  | 13 ---------
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 13 +--------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  6 -----
 arch/arm/boot/dts/sama5d2.dtsi              | 29 +++++++++++++++++++++
 4 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index ee6f036aa008..4351a8d32225 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -325,21 +325,8 @@
 	status = "disabled";
 
 	uart8: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x400>;
-		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(17))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(18))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-		clock-names = "usart";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx3_default>;
-		atmel,fifo-size = <32>;
 		atmel,use-dma-rx;
 		atmel,use-dma-tx;
 		status = "disabled";
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 5f4a7c8725f3..abbf14e29d85 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -179,26 +179,15 @@
 				status = "disabled";
 
 				uart8: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-					clock-names = "usart";
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
-					atmel,fifo-size = <32>;
 					status = "disabled"; /* Conflict with isc. */
 				};
 
 				spi5: spi@400 {
-					compatible = "atmel,at91rm9200-spi";
-					reg = <0x400 0x200>;
-					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-					clock-names = "spi_clk";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
-					atmel,fifo-size = <16>;
 					status = "disabled"; /* Conflict with isc. */
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 7216a794f4f6..8a4336e12a60 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -185,14 +185,8 @@
 	status = "okay";
 
 	spi5: spi@400 {
-		compatible = "atmel,at91rm9200-spi";
-		reg = <0x400 0x200>;
-		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-		clock-names = "spi_clk";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus1_spi &pinctrl_mikrobus1_spi_cs>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 	};
 };
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5c31e4068eb5..5e84cde8226a 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -804,6 +804,35 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xfc014000 0x800>;
 				status = "disabled";
+
+				uart8: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi5: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx4: flexcom@fc018000 {
-- 
2.23.0

^ permalink raw reply related

* [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Rework the sama5d2 SoC flexcom definitions. The Flexcom IPs are
in the SoC. Move all the flexcom nodes together with their function
definitions in the SoC dtsi. Boards will just fill the pins and enable
the desired functions. With this we remove the duplication of the
flexcom definitions across the sama5d2 boards.

Round the flexcom support and add the missing flexcom definitions.
All the flexcom functions are now defined.

Apart of the aliases and the new flx0 i2c function on sama5d2_xplained,
the only functional change that this patch set adds, is that it uart5,
uart6 and uart7 inherit the atmel,fifo-size = <32>; optional property.
These nodes have both the FIFO size described and the DMA enabled.
uart5 was tested on sama5d27-wlsom1-ek. On uart6 and uart7 a
Bluetooth module can be connected. Tested BT uart7 on sama5d2-icp.

Tudor Ambarus (16):
  ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions
  ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi
  ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi
  ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi
  ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi
  ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi
  ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART
  ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4
    functions
  ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function
  ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function
  ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0
    functions
  ARM: dts: at91: sama5d2: Add missing flexcom definitions
  ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi
  ARM: dts: at91: sama5d2_xplained: Add alias for DBGU
  ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function
  ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases

 arch/arm/boot/dts/at91-kizbox3-hs.dts         |   4 +-
 arch/arm/boot/dts/at91-kizbox3_common.dtsi    |  48 +--
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts   |  64 +---
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi   |  12 -
 arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts |  12 -
 arch/arm/boot/dts/at91-sama5d2_icp.dts        |  42 +--
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     |  14 +-
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   |  42 ++-
 arch/arm/boot/dts/sama5d2.dtsi                | 295 +++++++++++++++++-
 9 files changed, 347 insertions(+), 186 deletions(-)

-- 
2.23.0

^ permalink raw reply

* Re: [PATCH v11 1/2] drm/panel: add support for rm69299 visionox panel driver
From: Sam Ravnborg @ 2020-05-14  4:43 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Harigovindan P, freedreno, devicetree, linux-arm-msm, dri-devel,
	Matthias Kaehlcke, Sean Paul, Sean Paul
In-Reply-To: <CAPM=9twxp8xBRyBCGntn8OVuwOX0i+ZSMfZBcHEtT5zQ=L7foA@mail.gmail.com>

Hi Dave.

On Thu, May 14, 2020 at 01:35:22PM +1000, Dave Airlie wrote:
> On Thu, 7 May 2020 at 04:57, Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > Hi Harigovindan
> >
> > On Wed, Apr 29, 2020 at 11:15:14AM +0530, Harigovindan P wrote:
> > > Add support for Visionox panel driver.
> > >
> > > Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
> > > Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> >
> > Thanks for your persistence on this.
> > Patch applied.
> >
> > I fixed a few lingering --strict releated checkpatch warnings
> > when I applied.
> >
> >         Sam
> 
> I'm seeing
> 
> WARNING: modpost: missing MODULE_LICENSE() in
> drivers/gpu/drm/panel/panel-visionox-rm69299.o
> 
> Can we fix that up?

The patch is in drm-misc-next:
e41b49b7e4d4ad9755af4813a57b5f6a09e357d7
"drm: panel: add MODULE_LICENSE to panel-visionox-rm69299.c"

Holler if this does not fix it or we need to expedit it somehow.

	Sam

> 
> Dave.
> 
> >
> > > ---
> > >
> > > Changes in v2:
> > >       - Dropping redundant space in Kconfig(Sam Ravnborg).
> > >       - Changing structure for include files(Sam Ravnborg).
> > >       - Removing backlight related code and functions(Sam Ravnborg).
> > >       - Removing repeated printing of error message(Sam Ravnborg).
> > >       - Adding drm_connector as an argument for get_modes function.
> > > Changes in v3:
> > >       - Adding arguments for drm_panel_init to support against mainline.
> > > Changes in v4:
> > >       - Removing error messages from regulator_set_load.
> > >       - Removing dev struct entry.
> > >       - Removing checks.
> > >       - Dropping empty comment lines.
> > > Changes in v5:
> > >       - Removing unused struct member variables.
> > >       - Removing blank lines.
> > >       - Fixed indentation.
> > >       - Invoking dsi_detach and panel_remove while early exiting from probe.
> > > Changes in v6:
> > >       - Changed "35597" to "rm69299" for power_on function.
> > >       - Removing rm69299_config since it supports single type of panel for now.
> > >       - Fixed alignment.
> > >       - Using goto statements when regulator_set_load fails.
> > > Changes in v7:
> > >       - Added new goto statement when regulator_set_load fails.
> > > Changes in v8,v9,v10:
> > >       - Had changes in first patch, did not make any change in panel driver.
> > > Changes in v11:
> > >       - Fixing checkpatch script errors.
> > >       - Updated assignment of panel.dev property in  probe.
> > >
> > >  drivers/gpu/drm/panel/Kconfig                 |   8 +
> > >  drivers/gpu/drm/panel/Makefile                |   1 +
> > >  .../gpu/drm/panel/panel-visionox-rm69299.c    | 304 ++++++++++++++++++
> > >  3 files changed, 313 insertions(+)
> > >  create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > >
> > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > > index d56258b9fcaf..4b6131f5893d 100644
> > > --- a/drivers/gpu/drm/panel/Kconfig
> > > +++ b/drivers/gpu/drm/panel/Kconfig
> > > @@ -444,6 +444,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
> > >         Say Y here if you want to enable support for Truly NT35597 WQXGA Dual DSI
> > >         Video Mode panel
> > >
> > > +config DRM_PANEL_VISIONOX_RM69299
> > > +     tristate "Visionox RM69299"
> > > +     depends on OF
> > > +     depends on DRM_MIPI_DSI
> > > +     help
> > > +       Say Y here if you want to enable support for Visionox
> > > +       RM69299  DSI Video Mode panel.
> > > +
> > >  config DRM_PANEL_XINPENG_XPP055C272
> > >       tristate "Xinpeng XPP055C272 panel driver"
> > >       depends on OF
> > > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > > index 2335a1e32ae0..8eac3e6fa82c 100644
> > > --- a/drivers/gpu/drm/panel/Makefile
> > > +++ b/drivers/gpu/drm/panel/Makefile
> > > @@ -47,4 +47,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
> > >  obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
> > >  obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
> > >  obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
> > > +obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
> > >  obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
> > > diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > > new file mode 100644
> > > index 000000000000..3ef4cc80044a
> > > --- /dev/null
> > > +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > > @@ -0,0 +1,304 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Copyright (c) 2019, The Linux Foundation. All rights reserved.
> > > + */
> > > +
> > > +#include <linux/delay.h>
> > > +#include <linux/module.h>
> > > +#include <linux/of_device.h>
> > > +#include <linux/gpio/consumer.h>
> > > +#include <linux/regulator/consumer.h>
> > > +
> > > +#include <video/mipi_display.h>
> > > +
> > > +#include <drm/drm_mipi_dsi.h>
> > > +#include <drm/drm_modes.h>
> > > +#include <drm/drm_panel.h>
> > > +#include <drm/drm_print.h>
> > > +
> > > +struct visionox_rm69299 {
> > > +     struct drm_panel panel;
> > > +     struct regulator_bulk_data supplies[2];
> > > +     struct gpio_desc *reset_gpio;
> > > +     struct mipi_dsi_device *dsi;
> > > +     bool prepared;
> > > +     bool enabled;
> > > +};
> > > +
> > > +static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
> > > +{
> > > +     return container_of(panel, struct visionox_rm69299, panel);
> > > +}
> > > +
> > > +static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
> > > +{
> > > +     int ret;
> > > +
> > > +     ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
> > > +     if (ret < 0)
> > > +             return ret;
> > > +
> > > +     /*
> > > +      * Reset sequence of visionox panel requires the panel to be
> > > +      * out of reset for 10ms, followed by being held in reset
> > > +      * for 10ms and then out again
> > > +      */
> > > +     gpiod_set_value(ctx->reset_gpio, 1);
> > > +     usleep_range(10000, 20000);
> > > +     gpiod_set_value(ctx->reset_gpio, 0);
> > > +     usleep_range(10000, 20000);
> > > +     gpiod_set_value(ctx->reset_gpio, 1);
> > > +     usleep_range(10000, 20000);
> > > +
> > > +     return 0;
> > > +}
> > > +
> > > +static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
> > > +{
> > > +     gpiod_set_value(ctx->reset_gpio, 0);
> > > +
> > > +     return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
> > > +}
> > > +
> > > +static int visionox_rm69299_unprepare(struct drm_panel *panel)
> > > +{
> > > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > > +     int ret;
> > > +
> > > +     ctx->dsi->mode_flags = 0;
> > > +
> > > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
> > > +     if (ret < 0)
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "set_display_off cmd failed ret = %d\n", ret);
> > > +
> > > +     /* 120ms delay required here as per DCS spec */
> > > +     msleep(120);
> > > +
> > > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "enter_sleep cmd failed ret = %d\n", ret);
> > > +     }
> > > +
> > > +     ret = visionox_rm69299_power_off(ctx);
> > > +
> > > +     ctx->prepared = false;
> > > +     return ret;
> > > +}
> > > +
> > > +static int visionox_rm69299_prepare(struct drm_panel *panel)
> > > +{
> > > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > > +     int ret;
> > > +
> > > +     if (ctx->prepared)
> > > +             return 0;
> > > +
> > > +     ret = visionox_rm69299_power_on(ctx);
> > > +     if (ret < 0)
> > > +             return ret;
> > > +
> > > +     ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> > > +
> > > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0xfe, 0x00 }, 2);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "cmd set tx 0 failed, ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0xc2, 0x08 }, 2);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "cmd set tx 1 failed, ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0x35, 0x00 }, 2);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "cmd set tx 2 failed, ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0x51, 0xff }, 2);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "cmd set tx 3 failed, ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "exit_sleep_mode cmd failed ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     /* Per DSI spec wait 120ms after sending exit sleep DCS command */
> > > +     msleep(120);
> > > +
> > > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "set_display_on cmd failed ret = %d\n", ret);
> > > +             goto power_off;
> > > +     }
> > > +
> > > +     /* Per DSI spec wait 120ms after sending set_display_on DCS command */
> > > +     msleep(120);
> > > +
> > > +     ctx->prepared = true;
> > > +
> > > +     return 0;
> > > +
> > > +power_off:
> > > +     return ret;
> > > +}
> > > +
> > > +static const struct drm_display_mode visionox_rm69299_1080x2248_60hz = {
> > > +     .name = "1080x2248",
> > > +     .clock = 158695,
> > > +     .hdisplay = 1080,
> > > +     .hsync_start = 1080 + 26,
> > > +     .hsync_end = 1080 + 26 + 2,
> > > +     .htotal = 1080 + 26 + 2 + 36,
> > > +     .vdisplay = 2248,
> > > +     .vsync_start = 2248 + 56,
> > > +     .vsync_end = 2248 + 56 + 4,
> > > +     .vtotal = 2248 + 56 + 4 + 4,
> > > +     .vrefresh = 60,
> > > +     .flags = 0,
> > > +};
> > > +
> > > +static int visionox_rm69299_get_modes(struct drm_panel *panel,
> > > +                                   struct drm_connector *connector)
> > > +{
> > > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > > +     struct drm_display_mode *mode;
> > > +
> > > +     mode = drm_mode_create(connector->dev);
> > > +     if (!mode) {
> > > +             DRM_DEV_ERROR(ctx->panel.dev,
> > > +                     "failed to create a new display mode\n");
> > > +             return 0;
> > > +     }
> > > +
> > > +     connector->display_info.width_mm = 74;
> > > +     connector->display_info.height_mm = 131;
> > > +     drm_mode_copy(mode, &visionox_rm69299_1080x2248_60hz);
> > > +     mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> > > +     drm_mode_probed_add(connector, mode);
> > > +
> > > +     return 1;
> > > +}
> > > +
> > > +static const struct drm_panel_funcs visionox_rm69299_drm_funcs = {
> > > +     .unprepare = visionox_rm69299_unprepare,
> > > +     .prepare = visionox_rm69299_prepare,
> > > +     .get_modes = visionox_rm69299_get_modes,
> > > +};
> > > +
> > > +static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
> > > +{
> > > +     struct device *dev = &dsi->dev;
> > > +     struct visionox_rm69299 *ctx;
> > > +     int ret;
> > > +
> > > +     ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> > > +     if (!ctx)
> > > +             return -ENOMEM;
> > > +
> > > +     mipi_dsi_set_drvdata(dsi, ctx);
> > > +
> > > +     ctx->panel.dev = dev;
> > > +     ctx->dsi = dsi;
> > > +
> > > +     ctx->supplies[0].supply = "vdda";
> > > +     ctx->supplies[1].supply = "vdd3p3";
> > > +
> > > +     ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies),
> > > +                                   ctx->supplies);
> > > +     if (ret < 0)
> > > +             return ret;
> > > +
> > > +     ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
> > > +                                     "reset", GPIOD_OUT_LOW);
> > > +     if (IS_ERR(ctx->reset_gpio)) {
> > > +             DRM_DEV_ERROR(dev, "cannot get reset gpio %ld\n",
> > > +                     PTR_ERR(ctx->reset_gpio));
> > > +             return PTR_ERR(ctx->reset_gpio);
> > > +     }
> > > +
> > > +     drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
> > > +                    DRM_MODE_CONNECTOR_DSI);
> > > +     ctx->panel.dev = dev;
> > > +     ctx->panel.funcs = &visionox_rm69299_drm_funcs;
> > > +     drm_panel_add(&ctx->panel);
> > > +
> > > +     dsi->lanes = 4;
> > > +     dsi->format = MIPI_DSI_FMT_RGB888;
> > > +     dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM |
> > > +             MIPI_DSI_CLOCK_NON_CONTINUOUS;
> > > +     ret = mipi_dsi_attach(dsi);
> > > +     if (ret < 0) {
> > > +             DRM_DEV_ERROR(dev, "dsi attach failed ret = %d\n", ret);
> > > +             goto err_dsi_attach;
> > > +     }
> > > +
> > > +     ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
> > > +     if (ret) {
> > > +             DRM_DEV_ERROR(dev,
> > > +                     "regulator set load failed for vdda supply ret = %d\n",
> > > +                     ret);
> > > +             goto err_set_load;
> > > +     }
> > > +
> > > +     ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
> > > +     if (ret) {
> > > +             DRM_DEV_ERROR(dev,
> > > +                     "regulator set load failed for vdd3p3 supply ret = %d\n",
> > > +                     ret);
> > > +             goto err_set_load;
> > > +     }
> > > +
> > > +     return 0;
> > > +
> > > +err_set_load:
> > > +     mipi_dsi_detach(dsi);
> > > +err_dsi_attach:
> > > +     drm_panel_remove(&ctx->panel);
> > > +     return ret;
> > > +}
> > > +
> > > +static int visionox_rm69299_remove(struct mipi_dsi_device *dsi)
> > > +{
> > > +     struct visionox_rm69299 *ctx = mipi_dsi_get_drvdata(dsi);
> > > +
> > > +     mipi_dsi_detach(ctx->dsi);
> > > +     mipi_dsi_device_unregister(ctx->dsi);
> > > +
> > > +     drm_panel_remove(&ctx->panel);
> > > +     return 0;
> > > +}
> > > +
> > > +static const struct of_device_id visionox_rm69299_of_match[] = {
> > > +     {
> > > +             .compatible = "visionox,rm69299-1080p-display",
> > > +     }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, visionox_rm69299_of_match);
> > > +
> > > +static struct mipi_dsi_driver visionox_rm69299_driver = {
> > > +     .driver = {
> > > +             .name = "panel-visionox-rm69299",
> > > +             .of_match_table = visionox_rm69299_of_match,
> > > +     },
> > > +     .probe = visionox_rm69299_probe,
> > > +     .remove = visionox_rm69299_remove,
> > > +};
> > > +module_mipi_dsi_driver(visionox_rm69299_driver);
> > > +
> > > +MODULE_DESCRIPTION("Visionox RM69299 DSI Panel Driver");
> > > +
> > > --
> > > 2.25.1
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [PATCH v11 1/2] drm/panel: add support for rm69299 visionox panel driver
From: Dave Airlie @ 2020-05-14  3:35 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Harigovindan P, freedreno, devicetree, linux-arm-msm, dri-devel,
	Matthias Kaehlcke, Sean Paul, Sean Paul
In-Reply-To: <20200506185703.GB8227@ravnborg.org>

On Thu, 7 May 2020 at 04:57, Sam Ravnborg <sam@ravnborg.org> wrote:
>
> Hi Harigovindan
>
> On Wed, Apr 29, 2020 at 11:15:14AM +0530, Harigovindan P wrote:
> > Add support for Visionox panel driver.
> >
> > Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
> > Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
>
> Thanks for your persistence on this.
> Patch applied.
>
> I fixed a few lingering --strict releated checkpatch warnings
> when I applied.
>
>         Sam

I'm seeing

WARNING: modpost: missing MODULE_LICENSE() in
drivers/gpu/drm/panel/panel-visionox-rm69299.o

Can we fix that up?

Dave.

>
> > ---
> >
> > Changes in v2:
> >       - Dropping redundant space in Kconfig(Sam Ravnborg).
> >       - Changing structure for include files(Sam Ravnborg).
> >       - Removing backlight related code and functions(Sam Ravnborg).
> >       - Removing repeated printing of error message(Sam Ravnborg).
> >       - Adding drm_connector as an argument for get_modes function.
> > Changes in v3:
> >       - Adding arguments for drm_panel_init to support against mainline.
> > Changes in v4:
> >       - Removing error messages from regulator_set_load.
> >       - Removing dev struct entry.
> >       - Removing checks.
> >       - Dropping empty comment lines.
> > Changes in v5:
> >       - Removing unused struct member variables.
> >       - Removing blank lines.
> >       - Fixed indentation.
> >       - Invoking dsi_detach and panel_remove while early exiting from probe.
> > Changes in v6:
> >       - Changed "35597" to "rm69299" for power_on function.
> >       - Removing rm69299_config since it supports single type of panel for now.
> >       - Fixed alignment.
> >       - Using goto statements when regulator_set_load fails.
> > Changes in v7:
> >       - Added new goto statement when regulator_set_load fails.
> > Changes in v8,v9,v10:
> >       - Had changes in first patch, did not make any change in panel driver.
> > Changes in v11:
> >       - Fixing checkpatch script errors.
> >       - Updated assignment of panel.dev property in  probe.
> >
> >  drivers/gpu/drm/panel/Kconfig                 |   8 +
> >  drivers/gpu/drm/panel/Makefile                |   1 +
> >  .../gpu/drm/panel/panel-visionox-rm69299.c    | 304 ++++++++++++++++++
> >  3 files changed, 313 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c
> >
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index d56258b9fcaf..4b6131f5893d 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -444,6 +444,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
> >         Say Y here if you want to enable support for Truly NT35597 WQXGA Dual DSI
> >         Video Mode panel
> >
> > +config DRM_PANEL_VISIONOX_RM69299
> > +     tristate "Visionox RM69299"
> > +     depends on OF
> > +     depends on DRM_MIPI_DSI
> > +     help
> > +       Say Y here if you want to enable support for Visionox
> > +       RM69299  DSI Video Mode panel.
> > +
> >  config DRM_PANEL_XINPENG_XPP055C272
> >       tristate "Xinpeng XPP055C272 panel driver"
> >       depends on OF
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index 2335a1e32ae0..8eac3e6fa82c 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -47,4 +47,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
> >  obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
> >  obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
> >  obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
> > +obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
> >  obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
> > diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > new file mode 100644
> > index 000000000000..3ef4cc80044a
> > --- /dev/null
> > +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > @@ -0,0 +1,304 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (c) 2019, The Linux Foundation. All rights reserved.
> > + */
> > +
> > +#include <linux/delay.h>
> > +#include <linux/module.h>
> > +#include <linux/of_device.h>
> > +#include <linux/gpio/consumer.h>
> > +#include <linux/regulator/consumer.h>
> > +
> > +#include <video/mipi_display.h>
> > +
> > +#include <drm/drm_mipi_dsi.h>
> > +#include <drm/drm_modes.h>
> > +#include <drm/drm_panel.h>
> > +#include <drm/drm_print.h>
> > +
> > +struct visionox_rm69299 {
> > +     struct drm_panel panel;
> > +     struct regulator_bulk_data supplies[2];
> > +     struct gpio_desc *reset_gpio;
> > +     struct mipi_dsi_device *dsi;
> > +     bool prepared;
> > +     bool enabled;
> > +};
> > +
> > +static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
> > +{
> > +     return container_of(panel, struct visionox_rm69299, panel);
> > +}
> > +
> > +static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
> > +{
> > +     int ret;
> > +
> > +     ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     /*
> > +      * Reset sequence of visionox panel requires the panel to be
> > +      * out of reset for 10ms, followed by being held in reset
> > +      * for 10ms and then out again
> > +      */
> > +     gpiod_set_value(ctx->reset_gpio, 1);
> > +     usleep_range(10000, 20000);
> > +     gpiod_set_value(ctx->reset_gpio, 0);
> > +     usleep_range(10000, 20000);
> > +     gpiod_set_value(ctx->reset_gpio, 1);
> > +     usleep_range(10000, 20000);
> > +
> > +     return 0;
> > +}
> > +
> > +static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
> > +{
> > +     gpiod_set_value(ctx->reset_gpio, 0);
> > +
> > +     return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
> > +}
> > +
> > +static int visionox_rm69299_unprepare(struct drm_panel *panel)
> > +{
> > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > +     int ret;
> > +
> > +     ctx->dsi->mode_flags = 0;
> > +
> > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
> > +     if (ret < 0)
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "set_display_off cmd failed ret = %d\n", ret);
> > +
> > +     /* 120ms delay required here as per DCS spec */
> > +     msleep(120);
> > +
> > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "enter_sleep cmd failed ret = %d\n", ret);
> > +     }
> > +
> > +     ret = visionox_rm69299_power_off(ctx);
> > +
> > +     ctx->prepared = false;
> > +     return ret;
> > +}
> > +
> > +static int visionox_rm69299_prepare(struct drm_panel *panel)
> > +{
> > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > +     int ret;
> > +
> > +     if (ctx->prepared)
> > +             return 0;
> > +
> > +     ret = visionox_rm69299_power_on(ctx);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> > +
> > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0xfe, 0x00 }, 2);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "cmd set tx 0 failed, ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0xc2, 0x08 }, 2);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "cmd set tx 1 failed, ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0x35, 0x00 }, 2);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "cmd set tx 2 failed, ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0x51, 0xff }, 2);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "cmd set tx 3 failed, ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "exit_sleep_mode cmd failed ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     /* Per DSI spec wait 120ms after sending exit sleep DCS command */
> > +     msleep(120);
> > +
> > +     ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "set_display_on cmd failed ret = %d\n", ret);
> > +             goto power_off;
> > +     }
> > +
> > +     /* Per DSI spec wait 120ms after sending set_display_on DCS command */
> > +     msleep(120);
> > +
> > +     ctx->prepared = true;
> > +
> > +     return 0;
> > +
> > +power_off:
> > +     return ret;
> > +}
> > +
> > +static const struct drm_display_mode visionox_rm69299_1080x2248_60hz = {
> > +     .name = "1080x2248",
> > +     .clock = 158695,
> > +     .hdisplay = 1080,
> > +     .hsync_start = 1080 + 26,
> > +     .hsync_end = 1080 + 26 + 2,
> > +     .htotal = 1080 + 26 + 2 + 36,
> > +     .vdisplay = 2248,
> > +     .vsync_start = 2248 + 56,
> > +     .vsync_end = 2248 + 56 + 4,
> > +     .vtotal = 2248 + 56 + 4 + 4,
> > +     .vrefresh = 60,
> > +     .flags = 0,
> > +};
> > +
> > +static int visionox_rm69299_get_modes(struct drm_panel *panel,
> > +                                   struct drm_connector *connector)
> > +{
> > +     struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> > +     struct drm_display_mode *mode;
> > +
> > +     mode = drm_mode_create(connector->dev);
> > +     if (!mode) {
> > +             DRM_DEV_ERROR(ctx->panel.dev,
> > +                     "failed to create a new display mode\n");
> > +             return 0;
> > +     }
> > +
> > +     connector->display_info.width_mm = 74;
> > +     connector->display_info.height_mm = 131;
> > +     drm_mode_copy(mode, &visionox_rm69299_1080x2248_60hz);
> > +     mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> > +     drm_mode_probed_add(connector, mode);
> > +
> > +     return 1;
> > +}
> > +
> > +static const struct drm_panel_funcs visionox_rm69299_drm_funcs = {
> > +     .unprepare = visionox_rm69299_unprepare,
> > +     .prepare = visionox_rm69299_prepare,
> > +     .get_modes = visionox_rm69299_get_modes,
> > +};
> > +
> > +static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
> > +{
> > +     struct device *dev = &dsi->dev;
> > +     struct visionox_rm69299 *ctx;
> > +     int ret;
> > +
> > +     ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> > +     if (!ctx)
> > +             return -ENOMEM;
> > +
> > +     mipi_dsi_set_drvdata(dsi, ctx);
> > +
> > +     ctx->panel.dev = dev;
> > +     ctx->dsi = dsi;
> > +
> > +     ctx->supplies[0].supply = "vdda";
> > +     ctx->supplies[1].supply = "vdd3p3";
> > +
> > +     ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies),
> > +                                   ctx->supplies);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
> > +                                     "reset", GPIOD_OUT_LOW);
> > +     if (IS_ERR(ctx->reset_gpio)) {
> > +             DRM_DEV_ERROR(dev, "cannot get reset gpio %ld\n",
> > +                     PTR_ERR(ctx->reset_gpio));
> > +             return PTR_ERR(ctx->reset_gpio);
> > +     }
> > +
> > +     drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
> > +                    DRM_MODE_CONNECTOR_DSI);
> > +     ctx->panel.dev = dev;
> > +     ctx->panel.funcs = &visionox_rm69299_drm_funcs;
> > +     drm_panel_add(&ctx->panel);
> > +
> > +     dsi->lanes = 4;
> > +     dsi->format = MIPI_DSI_FMT_RGB888;
> > +     dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM |
> > +             MIPI_DSI_CLOCK_NON_CONTINUOUS;
> > +     ret = mipi_dsi_attach(dsi);
> > +     if (ret < 0) {
> > +             DRM_DEV_ERROR(dev, "dsi attach failed ret = %d\n", ret);
> > +             goto err_dsi_attach;
> > +     }
> > +
> > +     ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
> > +     if (ret) {
> > +             DRM_DEV_ERROR(dev,
> > +                     "regulator set load failed for vdda supply ret = %d\n",
> > +                     ret);
> > +             goto err_set_load;
> > +     }
> > +
> > +     ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
> > +     if (ret) {
> > +             DRM_DEV_ERROR(dev,
> > +                     "regulator set load failed for vdd3p3 supply ret = %d\n",
> > +                     ret);
> > +             goto err_set_load;
> > +     }
> > +
> > +     return 0;
> > +
> > +err_set_load:
> > +     mipi_dsi_detach(dsi);
> > +err_dsi_attach:
> > +     drm_panel_remove(&ctx->panel);
> > +     return ret;
> > +}
> > +
> > +static int visionox_rm69299_remove(struct mipi_dsi_device *dsi)
> > +{
> > +     struct visionox_rm69299 *ctx = mipi_dsi_get_drvdata(dsi);
> > +
> > +     mipi_dsi_detach(ctx->dsi);
> > +     mipi_dsi_device_unregister(ctx->dsi);
> > +
> > +     drm_panel_remove(&ctx->panel);
> > +     return 0;
> > +}
> > +
> > +static const struct of_device_id visionox_rm69299_of_match[] = {
> > +     {
> > +             .compatible = "visionox,rm69299-1080p-display",
> > +     }
> > +};
> > +MODULE_DEVICE_TABLE(of, visionox_rm69299_of_match);
> > +
> > +static struct mipi_dsi_driver visionox_rm69299_driver = {
> > +     .driver = {
> > +             .name = "panel-visionox-rm69299",
> > +             .of_match_table = visionox_rm69299_of_match,
> > +     },
> > +     .probe = visionox_rm69299_probe,
> > +     .remove = visionox_rm69299_remove,
> > +};
> > +module_mipi_dsi_driver(visionox_rm69299_driver);
> > +
> > +MODULE_DESCRIPTION("Visionox RM69299 DSI Panel Driver");
> > +
> > --
> > 2.25.1
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [PATCH V6 0/3] Convert QUP bindings to YAML and add ICC, pin swap doc
From: Stephen Boyd @ 2020-05-14  2:03 UTC (permalink / raw)
  To: Akash Asthana, gregkh, robh+dt
  Cc: linux-arm-msm, devicetree, linux-kernel, mgautam, rojay, skakit,
	mka, Akash Asthana
In-Reply-To: <1588863647-17240-1-git-send-email-akashast@codeaurora.org>

Quoting Akash Asthana (2020-05-07 08:00:44)
> Changes in V6:
>  - As per Rob's suggestion moved pin swap documentation from QUP to
>    serial.yaml file[PATCH V6 3/3].
> 
> Changes in V4:
>  - Add interconnect binding patch.
>  - Add UART pin swap binding patch.
> 
> Akash Asthana (3):
>   dt-bindings: geni-se: Convert QUP geni-se bindings to YAML
>   dt-bindings: geni-se: Add interconnect binding for GENI QUP
>   dt-bindings: serial: Add binding for UART pin swap
> 

Who do you intend to pick up these patches? Rob or Greg? I suppose if
it's all in bindings then maybe Rob can pick them up.

^ permalink raw reply

* Re: [PATCH v2 6/6] dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml
From: Laurent Pinchart @ 2020-05-14  1:54 UTC (permalink / raw)
  To: Ricardo Cañuelo
  Cc: kernel, devicetree, linux-arm-kernel, geert+renesas, robh+dt,
	xuwei5
In-Reply-To: <20200511110611.3142-7-ricardo.canuelo@collabora.com>

Hi Ricardo,

Thank you for the patch.

On Mon, May 11, 2020 at 01:06:11PM +0200, Ricardo Cañuelo wrote:
> Convert the ADV7511/11w/13/33/35 DT bindings to json-schema. The
> original binding has been split into two files: adi,adv7511.yaml for
> ADV7511/11W/13 and adi,adv7533.yaml for ADV7533/35.
> 
> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
> ---
>  .../bindings/display/bridge/adi,adv7511.txt   | 143 -----------
>  .../bindings/display/bridge/adi,adv7511.yaml  | 230 ++++++++++++++++++
>  .../bindings/display/bridge/adi,adv7533.yaml  | 166 +++++++++++++
>  3 files changed, 396 insertions(+), 143 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
>  create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml
>  create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt b/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
> deleted file mode 100644
> index 659523f538bf..000000000000
> --- a/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
> +++ /dev/null
> @@ -1,143 +0,0 @@
> -Analog Devices ADV7511(W)/13/33/35 HDMI Encoders
> -------------------------------------------------
> -
> -The ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535 are HDMI audio and video
> -transmitters compatible with HDMI 1.4 and DVI 1.0. They support color space
> -conversion, S/PDIF, CEC and HDCP. ADV7533/5 supports the DSI interface for input
> -pixels, while the others support RGB interface.
> -
> -Required properties:
> -
> -- compatible: Should be one of:
> -		"adi,adv7511"
> -		"adi,adv7511w"
> -		"adi,adv7513"
> -		"adi,adv7533"
> -		"adi,adv7535"
> -
> -- reg: I2C slave addresses
> -  The ADV7511 internal registers are split into four pages exposed through
> -  different I2C addresses, creating four register maps. Each map has it own
> -  I2C address and acts as a standard slave device on the I2C bus. The main
> -  address is mandatory, others are optional and revert to defaults if not
> -  specified.
> -
> -
> -The ADV7511 supports a large number of input data formats that differ by their
> -color depth, color format, clock mode, bit justification and random
> -arrangement of components on the data bus. The combination of the following
> -properties describe the input and map directly to the video input tables of the
> -ADV7511 datasheet that document all the supported combinations.
> -
> -- adi,input-depth: Number of bits per color component at the input (8, 10 or
> -  12).
> -- adi,input-colorspace: The input color space, one of "rgb", "yuv422" or
> -  "yuv444".
> -- adi,input-clock: The input clock type, one of "1x" (one clock cycle per
> -  pixel), "2x" (two clock cycles per pixel), "ddr" (one clock cycle per pixel,
> -  data driven on both edges).
> -
> -The following input format properties are required except in "rgb 1x" and
> -"yuv444 1x" modes, in which case they must not be specified.
> -
> -- adi,input-style: The input components arrangement variant (1, 2 or 3), as
> -  listed in the input format tables in the datasheet.
> -- adi,input-justification: The input bit justification ("left", "evenly",
> -  "right").
> -
> -- avdd-supply: A 1.8V supply that powers up the AVDD pin on the chip.
> -- dvdd-supply: A 1.8V supply that powers up the DVDD pin on the chip.
> -- pvdd-supply: A 1.8V supply that powers up the PVDD pin on the chip.
> -- dvdd-3v-supply: A 3.3V supply that powers up the pin called DVDD_3V
> -  on the chip.
> -- bgvdd-supply: A 1.8V supply that powers up the BGVDD pin. This is
> -  needed only for ADV7511.
> -
> -The following properties are required for ADV7533 and ADV7535:
> -
> -- adi,dsi-lanes: Number of DSI data lanes connected to the DSI host. It should
> -  be one of 1, 2, 3 or 4.
> -- a2vdd-supply: 1.8V supply that powers up the A2VDD pin on the chip.
> -- v3p3-supply: A 3.3V supply that powers up the V3P3 pin on the chip.
> -- v1p2-supply: A supply that powers up the V1P2 pin on the chip. It can be
> -  either 1.2V or 1.8V for ADV7533 but only 1.8V for ADV7535.
> -
> -Optional properties:
> -
> -- interrupts: Specifier for the ADV7511 interrupt
> -- pd-gpios: Specifier for the GPIO connected to the power down signal
> -
> -- adi,clock-delay: Video data clock delay relative to the pixel clock, in ps
> -  (-1200 ps .. 1600 ps). Defaults to no delay.
> -- adi,embedded-sync: The input uses synchronization signals embedded in the
> -  data stream (similar to BT.656). Defaults to separate H/V synchronization
> -  signals.
> -- adi,disable-timing-generator: Only for ADV7533 and ADV7535. Disables the
> -  internal timing generator. The chip will rely on the sync signals in the
> -  DSI data lanes, rather than generate its own timings for HDMI output.
> -- clocks: from common clock binding: reference to the CEC clock.
> -- clock-names: from common clock binding: must be "cec".
> -- reg-names : Names of maps with programmable addresses.
> -	It can contain any map needing a non-default address.
> -	Possible maps names are : "main", "edid", "cec", "packet"
> -
> -Required nodes:
> -
> -The ADV7511 has two video ports. Their connections are modelled using the OF
> -graph bindings specified in Documentation/devicetree/bindings/graph.txt.
> -
> -- Video port 0 for the RGB, YUV or DSI input. In the case of ADV7533/5, the
> -  remote endpoint phandle should be a reference to a valid mipi_dsi_host device
> -  node.
> -- Video port 1 for the HDMI output
> -- Audio port 2 for the HDMI audio input
> -
> -
> -Example
> --------
> -
> -	adv7511w: hdmi@39 {
> -		compatible = "adi,adv7511w";
> -		/*
> -		 * The EDID page will be accessible on address 0x66 on the I2C
> -		 * bus. All other maps continue to use their default addresses.
> -		 */
> -		reg = <0x39>, <0x66>;
> -		reg-names = "main", "edid";
> -		interrupt-parent = <&gpio3>;
> -		interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
> -		clocks = <&cec_clock>;
> -		clock-names = "cec";
> -
> -		adi,input-depth = <8>;
> -		adi,input-colorspace = "rgb";
> -		adi,input-clock = "1x";
> -		adi,input-style = <1>;
> -		adi,input-justification = "evenly";
> -
> -		ports {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -
> -			port@0 {
> -				reg = <0>;
> -				adv7511w_in: endpoint {
> -					remote-endpoint = <&dpi_out>;
> -				};
> -			};
> -
> -			port@1 {
> -				reg = <1>;
> -				adv7511_out: endpoint {
> -					remote-endpoint = <&hdmi_connector_in>;
> -				};
> -			};
> -
> -			port@2 {
> -				reg = <2>;
> -				codec_endpoint: endpoint {
> -					remote-endpoint = <&i2s0_cpu_endpoint>;
> -				};
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml b/Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml
> new file mode 100644
> index 000000000000..a306adba105f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml
> @@ -0,0 +1,233 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/bridge/adi,adv7511.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADV7511/11W/13 HDMI Encoders
> +
> +maintainers:
> +  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +
> +description: |
> +  The ADV7511, ADV7511W and ADV7513 are HDMI audio and video
> +  transmitters compatible with HDMI 1.4 and DVI 1.0. They support color
> +  space conversion, S/PDIF, CEC and HDCP. They support RGB input
> +  interface.

I would write the last sentence as "The transmitter input is parallel
RGB or YUV data." as YUV is also supported.

> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,adv7511
> +      - adi,adv7511w
> +      - adi,adv7513
> +
> +  reg:
> +    description: |
> +      I2C slave addresses.
> +
> +      The ADV7511/11W/13 internal registers are split into four pages
> +      exposed through different I2C addresses, creating four register
> +      maps. Each map has it own I2C address and acts as a standard slave
> +      device on the I2C bus. The main address is mandatory, others are
> +      optional and revert to defaults if not specified.
> +    minItems: 1
> +    maxItems: 4
> +
> +  reg-names:
> +    description:
> +      Names of maps with programmable addresses. It can contain any map
> +      needing a non-default address.
> +    minItems: 1
> +    items:
> +      - const: main
> +      - const: edid
> +      - const: cec
> +      - const: packet
> +
> +  clocks:
> +    description: Reference to the CEC clock.
> +    maxItems: 1
> +
> +  clock-names:
> +    const: cec
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  pd-gpios:
> +    description: GPIO connected to the power down signal.
> +    maxItems: 1
> +
> +  avdd-supply:
> +    description: A 1.8V supply that powers up the AVDD pin.
> +
> +  dvdd-supply:
> +    description: A 1.8V supply that powers up the DVDD pin.
> +
> +  pvdd-supply:
> +    description: A 1.8V supply that powers up the PVDD pin.
> +
> +  dvdd-3v-supply:
> +    description: A 3.3V supply that powers up the DVDD_3V pin.
> +
> +  bgvdd-supply:
> +    description: A 1.8V supply that powers up the BGVDD pin.
> +
> +  adi,input-depth:
> +    description: Number of bits per color component at the input.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [ 8, 10, 12 ]
> +
> +  adi,input-colorspace:
> +    description: Input color space.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/string
> +      - enum: [ rgb, yuv422, yuv444 ]

Isn't string implied ? Can't you write

  adi,input-colorspace:
    description: Input color space.
    enum: [ rgb, yuv422, yuv444 ]

Same for the other properties below.

> +
> +  adi,input-clock:
> +    description: |
> +      Input clock type.
> +        "1x": one clock cycle per pixel
> +        "2x": two clock cycles per pixel
> +        "dd": one clock cycle per pixel, data driven on both edges
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/string
> +      - enum: [ 1x, 2x, dd ]
> +
> +  adi,clock-delay:
> +    description:
> +      Video data clock delay relative to the pixel clock, in ps
> +      (-1200ps .. 1600 ps).
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - default: 0
> +
> +  adi,embedded-sync:
> +    description:
> +      The input uses synchronization signals embedded in the data
> +      stream (similar to BT.656). Defaults to 0 (separate H/V
> +      synchronization signals).
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [ 0, 1 ]
> +      - default: 0

This be a boolean property (it is read as a bool by the driver, the
property being absent means false, the property being present means
true).

> +
> +  adi,input-style:
> +    description:
> +      Input components arrangement variant as listed in the input
> +      format tables in the datasheet.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [ 1, 2, 3 ]
> +
> +  adi,input-justification:
> +    description: Input bit justification.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/string
> +      - enum: [ left, evenly, right ]
> +
> +  ports:
> +    description:
> +      The ADV7511(W)/13 has two video ports and one audio port. This node
> +      models their connections as documented in
> +      Documentation/devicetree/bindings/media/video-interfaces.txt
> +      Documentation/devicetree/bindings/graph.txt
> +    type: object
> +    properties:
> +      port@0:
> +        description: Video port for the RGB, YUV or DSI input.

s/RGB, YUV or DSI/RGB or YUV/

> +        type: object
> +
> +      port@1:
> +        description: Video port for the HDMI output.
> +        type: object
> +
> +      port@2:
> +        description: Audio port for the HDMI output.
> +        type: object
> +
> +# adi,input-colorspace and adi,input-clock are required except in
> +# "rgb 1x" and "yuv444 1x" modes, in which case they must not be
> +# specified.
> +if:
> +  not:
> +    properties:
> +      adi,input-colorspace:
> +        contains:
> +          enum: [ rgb, yuv444 ]
> +      adi,input-clock:
> +        contains:
> +          const: 1x

As both properties take a single value, I think you can omit
"contains:".

> +
> +then:
> +  required:
> +    - adi,input-style
> +    - adi,input-justification
> +
> +else:
> +  properties:
> +    adi,input-style: false
> +    adi,input-justification: false
> +
> +
> +required:
> +  - compatible
> +  - reg
> +  - ports
> +  - adi,input-depth
> +  - adi,input-colorspace
> +  - adi,input-clock

Shouldn't the power supplies be required ?

> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    adv7511w: hdmi@39 {
> +        compatible = "adi,adv7511w";
> +        /*
> +         * The EDID page will be accessible on address 0x66 on the I2C
> +         * bus. All other maps continue to use their default addresses.
> +         */
> +        reg = <0x39>, <0x66>;
> +        reg-names = "main", "edid";
> +        interrupt-parent = <&gpio3>;
> +        interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
> +        clocks = <&cec_clock>;
> +        clock-names = "cec";
> +
> +        adi,input-depth = <8>;
> +        adi,input-colorspace = "yuv422";
> +        adi,input-clock = "1x";
> +
> +        adi,input-style = <3>;
> +        adi,input-justification = "right";
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            port@0 {
> +                reg = <0>;
> +                adv7511w_in: endpoint {
> +                    remote-endpoint = <&dpi_out>;
> +                };
> +            };
> +
> +            port@1 {
> +                reg = <1>;
> +                adv7511_out: endpoint {
> +                    remote-endpoint = <&hdmi_connector_in>;
> +                };
> +            };
> +
> +            port@2 {
> +                reg = <2>;
> +                codec_endpoint: endpoint {
> +                    remote-endpoint = <&i2s0_cpu_endpoint>;
> +                };
> +            };
> +        };
> +    };
> +
> +...
> diff --git a/Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml b/Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
> new file mode 100644
> index 000000000000..dfcc63dfc5c5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
> @@ -0,0 +1,166 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/bridge/adi,adv7533.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADV7533/35 HDMI Encoders
> +
> +maintainers:
> +  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +
> +description: |
> +  The ADV7533 and ADV7535 are HDMI audio and video transmitters
> +  compatible with HDMI 1.4 and DVI 1.0. They support color space
> +  conversion, S/PDIF, CEC and HDCP. They support DSI for input pixels.

I would write the last sentence as "The transmitter input is MIPI DSI.".

> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,adv7533
> +      - adi,adv7535
> +
> +  reg:
> +    description: |
> +      I2C slave addresses.
> +
> +      The ADV7533/35 internal registers are split into four pages
> +      exposed through different I2C addresses, creating four register
> +      maps. Each map has it own I2C address and acts as a standard slave
> +      device on the I2C bus. The main address is mandatory, others are
> +      optional and revert to defaults if not specified.
> +    minItems: 1
> +    maxItems: 4
> +
> +  reg-names:
> +    description:
> +      Names of maps with programmable addresses. It can contain any map
> +      needing a non-default address.
> +    minItems: 1
> +    items:
> +      - const: main
> +      - const: edid
> +      - const: cec
> +      - const: packet
> +
> +  clocks:
> +    description: Reference to the CEC clock.
> +    maxItems: 1
> +
> +  clock-names:
> +    const: cec
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  pd-gpios:
> +    description: GPIO connected to the power down signal.
> +    maxItems: 1
> +
> +  avdd-supply:
> +    description: A 1.8V supply that powers up the AVDD pin.
> +
> +  dvdd-supply:
> +    description: A 1.8V supply that powers up the DVDD pin.
> +
> +  pvdd-supply:
> +    description: A 1.8V supply that powers up the PVDD pin.
> +
> +  a2vdd-supply:
> +    description: A 1.8V supply that powers up the A2VDD pin.
> +
> +  v3p3-supply:
> +    description: A 3.3V supply that powers up the V3P3 pin.
> +
> +  v1p2-supply:
> +    description:
> +      A supply that powers up the V1P2 pin. It can be either 1.2V
> +      or 1.8V for ADV7533 but only 1.8V for ADV7535.
> +
> +  adi,disable-timing-generator:
> +    description:
> +      Disables the interal timing generator. The chip will rely on the

s/interal/internal/

> +      sync signals in the DSI data lanes, rather than generate its own

s/generate/generating/

> +      timings for HDMI output.
> +    type: boolean
> +
> +  adi,dsi-lanes:
> +    description: Number of DSI data lanes connected to the DSI host.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [ 1, 2, 3, 4 ]
> +
> +  ports:
> +    description:
> +      The ADV7533/35 has two video ports and one audio port. This node
> +      models their connections as documented in
> +      Documentation/devicetree/bindings/media/video-interfaces.txt
> +      Documentation/devicetree/bindings/graph.txt
> +    type: object
> +    properties:
> +      port@0:
> +        description:
> +          Video port for the RGB, YUV or DSI input. The remote endpoint

s/RGB, YUV or //

> +          phandle should be a reference to a valid mipi_dsi_host_device.
> +        type: object
> +
> +      port@1:
> +        description: Video port for the HDMI output.
> +        type: object
> +
> +      port@2:
> +        description: Audio port for the HDMI output.
> +        type: object
> +
> +required:
> +  - compatible
> +  - reg
> +  - ports
> +  - adi,dsi-lanes

Shouldn't the power supplies be required ?

> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    adv7533: hdmi@39 {
> +        compatible = "adi,adv7533";
> +        /*
> +         * The EDID page will be accessible on address 0x66 on the I2C
> +         * bus. All other maps continue to use their default addresses.
> +         */
> +        reg = <0x39>, <0x66>;
> +        reg-names = "main", "edid";
> +        interrupt-parent = <&gpio3>;
> +        interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
> +        clocks = <&cec_clock>;
> +        clock-names = "cec";
> +        adi,dsi-lanes = <4>;
> +
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            port@0 {
> +                reg = <0>;
> +                adv7511w_in: endpoint {
> +                    remote-endpoint = <&dpi_out>;
> +                };
> +            };
> +
> +            port@1 {
> +                reg = <1>;
> +                adv7511_out: endpoint {
> +                    remote-endpoint = <&hdmi_connector_in>;
> +                };
> +            };

The name of the two endpoints doesn't match the adv7533. The remote
endpoint phandle for port 0 should have dsi in its name.

> +
> +            port@2 {
> +                reg = <2>;
> +                codec_endpoint: endpoint {
> +                    remote-endpoint = <&i2s0_cpu_endpoint>;
> +                };
> +            };
> +        };
> +    };
> +
> +...

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH V6 3/3] dt-bindings: serial: Add binding for UART pin swap
From: Stephen Boyd @ 2020-05-14  1:51 UTC (permalink / raw)
  To: Akash Asthana, gregkh, robh+dt
  Cc: linux-arm-msm, devicetree, linux-kernel, mgautam, rojay, skakit,
	mka, Akash Asthana
In-Reply-To: <1588863647-17240-4-git-send-email-akashast@codeaurora.org>

Quoting Akash Asthana (2020-05-07 08:00:47)
> Add documentation to support RX-TX & CTS-RTS GPIO pin swap in HW.
> 
> Signed-off-by: Akash Asthana <akashast@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply

* Re: [PATCH V6 2/3] dt-bindings: geni-se: Add interconnect binding for GENI QUP
From: Stephen Boyd @ 2020-05-14  1:50 UTC (permalink / raw)
  To: Akash Asthana, gregkh, robh+dt
  Cc: linux-arm-msm, devicetree, linux-kernel, mgautam, rojay, skakit,
	mka, Akash Asthana
In-Reply-To: <1588863647-17240-3-git-send-email-akashast@codeaurora.org>

Quoting Akash Asthana (2020-05-07 08:00:46)
> Add documentation for the interconnect and interconnect-names properties
> for the GENI QUP.
> 
> Signed-off-by: Akash Asthana <akashast@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply

* RE: [PATCH v7 RESEND 13/13] dmaengine: imx-sdma: add uart rom script
From: Robin Gong @ 2020-05-14  1:45 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Sascha Hauer, Vinod, Shawn Guo, Uwe Kleine-König,
	Rob Herring, Dan Williams, Mark Rutland, Catalin Marinas,
	Will Deacon, Lucas Stach, Martin Fuzzey, Sascha Hauer, linux-spi,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel, dl-linux-imx, dmaengine@vger.kernel.org,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
In-Reply-To: <CAOMZO5BB-bnKF6fQtw+1iGmojrmNHVQqeN3Fu8tHa_09ayjCgg@mail.gmail.com>

On 2020/05/14 5:07 Fabio Estevam <festevam@gmail.com> wrote: 
> Hi Robin,
> 
> On Mon, May 11, 2020 at 6:33 AM Robin Gong <yibin.gong@nxp.com> wrote:
> 
> > Please get latest sdma firmware from the below and put them into the
> > path
> > (/lib/firmware/imx/sdma/):
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.
> >
> kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ffirmware%2Flinux-firm
> w
> >
> are.git&amp;data=02%7C01%7Cyibin.gong%40nxp.com%7Cc38e0fc1fdc44557a
> f8e
> >
> 08d7f7815cac%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C637250
> 007291
> >
> 672980&amp;sdata=CnABtiTICTIf4ZQQ%2F8x9qP6HD9lDbRE%2BwXqcRhmKcd
> 0%3D&am
> > p;reserved=0
> > /tree/imx/sdma
> 
> "latest sdma firmware" is too vague. Better specify the commit ID of the
> firmware where this is valid.
Okay, will add it in v8.

^ permalink raw reply

* Re: [PATCH 3/3] usb: dwc3: keystone: Turn on USB3 PHY before controller
From: Chunfeng Yun @ 2020-05-14  1:37 UTC (permalink / raw)
  To: Roger Quadros
  Cc: balbi, robh+dt, vigneshr, linux-usb, devicetree, linux-kernel
In-Reply-To: <20200513130709.10239-4-rogerq@ti.com>

On Wed, 2020-05-13 at 16:07 +0300, Roger Quadros wrote:
> The Local Power Sleep Controller (LPSC) dependency on AM65
> requires SERDES0 to be powered on before USB.
> 
> We need to power up SERDES0 power domain and hold it on
> throughout the reset, init, power on sequence.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/usb/dwc3/dwc3-keystone.c | 47 +++++++++++++++++++++++++++++++-
>  1 file changed, 46 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
> index 1e14a6f4884b..46d46f3507fc 100644
> --- a/drivers/usb/dwc3/dwc3-keystone.c
> +++ b/drivers/usb/dwc3/dwc3-keystone.c
> @@ -14,6 +14,7 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/io.h>
>  #include <linux/of_platform.h>
> +#include <linux/phy/phy.h>
>  #include <linux/pm_runtime.h>
>  
>  /* USBSS register offsets */
> @@ -34,6 +35,7 @@
>  struct dwc3_keystone {
>  	struct device			*dev;
>  	void __iomem			*usbss;
> +	struct phy			*usb3_phy;
>  };
>  
>  static inline u32 kdwc3_readl(void __iomem *base, u32 offset)
> @@ -95,8 +97,44 @@ static int kdwc3_probe(struct platform_device *pdev)
>  	if (IS_ERR(kdwc->usbss))
>  		return PTR_ERR(kdwc->usbss);
>  
> -	pm_runtime_enable(kdwc->dev);
> +	/* PSC dependency on AM65 needs SERDES0 to be powered before USB0 */
> +	kdwc->usb3_phy = devm_phy_get(dev, "usb3-phy");
Use devm_phy_optional_get() instead?

> +	if (IS_ERR(kdwc->usb3_phy)) {
> +		error = PTR_ERR(kdwc->usb3_phy);
> +		if (error == -ENOSYS || error == -ENODEV) {
> +			kdwc->usb3_phy = NULL;
> +		} else {
> +			if (error != -EPROBE_DEFER) {
> +				dev_err(dev, "couldn't get usb3 phy: %d\n",
> +					error);
> +			}
> +
> +			return error;
> +		}
> +	}
> +
> +	phy_pm_runtime_get_sync(kdwc->usb3_phy);
> +
> +	error = phy_reset(kdwc->usb3_phy);
> +	if (error < 0) {
> +		dev_err(dev, "usb3 phy reset failed: %d\n", error);
> +		return error;
> +	}
> +
> +	error = phy_init(kdwc->usb3_phy);
> +	if (error < 0) {
> +		dev_err(dev, "usb3 phy init failed: %d\n", error);
> +		return error;
> +	}
>  
> +	error = phy_power_on(kdwc->usb3_phy);
> +	if (error < 0) {
> +		dev_err(dev, "usb3 phy power on failed: %d\n", error);
> +		phy_exit(kdwc->usb3_phy);
> +		return error;
> +	}
> +
> +	pm_runtime_enable(kdwc->dev);
>  	error = pm_runtime_get_sync(kdwc->dev);
>  	if (error < 0) {
>  		dev_err(kdwc->dev, "pm_runtime_get_sync failed, error %d\n",
> @@ -138,6 +176,9 @@ static int kdwc3_probe(struct platform_device *pdev)
>  err_irq:
>  	pm_runtime_put_sync(kdwc->dev);
>  	pm_runtime_disable(kdwc->dev);
> +	phy_power_off(kdwc->usb3_phy);
> +	phy_exit(kdwc->usb3_phy);
> +	phy_pm_runtime_put_sync(kdwc->usb3_phy);
>  
>  	return error;
>  }
> @@ -163,6 +204,10 @@ static int kdwc3_remove(struct platform_device *pdev)
>  	pm_runtime_put_sync(kdwc->dev);
>  	pm_runtime_disable(kdwc->dev);
>  
> +	phy_power_off(kdwc->usb3_phy);
> +	phy_exit(kdwc->usb3_phy);
> +	phy_pm_runtime_put_sync(kdwc->usb3_phy);
> +
>  	platform_set_drvdata(pdev, NULL);
>  
>  	return 0;


^ permalink raw reply

* Re: [PATCH v2 5/6] ARM: dts: iwg20d-q7-dbcm-ca: remove unneeded properties in hdmi@39
From: Laurent Pinchart @ 2020-05-14  1:37 UTC (permalink / raw)
  To: Ricardo Cañuelo
  Cc: kernel, devicetree, linux-arm-kernel, geert+renesas, robh+dt,
	xuwei5
In-Reply-To: <20200511110611.3142-6-ricardo.canuelo@collabora.com>

Hi Ricardo,

Thank you for the patch.

On Mon, May 11, 2020 at 01:06:10PM +0200, Ricardo Cañuelo wrote:
> Remove the adi,input-style and adi,input-justification properties of
> hdmi@39 to make it compliant with the "adi,adv7511w" DT binding.
> 
> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi b/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi
> index ede2e0c999b1..e10f99278c77 100644
> --- a/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi
> +++ b/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi
> @@ -72,8 +72,6 @@
>  		adi,input-depth = <8>;
>  		adi,input-colorspace = "rgb";
>  		adi,input-clock = "1x";
> -		adi,input-style = <1>;
> -		adi,input-justification = "evenly";
>  
>  		ports {
>  			#address-cells = <1>;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH v2 4/6] arm64: dts: hisilicon: hikey: fixes to comply with adi,adv7533 DT binding
From: Laurent Pinchart @ 2020-05-14  1:37 UTC (permalink / raw)
  To: Ricardo Cañuelo
  Cc: kernel, devicetree, linux-arm-kernel, geert+renesas, robh+dt,
	xuwei5
In-Reply-To: <20200511110611.3142-5-ricardo.canuelo@collabora.com>

Hi Ricardo,

Thank you for the patch.

On Mon, May 11, 2020 at 01:06:09PM +0200, Ricardo Cañuelo wrote:
> hi3660-hikey960.dts:
>   Define a 'ports' node for 'adv7533: adv7533@39' and the
>   'adi,dsi-lanes' property to make it compliant with the adi,adv7533 DT
>   binding.
> 
>   This fills the requirements to meet the binding requirements,
>   remote endpoints are not defined.
> 
> hi6220-hikey.dts:
>   Change property name s/pd-gpio/pd-gpios, gpio properties should be
>   plural. This is just a cosmetic change.
> 
> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts | 11 +++++++++++
>  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts    |  2 +-
>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
> index e035cf195b19..8c4bfbaf3a80 100644
> --- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
> +++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
> @@ -530,6 +530,17 @@
>  		status = "ok";
>  		compatible = "adi,adv7533";
>  		reg = <0x39>;
> +		adi,dsi-lanes = <4>;
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			port@0 {
> +				reg = <0>;
> +			};
> +			port@1 {
> +				reg = <1>;
> +			};
> +		};
>  	};
>  };
>  
> diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> index c14205cd6bf5..3e47150c05ec 100644
> --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> @@ -516,7 +516,7 @@
>  		reg = <0x39>;
>  		interrupt-parent = <&gpio1>;
>  		interrupts = <1 2>;
> -		pd-gpio = <&gpio0 4 0>;
> +		pd-gpios = <&gpio0 4 0>;
>  		adi,dsi-lanes = <4>;
>  		#sound-dai-cells = <0>;
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox