Re: [PATCH v2 3/3] dt-bindings: display: rockchip,dw-hdmi: Fix sound-dai-cells warning

2024-04-14 Thread Johan Jonker



On 4/14/24 17:11, Jonas Karlman wrote:
> The rockchip,dw-hdmi node can be used as a sound dai codec, however,
> dtbs_check may report the following issue:
> 
>   hdmi@fe0a: Unevaluated properties are not allowed ('#sound-dai-cells' 
> was unexpected)
>   from schema $id: 
> http://devicetree.org/schemas/display/rockchip/rockchip,dw-hdmi.yaml#
> 
> Add a reference to dai-common.yaml and add the #sound-dai-cells prop to
> resolve this warning.
> 
> Signed-off-by: Jonas Karlman 
> ---

> v2: New patch to fix #sound-dai-cells warning

Hi,

You are #4 that does an attempt on this subject.
Coincidence with my patches??
If other notifications could be fixed with the same amount of interest?
Please be welcome to pick some other random Rockchip related ones.

Johan

===

[PATCH v1 1/3] dt-bindings: display: add #sound-dai-cells property to rockchip 
dw hdmi
https://lore.kernel.org/linux-rockchip/3a035c16-75b5-471d-aa9d-e91c2bb9f...@gmail.com/

[PATCH] dt-bindings: display: rockchip: add missing #sound-dai-cells to dw-hdmi
https://lore.kernel.org/linux-rockchip/20240326172801.1163200-1-he...@sntech.de/

[PATCH 6/6] dt-bindings: display: rockchip: dw-hdmi: Add missing 
sound-dai-cells property
https://lore.kernel.org/linux-rockchip/20231222-pinetab2-v1-6-e148a7f61...@mecka.net/

> ---
>  .../bindings/display/rockchip/rockchip,dw-hdmi.yaml   | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
> b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
> index af638b6c0d21..3285fff54416 100644
> --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
> +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
> @@ -15,6 +15,7 @@ description: |
>  
>  allOf:
>- $ref: ../bridge/synopsys,dw-hdmi.yaml#
> +  - $ref: /schemas/sound/dai-common.yaml#
>  
>  properties:
>compatible:
> @@ -124,6 +125,9 @@ properties:
>  description:
>phandle to the GRF to mux vopl/vopb.
>  
> +  "#sound-dai-cells":
> +const: 0
> +
>  required:
>- compatible
>- reg


[PATCH v1 3/3] dt-bindings: display: add #sound-dai-cells property to rockchip inno hdmi

2024-04-13 Thread Johan Jonker
The Rockchip inno HDMI controller can take one I2S input and transmit it
over the HDMI output. Add #sound-dai-cells (= 0) to the binding for it.

Signed-off-by: Johan Jonker 
---
 .../bindings/display/rockchip/rockchip,inno-hdmi.yaml| 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
index be78dcfa1c76..5b87b0f1963e 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
@@ -37,6 +37,9 @@ properties:
   power-domains:
 maxItems: 1

+  "#sound-dai-cells":
+const: 0
+
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

@@ -66,6 +69,7 @@ required:
   - ports

 allOf:
+  - $ref: /schemas/sound/dai-common.yaml#
   - if:
   properties:
 compatible:
@@ -106,6 +110,7 @@ examples:
   clock-names = "pclk";
   pinctrl-names = "default";
   pinctrl-0 = <_ctl>;
+  #sound-dai-cells = <0>;

   ports {
 #address-cells = <1>;
--
2.39.2



[PATCH v1 2/3] dt-bindings: display: add #sound-dai-cells property to rockchip rk3066 hdmi

2024-04-13 Thread Johan Jonker
The Rockchip rk3066 HDMI controller can take one I2S input and transmit it
over the HDMI output. Add #sound-dai-cells (= 0) to the binding for it.

Signed-off-by: Johan Jonker 
---
 .../bindings/display/rockchip/rockchip,rk3066-hdmi.yaml| 7 +++
 1 file changed, 7 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
index 1a68a940d165..6d4b78a36576 100644
--- 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
+++ 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
@@ -10,6 +10,9 @@ maintainers:
   - Sandy Huang 
   - Heiko Stuebner 

+allOf:
+  - $ref: /schemas/sound/dai-common.yaml#
+
 properties:
   compatible:
 const: rockchip,rk3066-hdmi
@@ -34,6 +37,9 @@ properties:
 description:
   This soc uses GRF regs to switch the HDMI TX input between vop0 and vop1.

+  "#sound-dai-cells":
+const: 0
+
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

@@ -83,6 +89,7 @@ examples:
   pinctrl-names = "default";
   power-domains = < RK3066_PD_VIO>;
   rockchip,grf = <>;
+  #sound-dai-cells = <0>;

   ports {
 #address-cells = <1>;
--
2.39.2



[PATCH v1 1/3] dt-bindings: display: add #sound-dai-cells property to rockchip dw hdmi

2024-04-13 Thread Johan Jonker
The Rockchip DWC HDMI TX Encoder can take one I2S input and transmit it
over the HDMI output. Add #sound-dai-cells (= 0) to the binding for it.

Signed-off-by: Johan Jonker 
---
 .../bindings/display/rockchip/rockchip,dw-hdmi.yaml  | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
index af638b6c0d21..2aac62219ff6 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
@@ -15,6 +15,7 @@ description: |

 allOf:
   - $ref: ../bridge/synopsys,dw-hdmi.yaml#
+  - $ref: /schemas/sound/dai-common.yaml#

 properties:
   compatible:
@@ -124,6 +125,9 @@ properties:
 description:
   phandle to the GRF to mux vopl/vopb.

+  "#sound-dai-cells":
+const: 0
+
 required:
   - compatible
   - reg
@@ -153,6 +157,7 @@ examples:
 ddc-i2c-bus = <>;
 power-domains = < RK3288_PD_VIO>;
 rockchip,grf = <>;
+#sound-dai-cells = <0>;

 ports {
 #address-cells = <1>;
--
2.39.2



[PATCH v2 6/6] arm64: dts: rockchip: fix rk3399 hdmi ports node

2024-01-31 Thread Johan Jonker
Fix rk3399 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---

Changed V2:
  keep reg-io-width together with reg
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 0caa842bba0e..9d5f5b083e3c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -2022,6 +2022,7 @@ simple-audio-card,codec {
hdmi: hdmi@ff94 {
compatible = "rockchip,rk3399-dw-hdmi";
reg = <0x0 0xff94 0x0 0x2>;
+   reg-io-width = <4>;
interrupts = ;
clocks = < PCLK_HDMI_CTRL>,
 < SCLK_HDMI_SFR>,
@@ -2030,13 +2031,16 @@ hdmi: hdmi@ff94 {
 < PLL_VPLL>;
clock-names = "iahb", "isfr", "cec", "grf", "ref";
power-domains = < RK3399_PD_HDCP>;
-   reg-io-width = <4>;
rockchip,grf = <>;
#sound-dai-cells = <0>;
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

@@ -2049,6 +2053,10 @@ hdmi_in_vopl: endpoint@1 {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v2 5/6] arm64: dts: rockchip: fix rk3328 hdmi ports node

2024-01-31 Thread Johan Jonker
Fix rk3328 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---

Changed V2:
  keep reg-io-width together with reg
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index fb5dcf6e9327..a73234b11ff1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -745,11 +745,20 @@ hdmi: hdmi@ff3c {
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
+
hdmi_in_vop: endpoint {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v2 4/6] ARM: dts: rockchip: fix rk322x hdmi ports node

2024-01-31 Thread Johan Jonker
Fix rk322x hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---

Changed V2:
  keep reg-io-width together with reg
---
 arch/arm/boot/dts/rockchip/rk322x.dtsi | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/rockchip/rk322x.dtsi 
b/arch/arm/boot/dts/rockchip/rk322x.dtsi
index 831561fc1814..96421355c274 100644
--- a/arch/arm/boot/dts/rockchip/rk322x.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk322x.dtsi
@@ -736,14 +736,20 @@ hdmi: hdmi@200a {
status = "disabled";

ports {
-   hdmi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   hdmi_in_vop: endpoint@0 {
-   reg = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
+
+   hdmi_in_vop: endpoint {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v2 3/6] ARM: dts: rockchip: fix rk3288 hdmi ports node

2024-01-31 Thread Johan Jonker
Fix rk3288 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding with some reordering
to align with the (new) documentation about
property ordering.

Signed-off-by: Johan Jonker 
---

Changed V2:
  keep reg-io-width together with reg
  reword
---
 arch/arm/boot/dts/rockchip/rk3288.dtsi | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/rockchip/rk3288.dtsi 
b/arch/arm/boot/dts/rockchip/rk3288.dtsi
index ead343dc3df1..3f1d640afafa 100644
--- a/arch/arm/boot/dts/rockchip/rk3288.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288.dtsi
@@ -1240,27 +1240,37 @@ hdmi: hdmi@ff98 {
compatible = "rockchip,rk3288-dw-hdmi";
reg = <0x0 0xff98 0x0 0x2>;
reg-io-width = <4>;
-   #sound-dai-cells = <0>;
-   rockchip,grf = <>;
interrupts = ;
clocks = <  PCLK_HDMI_CTRL>, < SCLK_HDMI_HDCP>, < 
SCLK_HDMI_CEC>;
clock-names = "iahb", "isfr", "cec";
power-domains = < RK3288_PD_VIO>;
+   rockchip,grf = <>;
+   #sound-dai-cells = <0>;
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
+
hdmi_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_hdmi>;
};
+
hdmi_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v2 2/6] dt-bindings: display: rockchip,dw-hdmi: add power-domains property

2024-01-31 Thread Johan Jonker
Most Rockchip hdmi nodes are part of a power domain.
Add a power-domains property and include it to the example
with some reordering to align with the (new) documentation
about property ordering.

Signed-off-by: Johan Jonker 
Acked-by: Conor Dooley 
---

Changed V2:
  keep reg-io-width together with reg
  explain reordering
---
 .../bindings/display/rockchip/rockchip,dw-hdmi.yaml  | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
index 391c2a7e79de..af638b6c0d21 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
@@ -94,6 +94,9 @@ properties:
   - const: default
   - const: unwedge

+  power-domains:
+maxItems: 1
+
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

@@ -138,16 +141,18 @@ examples:
 #include 
 #include 
 #include 
+#include 

 hdmi: hdmi@ff98 {
 compatible = "rockchip,rk3288-dw-hdmi";
 reg = <0xff98 0x2>;
 reg-io-width = <4>;
-ddc-i2c-bus = <>;
-rockchip,grf = <>;
 interrupts = ;
 clocks = <  PCLK_HDMI_CTRL>, < SCLK_HDMI_HDCP>;
 clock-names = "iahb", "isfr";
+ddc-i2c-bus = <>;
+power-domains = < RK3288_PD_VIO>;
+rockchip,grf = <>;

 ports {
 #address-cells = <1>;
--
2.39.2



[PATCH v2 1/6] dt-bindings: display: rockchip: rockchip,dw-hdmi: remove port property

2024-01-31 Thread Johan Jonker
The hdmi-connector nodes are now functional and the new way to model
hdmi ports nodes with both in and output port subnodes. Unfortunately
with the conversion to YAML the old method with only an input port node
was used. Later the new method was also added to the binding.
A binding must be unambiguously, so remove the old port property
entirely and make port@0 and port@1 a requirement as all
upstream dts files are updated as well and because checking
deprecated stuff is a bit pointless.
Update the example to avoid use of the removed property.

Signed-off-by: Johan Jonker 
---

Changed V2:
  rename title from deprecate to remove
  reword
---
 .../display/rockchip/rockchip,dw-hdmi.yaml| 24 +++
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
index 7e59dee15a5f..391c2a7e79de 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
@@ -97,8 +97,8 @@ properties:
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

-patternProperties:
-  "^port(@0)?$":
+properties:
+  port@0:
 $ref: /schemas/graph.yaml#/properties/port
 description: Input of the DWC HDMI TX
 properties:
@@ -108,11 +108,14 @@ properties:
 description: Connection to the VOPB
   endpoint@1:
 description: Connection to the VOPL
-properties:
   port@1:
 $ref: /schemas/graph.yaml#/properties/port
 description: Output of the DWC HDMI TX

+required:
+  - port@0
+  - port@1
+
   rockchip,grf:
 $ref: /schemas/types.yaml#/definitions/phandle
 description:
@@ -147,7 +150,11 @@ examples:
 clock-names = "iahb", "isfr";

 ports {
-port {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
 #address-cells = <1>;
 #size-cells = <0>;

@@ -155,11 +162,20 @@ examples:
 reg = <0>;
 remote-endpoint = <_out_hdmi>;
 };
+
 hdmi_in_vopl: endpoint@1 {
 reg = <1>;
 remote-endpoint = <_out_hdmi>;
 };
 };
+
+port@1 {
+reg = <1>;
+
+hdmi_out_con: endpoint {
+remote-endpoint = <_con_in>;
+};
+};
 };
 };

--
2.39.2



[PATCH v1 6/6] arm64: dts: rockchip: fix rk3399 hdmi ports node

2024-01-30 Thread Johan Jonker
Fix rk3399 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 0caa842bba0e..2c4924465aad 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -2036,7 +2036,11 @@ hdmi: hdmi@ff94 {
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

@@ -2049,6 +2053,10 @@ hdmi_in_vopl: endpoint@1 {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v1 5/6] arm64: dts: rockchip: fix rk3328 hdmi ports node

2024-01-30 Thread Johan Jonker
Fix rk3328 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index fb5dcf6e9327..749b3f965f32 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -727,7 +727,6 @@ vop_mmu: iommu@ff373f00 {
hdmi: hdmi@ff3c {
compatible = "rockchip,rk3328-dw-hdmi";
reg = <0x0 0xff3c 0x0 0x2>;
-   reg-io-width = <4>;
interrupts = ,
 ;
clocks = < PCLK_HDMI>,
@@ -740,16 +739,26 @@ hdmi: hdmi@ff3c {
phy-names = "hdmi";
pinctrl-names = "default";
pinctrl-0 = <_cec _xfer _hpd>;
+   reg-io-width = <4>;
rockchip,grf = <>;
#sound-dai-cells = <0>;
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
+
hdmi_in_vop: endpoint {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v1 4/6] ARM: dts: rockchip: fix rk322x hdmi ports node

2024-01-30 Thread Johan Jonker
Fix rk322x hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rockchip/rk322x.dtsi | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/rockchip/rk322x.dtsi 
b/arch/arm/boot/dts/rockchip/rk322x.dtsi
index 831561fc1814..ff8e778ea50f 100644
--- a/arch/arm/boot/dts/rockchip/rk322x.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk322x.dtsi
@@ -720,7 +720,6 @@ iep_mmu: iommu@20070800 {
hdmi: hdmi@200a {
compatible = "rockchip,rk3228-dw-hdmi";
reg = <0x200a 0x2>;
-   reg-io-width = <4>;
interrupts = ;
assigned-clocks = < SCLK_HDMI_PHY>;
assigned-clock-parents = <_phy>;
@@ -732,18 +731,25 @@ hdmi: hdmi@200a {
reset-names = "hdmi";
phys = <_phy>;
phy-names = "hdmi";
+   reg-io-width = <4>;
rockchip,grf = <>;
status = "disabled";

ports {
-   hdmi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   hdmi_in_vop: endpoint@0 {
-   reg = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
+
+   hdmi_in_vop: endpoint {
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v1 3/6] ARM: dts: rockchip: fix rk3288 hdmi ports node

2024-01-30 Thread Johan Jonker
Fix rk3288 hdmi ports node so that it matches the
rockchip,dw-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rockchip/rk3288.dtsi | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/rockchip/rk3288.dtsi 
b/arch/arm/boot/dts/rockchip/rk3288.dtsi
index ead343dc3df1..1a63281dcb36 100644
--- a/arch/arm/boot/dts/rockchip/rk3288.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288.dtsi
@@ -1239,28 +1239,38 @@ edp_out: port@1 {
hdmi: hdmi@ff98 {
compatible = "rockchip,rk3288-dw-hdmi";
reg = <0x0 0xff98 0x0 0x2>;
-   reg-io-width = <4>;
-   #sound-dai-cells = <0>;
-   rockchip,grf = <>;
interrupts = ;
clocks = <  PCLK_HDMI_CTRL>, < SCLK_HDMI_HDCP>, < 
SCLK_HDMI_CEC>;
clock-names = "iahb", "isfr", "cec";
power-domains = < RK3288_PD_VIO>;
+   reg-io-width = <4>;
+   rockchip,grf = <>;
+   #sound-dai-cells = <0>;
status = "disabled";

ports {
-   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   hdmi_in: port@0 {
+   reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
+
hdmi_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_hdmi>;
};
+
hdmi_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_hdmi>;
};
};
+
+   hdmi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.39.2



[PATCH v1 2/6] dt-bindings: display: rockchip,dw-hdmi: add power-domains property

2024-01-30 Thread Johan Jonker
Most Rockchip hdmi nodes are part of a power domain.
Add a power-domains property. Fix example.

Signed-off-by: Johan Jonker 
---
 .../bindings/display/rockchip/rockchip,dw-hdmi.yaml   | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
index cd0a42f35f24..6f421740b613 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
@@ -94,6 +94,9 @@ properties:
   - const: default
   - const: unwedge

+  power-domains:
+maxItems: 1
+
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

@@ -141,16 +144,18 @@ examples:
 #include 
 #include 
 #include 
+#include 

 hdmi: hdmi@ff98 {
 compatible = "rockchip,rk3288-dw-hdmi";
 reg = <0xff98 0x2>;
-reg-io-width = <4>;
-ddc-i2c-bus = <>;
-rockchip,grf = <>;
 interrupts = ;
 clocks = <  PCLK_HDMI_CTRL>, < SCLK_HDMI_HDCP>;
 clock-names = "iahb", "isfr";
+ddc-i2c-bus = <>;
+power-domains = < RK3288_PD_VIO>;
+reg-io-width = <4>;
+rockchip,grf = <>;

 ports {
 #address-cells = <1>;
--
2.39.2



[PATCH v1 1/6] dt-bindings: display: rockchip: rockchip,dw-hdmi: deprecate port property

2024-01-30 Thread Johan Jonker
The hdmi-connector nodes are now functional and the new way to model
hdmi nodes with, so deprecate the port property and make port@0 and
port@1 a requirement. Also update example.

Signed-off-by: Johan Jonker 
---
 .../display/rockchip/rockchip,dw-hdmi.yaml| 27 ---
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
index 7e59dee15a5f..cd0a42f35f24 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
@@ -97,8 +97,11 @@ properties:
   ports:
 $ref: /schemas/graph.yaml#/properties/ports

-patternProperties:
-  "^port(@0)?$":
+properties:
+  port:
+$ref: /schemas/graph.yaml#/properties/port
+deprecated: true
+  port@0:
 $ref: /schemas/graph.yaml#/properties/port
 description: Input of the DWC HDMI TX
 properties:
@@ -108,11 +111,14 @@ properties:
 description: Connection to the VOPB
   endpoint@1:
 description: Connection to the VOPL
-properties:
   port@1:
 $ref: /schemas/graph.yaml#/properties/port
 description: Output of the DWC HDMI TX

+required:
+  - port@0
+  - port@1
+
   rockchip,grf:
 $ref: /schemas/types.yaml#/definitions/phandle
 description:
@@ -147,7 +153,11 @@ examples:
 clock-names = "iahb", "isfr";

 ports {
-port {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
 #address-cells = <1>;
 #size-cells = <0>;

@@ -155,11 +165,20 @@ examples:
 reg = <0>;
 remote-endpoint = <_out_hdmi>;
 };
+
 hdmi_in_vopl: endpoint@1 {
 reg = <1>;
 remote-endpoint = <_out_hdmi>;
 };
 };
+
+port@1 {
+reg = <1>;
+
+hdmi_out_con: endpoint {
+remote-endpoint = <_con_in>;
+};
+};
 };
 };

--
2.39.2



Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

2023-12-19 Thread Johan Jonker



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker 
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

>From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant 
transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by 
LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added 
an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.ha...@pengutronix.de/

+   if (vop->data->max_output.width && mode->hdisplay > 
vop->data->max_output.width)
+   return MODE_BAD_HVALUE;
+
+   if (vop->data->max_output.height && mode->vdisplay > 
vop->data->max_output.height)
+   return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I 
submitted:
-   if (maxX > 1920)
-   maxX = 1920;
-   if (maxY > 1080)
-   maxY = 1080;
-
-   return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6...@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+uint32_t maxX, uint32_t maxY)
+{
+   return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime


[PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

2023-12-18 Thread Johan Jonker
CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0dac6d133767..6dadd753985c 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector 
*connector)
return >encoder.encoder;
 }

-static int
-rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
-uint32_t maxX, uint32_t maxY)
-{
-   if (maxX > 1920)
-   maxX = 1920;
-   if (maxY > 1080)
-   maxY = 1080;
-
-   return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}
-
 static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 {
drm_connector_unregister(connector);
@@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct 
drm_connector *connector)
 }

 static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = {
-   .fill_modes = rk3066_hdmi_probe_single_connector_modes,
+   .fill_modes = drm_helper_probe_single_connector_modes,
.detect = rk3066_hdmi_connector_detect,
.destroy = rk3066_hdmi_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
--
2.39.2



[PATCH v2 0/2] Rockchip rk3066_hdmi update

2023-12-18 Thread Johan Jonker
Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Changed V2:
  Drop already applied patches
  Remove "Remove useless output format" patch for now
  Add fill_modes hook removal patch

Johan Jonker (2):
  drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

--
2.39.2



[PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer

2023-12-18 Thread Johan Jonker
The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 62e6d8187de7..0dac6d133767 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -40,7 +40,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
struct device *dev;
-   struct drm_device *drm_dev;
struct regmap *grf_regmap;
int irq;
struct clk *hclk;
@@ -752,7 +751,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct 
device *master,
return -ENOMEM;

hdmi->dev = dev;
-   hdmi->drm_dev = drm;
hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hdmi->regs))
return PTR_ERR(hdmi->regs);
--
2.39.2



Re: [PATCH v1 1/3] dt-bindings: drm: rockchip: convert inno_hdmi-rockchip.txt to yaml

2023-12-04 Thread Johan Jonker
Hi,

On 12/4/23 19:56, Alex Bee wrote:
> Hi Johan,
> Am 04.12.23 um 18:39 schrieb Johan Jonker:
>> Convert inno_hdmi-rockchip.txt to yaml.
> Nice - I'm having something very similar on my queue :)
>>
>> Signed-off-by: Johan Jonker 
>> ---
>>
>> Note for rob+dt:
>>    Used enum to "soon" be able to add "rockchip,rk3128-inno-hdmi"

> Yeah, actually I'm planning to submit it really soon (if timne allows).

;)

>>
>> Changed V1:
>>    Rename file to more common layout
>>    Add/fix hdmi_out port example
>> ---
>>   .../display/rockchip/inno_hdmi-rockchip.txt   |  49 -
>>   .../display/rockchip/rockchip,inno-hdmi.yaml  | 103 ++
>>   2 files changed, 103 insertions(+), 49 deletions(-)
>>   delete mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
>>   create mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt 
>> b/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
>> deleted file mode 100644
>> index cec21714f0e0..
>> --- 
>> a/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
>> +++ /dev/null
>> @@ -1,49 +0,0 @@
>> -Rockchip specific extensions to the Innosilicon HDMI
>> -
>> -
>> -Required properties:
>> -- compatible:
>> -    "rockchip,rk3036-inno-hdmi";
>> -- reg:
>> -    Physical base address and length of the controller's registers.
>> -- clocks, clock-names:
>> -    Phandle to hdmi controller clock, name should be "pclk"
>> -- interrupts:
>> -    HDMI interrupt number
>> -- ports:
>> -    Contain one port node with endpoint definitions as defined in
>> -    Documentation/devicetree/bindings/graph.txt.
>> -- pinctrl-0, pinctrl-name:
>> -    Switch the iomux of HPD/CEC pins to HDMI function.
>> -
>> -Example:
>> -hdmi: hdmi@20034000 {
>> -    compatible = "rockchip,rk3036-inno-hdmi";
>> -    reg = <0x20034000 0x4000>;
>> -    interrupts = ;
>> -    clocks = <  PCLK_HDMI>;
>> -    clock-names = "pclk";
>> -    pinctrl-names = "default";
>> -    pinctrl-0 = <_ctl>;
>> -
>> -    hdmi_in: port {
>> -    #address-cells = <1>;
>> -    #size-cells = <0>;
>> -    hdmi_in_lcdc: endpoint@0 {
>> -    reg = <0>;
>> -    remote-endpoint = <_out_hdmi>;
>> -    };
>> -    };
>> -};
>> -
>> - {
>> -    hdmi {
>> -    hdmi_ctl: hdmi-ctl {
>> -    rockchip,pins = <1 8  RK_FUNC_1 _pull_none>,
>> -    <1 9  RK_FUNC_1 _pull_none>,
>> -    <1 10 RK_FUNC_1 _pull_none>,
>> -    <1 11 RK_FUNC_1 _pull_none>;
>> -    };
>> -    };
>> -
>> -};
>> diff --git 
>> a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml 
>> b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
>> new file mode 100644
>> index ..96889c86849a
>> --- /dev/null
>> +++ 
>> b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
>> @@ -0,0 +1,103 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/display/rockchip/rockchip,inno-hdmi.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Rockchip Innosilicon HDMI controller
>> +
>> +maintainers:
>> +  - Sandy Huang 
>> +  - Heiko Stuebner 
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +  - rockchip,rk3036-inno-hdmi
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +  clocks:
>> +    maxItems: 1

> The interrupts/clock description exists already in the txt-bindings - so how 
> about:
> 
> +    items:
> +  - descrition: 
>> +

It's not common to do so when there's only one clock and nothing special to 
mention.
Used this style for most of my conversions. 
Further rational might be given by Krzysztof and co.

>> +  clock-names:
>> +    const: pclk
>> +
>> +  ports:
>> +    $ref: /schemas/graph.yaml#/properties/ports
>> +
>> +    properties:
>> +   

Re: [PATCH v1 3/3] ARM: dts: rockchip: rk3036-kylin: add hdmi-connector node

2023-12-04 Thread Johan Jonker
Hi Alex, Heiko,

On 12/4/23 20:12, Alex Bee wrote:
> Hi Johan,
> Am 04.12.23 um 18:40 schrieb Johan Jonker:
>> Add hdmi-connector node to comply with the inno_hdmi binding.
>>
>> Signed-off-by: Johan Jonker 
>> ---
>>   arch/arm/boot/dts/rockchip/rk3036-kylin.dts | 17 +
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts 
>> b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
>> index 67e1e04139e7..a21be011 100644
>> --- a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
>> +++ b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
>> @@ -13,6 +13,17 @@ memory@6000 {
>>   reg = <0x6000 0x2000>;
>>   };
>>
>> +    hdmi_con: hdmi-con {
>> +    compatible = "hdmi-connector";
>> +    type = "c";


> According to [0], kylin has an A-Type HDMI port - so this should be
>  +    type = "a";
> > [0] http://rockchip.wikidot.com/kylin

Not sure from the text or do I miss something...

I did look at that board picture before submitting.
Can be wrong, but to me it looks a smaller HDMI connector.

Does anyone have a Kylin picture from a different angle?
Or reference design?

Else apply and fix later? (Heiko ?)
Let me know.

Johan

> 
> Regards,
> Alex
>> +
>> +    port {
>> +    hdmi_con_in: endpoint {
>> +    remote-endpoint = <_out_con>;
>> +    };
>> +    };
>> +    };
>> +
>>   leds: gpio-leds {
>>   compatible = "gpio-leds";
>>
>> @@ -110,6 +121,12 @@  {
>>   status = "okay";
>>   };
>>
>> +_out {
>> +    hdmi_out_con: endpoint {
>> +    remote-endpoint = <_con_in>;
>> +    };
>> +};
>> +
>>    {
>>   clock-frequency = <40>;
>>
>> -- 
>> 2.39.2
>>
>>
>> ___
>> Linux-rockchip mailing list
>> linux-rockc...@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 


[PATCH v1 3/3] ARM: dts: rockchip: rk3036-kylin: add hdmi-connector node

2023-12-04 Thread Johan Jonker
Add hdmi-connector node to comply with the inno_hdmi binding.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rockchip/rk3036-kylin.dts | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts 
b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
index 67e1e04139e7..a21be011 100644
--- a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
+++ b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
@@ -13,6 +13,17 @@ memory@6000 {
reg = <0x6000 0x2000>;
};

+   hdmi_con: hdmi-con {
+   compatible = "hdmi-connector";
+   type = "c";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <_out_con>;
+   };
+   };
+   };
+
leds: gpio-leds {
compatible = "gpio-leds";

@@ -110,6 +121,12 @@  {
status = "okay";
 };

+_out {
+   hdmi_out_con: endpoint {
+   remote-endpoint = <_con_in>;
+   };
+};
+
  {
clock-frequency = <40>;

--
2.39.2



[PATCH v1 2/3] ARM: dts: rockchip: rk3036: fix hdmi ports node

2023-12-04 Thread Johan Jonker
Fix hdmi ports node so that it matches the
rockchip,inno-hdmi.yaml binding.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rockchip/rk3036.dtsi | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi 
b/arch/arm/boot/dts/rockchip/rk3036.dtsi
index 8aa2e0864fed..2b00109bea6a 100644
--- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
@@ -405,12 +405,20 @@ hdmi: hdmi@20034000 {
pinctrl-0 = <_ctl>;
status = "disabled";

-   hdmi_in: port {
+   ports {
#address-cells = <1>;
#size-cells = <0>;
-   hdmi_in_vop: endpoint@0 {
+
+   hdmi_in: port@0 {
reg = <0>;
-   remote-endpoint = <_out_hdmi>;
+
+   hdmi_in_vop: endpoint {
+   remote-endpoint = <_out_hdmi>;
+   };
+   };
+
+   hdmi_out: port@1 {
+   reg = <1>;
};
};
};
--
2.39.2



[PATCH v1 1/3] dt-bindings: drm: rockchip: convert inno_hdmi-rockchip.txt to yaml

2023-12-04 Thread Johan Jonker
Convert inno_hdmi-rockchip.txt to yaml.

Signed-off-by: Johan Jonker 
---

Note for rob+dt:
  Used enum to "soon" be able to add "rockchip,rk3128-inno-hdmi"

Changed V1:
  Rename file to more common layout
  Add/fix hdmi_out port example
---
 .../display/rockchip/inno_hdmi-rockchip.txt   |  49 -
 .../display/rockchip/rockchip,inno-hdmi.yaml  | 103 ++
 2 files changed, 103 insertions(+), 49 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
deleted file mode 100644
index cec21714f0e0..
--- a/Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-Rockchip specific extensions to the Innosilicon HDMI
-
-
-Required properties:
-- compatible:
-   "rockchip,rk3036-inno-hdmi";
-- reg:
-   Physical base address and length of the controller's registers.
-- clocks, clock-names:
-   Phandle to hdmi controller clock, name should be "pclk"
-- interrupts:
-   HDMI interrupt number
-- ports:
-   Contain one port node with endpoint definitions as defined in
-   Documentation/devicetree/bindings/graph.txt.
-- pinctrl-0, pinctrl-name:
-   Switch the iomux of HPD/CEC pins to HDMI function.
-
-Example:
-hdmi: hdmi@20034000 {
-   compatible = "rockchip,rk3036-inno-hdmi";
-   reg = <0x20034000 0x4000>;
-   interrupts = ;
-   clocks = <  PCLK_HDMI>;
-   clock-names = "pclk";
-   pinctrl-names = "default";
-   pinctrl-0 = <_ctl>;
-
-   hdmi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   hdmi_in_lcdc: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_hdmi>;
-   };
-   };
-};
-
- {
-   hdmi {
-   hdmi_ctl: hdmi-ctl {
-   rockchip,pins = <1 8  RK_FUNC_1 _pull_none>,
-   <1 9  RK_FUNC_1 _pull_none>,
-   <1 10 RK_FUNC_1 _pull_none>,
-   <1 11 RK_FUNC_1 _pull_none>;
-   };
-   };
-
-};
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
new file mode 100644
index ..96889c86849a
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml
@@ -0,0 +1,103 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,inno-hdmi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip Innosilicon HDMI controller
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,rk3036-inno-hdmi
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: pclk
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Port node with one endpoint connected to a vop node.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Port node with one endpoint connected to a hdmi-connector node.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - pinctrl-0
+  - pinctrl-names
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+#include 
+hdmi: hdmi@20034000 {
+  compatible = "rockchip,rk3036-inno-hdmi";
+  reg = <0x20034000 0x4000>;
+  interrupts = ;
+  clocks = <  PCLK_HDMI>;
+  clock-names = "pclk";
+  pinctrl-names = "default";
+  pinctrl-0 = <_ctl>;
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+hdmi_in: port@0 {
+  reg = <0>;
+  hdmi_in_vop: endpoint {
+remote-endpoint = <_out_hdmi>;
+  };
+};
+
+hdmi_out: port@1 {
+  reg = <1>;
+  hdmi_out_con: endpoint {
+remote-endpoint = <_con_in>;
+  };
+};
+  };
+};
+
+pinctrl {
+  hdmi {
+hdmi_ctl: hdmi-ctl {
+  rockchip,pins = <1 RK_PB0 1 _pull_none>,
+  <1 RK_PB1 1 _pull_none>,
+  <1 RK_PB2 1 _pull_none>,
+  <1 RK_PB3 1 _pull_none>;
+};
+  };
+};
--
2.39.2



Re: [PATCH v4 38/45] drm/rockchip: inno_hdmi: Switch to infoframe type

2023-11-28 Thread Johan Jonker
Hi,

Maximum for inno_hdmi is: 1920x1080.

Do we still need INFOFRAME_VSI?

>From Rockchip RK3036 TRM V1.0 20150907-Part2 Peripheral and Interface.pdf:

- HDMI 1.4a/b/1.3/1.2/1.1, HDCP 1.2 and DVI 1.0 standard compliant transmitter
- Supports all DTV resolutions including 480p/576p/720p/1080p

https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_edid.c#L7015

* HDMI spec says if a mode is found in HDMI 1.4b 4K modes
* we should send its VIC in vendor infoframes, else send the
* VIC in AVI infoframes. Lets check if this mode is present in
* HDMI 1.4b 4K modes 
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_edid.c#L7212 
* Note that there's is a need to send HDMI vendor infoframes only when using a
* 4k or stereoscopic 3D mode. So when giving any other mode as input this
* function will return -EINVAL, error that can be safely ignored.


On 11/28/23 11:24, Maxime Ripard wrote:
> The inno_hdmi driver relies on its own internal infoframe type matching
> the hardware.
>
> This works fine, but in order to make further reworks easier, let's
> switch to the HDMI spec definition of those types.
>
> Signed-off-by: Maxime Ripard 
> ---
>  drivers/gpu/drm/rockchip/inno_hdmi.c | 71 
> +++-
>  1 file changed, 45 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
> b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index bc7fb1278cb2..ed1d10efbef4 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -156,61 +156,80 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi)
>   inno_hdmi_set_pwr_mode(hdmi, NORMAL);
>  }
>  
> +static u32 inno_hdmi_get_frame_index(struct inno_hdmi *hdmi,
> + enum hdmi_infoframe_type type)
> +{
> + struct drm_device *drm = hdmi->connector.dev;
> +
> + switch (type) {
> + case HDMI_INFOFRAME_TYPE_VENDOR:
> + return INFOFRAME_VSI;
> + case HDMI_INFOFRAME_TYPE_AVI:
> + return INFOFRAME_AVI;
> + default:
> + drm_err(drm, "Unknown infoframe type: %u\n", type);
> + }
> +
> + return 0;
> +}
> +
>  static u32 inno_hdmi_get_frame_mask(struct inno_hdmi *hdmi,
> - u32 frame_index)
> + enum hdmi_infoframe_type type)
>  {
>   struct drm_device *drm = hdmi->connector.dev;
>  
> - switch (frame_index) {
> - case INFOFRAME_VSI:
> + switch (type) {
> + case HDMI_INFOFRAME_TYPE_VENDOR:
>   return m_PACKET_VSI_EN;
> - case INFOFRAME_AVI:
> + case HDMI_INFOFRAME_TYPE_AVI:
>   return 0;
>   default:
> - drm_err(drm, "Unknown infoframe type: %u\n", frame_index);
> + drm_err(drm, "Unknown infoframe type: %u\n", type);
>   }
>  
>   return 0;
>  }
>  
>  static u32 inno_hdmi_get_frame_disable(struct inno_hdmi *hdmi,
> -u32 frame_index)
> +enum hdmi_infoframe_type type)
>  {
>   struct drm_device *drm = hdmi->connector.dev;
>  
> - switch (frame_index) {
> - case INFOFRAME_VSI:
> + switch (type) {
> + case HDMI_INFOFRAME_TYPE_VENDOR:
>   return v_PACKET_VSI_EN(0);
> - case INFOFRAME_AVI:
> + case HDMI_INFOFRAME_TYPE_AVI:
>   return 0;
>   default:
> - drm_err(drm, "Unknown infoframe type: %u\n", frame_index);
> + drm_err(drm, "Unknown infoframe type: %u\n", type);
>   }
>  
>   return 0;
>  }
>  
>  static u32 inno_hdmi_get_frame_enable(struct inno_hdmi *hdmi,
> -   u32 frame_index)
> +   enum hdmi_infoframe_type type)
>  {
>   struct drm_device *drm = hdmi->connector.dev;
>  
> - switch (frame_index) {
> - case INFOFRAME_VSI:
> + switch (type) {
> + case HDMI_INFOFRAME_TYPE_VENDOR:
>   return v_PACKET_VSI_EN(1);
> - case INFOFRAME_AVI:
> + case HDMI_INFOFRAME_TYPE_AVI:
>   return 0;
>   default:
> - drm_err(drm, "Unknown infoframe type: %u\n", frame_index);
> + drm_err(drm, "Unknown infoframe type: %u\n", type);
>   }
>  
>   return 0;
>  }
>  
> -static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index)
> +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi,
> + enum hdmi_infoframe_type type)
>  {
> - u32 disable = inno_hdmi_get_frame_disable(hdmi, frame_index);
> - u32 mask = inno_hdmi_get_frame_mask(hdmi, frame_index);
> + u32 frame_index = inno_hdmi_get_frame_index(hdmi, type);
> + u32 disable = inno_hdmi_get_frame_disable(hdmi, type);
> + u32 mask = inno_hdmi_get_frame_mask(hdmi, type);
>  
>   if (mask)
>   hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, disable);
> @@ -219,14 +238,14 @@ static void inno_hdmi_disable_frame(struct 

Re: [PATCH RFC v3 22/37] drm/rockchip: inno_hdmi: Remove useless output format

2023-11-26 Thread Johan Jonker
Hi Maxime,

In stead of further cripplingRockchip HDMI drivers one could also make it 
functional based  on EDID info.

To start with the output could you turn RGB888 input and switch between

RGB444, YCBCR444 and YCBCR422 output.

Johan

On 10/31/23 17:48, Maxime Ripard wrote:
> Similarly to the input format, the driver has a lot of code to deal with
> various output format, but the driver hardcodes it to RGB always.
>
> Let's get rid of the dead code.
>
> Signed-off-by: Maxime Ripard 
> ---
>  drivers/gpu/drm/rockchip/inno_hdmi.c | 57 
> 
>  1 file changed, 6 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
> b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index e0696ab16da3..0c6c550e0ce7 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -28,7 +28,6 @@
>  #include "inno_hdmi.h"
>  
>  struct hdmi_data_info {
> - unsigned int enc_out_format;
>   unsigned int colorimetry;
>  };
>  
> @@ -296,26 +295,14 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi 
> *hdmi,
>   rc = drm_hdmi_avi_infoframe_from_display_mode(,
> >connector,
> mode);
> -
> - if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
> - frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
> - else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422)
> - frame.avi.colorspace = HDMI_COLORSPACE_YUV422;
> - else
> - frame.avi.colorspace = HDMI_COLORSPACE_RGB;
> + frame.avi.colorspace = HDMI_COLORSPACE_RGB;
>  
>   return inno_hdmi_upload_frame(hdmi, rc, , INFOFRAME_AVI, 0, 0, 0);
>  }
>  
>  static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi)
>  {
> - struct hdmi_data_info *data = >hdmi_data;
> - int c0_c2_change = 0;
> - int csc_enable = 0;
> - int csc_mode = 0;
> - int auto_csc = 0;
>   int value;
> - int i;
>  
>   /* Input video mode is SDR RGB24bit, data enable signal from external */
>   hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL1, v_DE_EXTERNAL |
> @@ -327,43 +314,13 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi 
> *hdmi)
>   v_VIDEO_INPUT_CSP(0);
>   hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value);
>  
> - if (HDMI_COLORSPACE_RGB == data->enc_out_format) {
> - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1);
> - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value);
> -
> - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL,
> -   m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP,
> -   v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) |
> -   v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE));
> - return 0;
> - }
> -
> - if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) {
> - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) {
> - csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT;
> - auto_csc = AUTO_CSC_DISABLE;
> - c0_c2_change = C0_C2_CHANGE_DISABLE;
> - csc_enable = v_CSC_ENABLE;
> - }
> - } else {
> - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) {
> - csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT;
> - auto_csc = AUTO_CSC_DISABLE;
> - c0_c2_change = C0_C2_CHANGE_DISABLE;
> - csc_enable = v_CSC_ENABLE;
> - }
> - }
> -
> - for (i = 0; i < 24; i++)
> - hdmi_writeb(hdmi, HDMI_VIDEO_CSC_COEF + i,
> - coeff_csc[csc_mode][i]);
> -
> - value = v_SOF_DISABLE | csc_enable | v_COLOR_DEPTH_NOT_INDICATED(1);
> + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1);
>   hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value);
> - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, m_VIDEO_AUTO_CSC |
> -   m_VIDEO_C0_C2_SWAP, v_VIDEO_AUTO_CSC(auto_csc) |
> -   v_VIDEO_C0_C2_SWAP(c0_c2_change));
>  
> + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL,
> +   m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP,
> +   v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) |
> +   v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE));
>   return 0;
>  }
>  
> @@ -425,8 +382,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi,
>   struct drm_display_info *display = >connector.display_info;
>   u8 vic = drm_match_cea_mode(mode);
>  
> - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB;
> -
>   if ((vic == 6) || (vic == 7) ||
>   (vic == 21) || (vic == 22) ||
>   (vic == 2) || (vic == 3) ||
>


[PATCH v1 3/3] drm/rockchip: inno_hdmi: Remove unused drm device pointer

2023-11-26 Thread Johan Jonker
The drm_dev field in the inno_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Maxime Ripard 
Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 535cca30c256..ff7fa11dbc61 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -48,7 +48,6 @@ struct inno_hdmi_i2c {

 struct inno_hdmi {
struct device *dev;
-   struct drm_device *drm_dev;

int irq;
struct clk *pclk;
@@ -821,7 +820,6 @@ static int inno_hdmi_bind(struct device *dev, struct device 
*master,
return -ENOMEM;

hdmi->dev = dev;
-   hdmi->drm_dev = drm;

hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hdmi->regs))
--
2.39.2



[PATCH v1 2/3] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic

2023-11-26 Thread Johan Jonker
The inno_hdmi encoder still uses the non atomic variants
of enable and disable. Convert to their atomic equivalents.
In atomic mode there is no need to save the adjusted mode,
so remove the mode_set function.

Signed-off-by: Maxime Ripard 
Signed-off-by: Johan Jonker 
---

Changed V1:
  Combined patches
  Include drm_atomic.h
---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 46 ++--
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index cc48cbf85f31..535cca30c256 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -5,6 +5,13 @@
  *Yakir Yang 
  */

+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -16,12 +23,6 @@
 #include 
 #include 

-#include 
-#include 
-#include 
-#include 
-#include 
-
 #include "rockchip_drm_drv.h"
 #include "rockchip_drm_vop.h"

@@ -62,7 +63,6 @@ struct inno_hdmi {
unsigned int tmds_rate;

struct hdmi_data_info   hdmi_data;
-   struct drm_display_mode previous_mode;
 };

 static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder)
@@ -491,26 +491,27 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi,
return 0;
 }

-static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder,
-  struct drm_display_mode *mode,
-  struct drm_display_mode *adj_mode)
+static void inno_hdmi_encoder_enable(struct drm_encoder *encoder,
+struct drm_atomic_state *state)
 {
struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder);
+   struct drm_connector_state *conn_state;
+   struct drm_crtc_state *crtc_state;

-   inno_hdmi_setup(hdmi, adj_mode);
+   conn_state = drm_atomic_get_new_connector_state(state, 
>connector);
+   if (WARN_ON(!conn_state))
+   return;

-   /* Store the display mode for plugin/DPMS poweron events */
-   drm_mode_copy(>previous_mode, adj_mode);
-}
-
-static void inno_hdmi_encoder_enable(struct drm_encoder *encoder)
-{
-   struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder);
+   crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
+   if (WARN_ON(!crtc_state))
+   return;

+   inno_hdmi_setup(hdmi, _state->adjusted_mode);
inno_hdmi_set_pwr_mode(hdmi, NORMAL);
 }

-static void inno_hdmi_encoder_disable(struct drm_encoder *encoder)
+static void inno_hdmi_encoder_disable(struct drm_encoder *encoder,
+ struct drm_atomic_state *state)
 {
struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder);

@@ -531,10 +532,9 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
 }

 static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
-   .enable = inno_hdmi_encoder_enable,
-   .disable= inno_hdmi_encoder_disable,
-   .mode_set   = inno_hdmi_encoder_mode_set,
-   .atomic_check = inno_hdmi_encoder_atomic_check,
+   .atomic_check   = inno_hdmi_encoder_atomic_check,
+   .atomic_enable  = inno_hdmi_encoder_enable,
+   .atomic_disable = inno_hdmi_encoder_disable,
 };

 static enum drm_connector_status
--
2.39.2



[PATCH v1 1/3] drm/rockchip: inno_hdmi: Remove useless mode_fixup

2023-11-26 Thread Johan Jonker
The mode_fixup implementation doesn't do anything, so we can simply
remove it.

Signed-off-by: Maxime Ripard 
Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 6e5b922a121e..cc48cbf85f31 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -517,13 +517,6 @@ static void inno_hdmi_encoder_disable(struct drm_encoder 
*encoder)
inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
 }

-static bool inno_hdmi_encoder_mode_fixup(struct drm_encoder *encoder,
-const struct drm_display_mode *mode,
-struct drm_display_mode *adj_mode)
-{
-   return true;
-}
-
 static int
 inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
   struct drm_crtc_state *crtc_state,
@@ -540,7 +533,6 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
 static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
.enable = inno_hdmi_encoder_enable,
.disable= inno_hdmi_encoder_disable,
-   .mode_fixup = inno_hdmi_encoder_mode_fixup,
.mode_set   = inno_hdmi_encoder_mode_set,
.atomic_check = inno_hdmi_encoder_atomic_check,
 };
--
2.39.2



[PATCH v1 0/3] Rockchip inno_hdmi update

2023-11-26 Thread Johan Jonker
Combined update for the Rockchip inno_hdmi driver in a
somewhat similar way to what is proposed for the
"Create HDMI Connector infrastructure patch serie".
Keeping the inno_hdmi and rk3066_hdmi driver functions
comparable makes maintanance easier.

Maxime Ripard (3):
  drm/rockchip: inno_hdmi: Remove useless mode_fixup
  drm/rockchip: inno_hdmi: Switch encoder hooks to atomic
  drm/rockchip: inno_hdmi: Remove unused drm device pointer

 drivers/gpu/drm/rockchip/inno_hdmi.c | 56 
 1 file changed, 23 insertions(+), 33 deletions(-)

--
2.39.2



Re: [PATCH v1 3/4] drm/rockchip: rk3066_hdmi: Remove useless output format

2023-11-23 Thread Johan Jonker



On 11/20/23 18:06, Heiko Stuebner wrote:
> Hi Johan,
> 
> Am Donnerstag, 2. November 2023, 14:42:19 CET schrieb Johan Jonker:
>> The Rk3066 hdmi output format is hard coded to RGB. Remove
>> all useless code related to colorimetry and enc_out_format.
>>
>> Signed-off-by: Johan Jonker 
> 

> I guess my first question is, is the hardcoding happening just because
> of missing functionality in the driver, or does the hardware only
> support RGB?

This driver can do so much more..., but is crippled by various causes.
If in need for a full functional rk3066 driver a little bit help/advise/action 
from other people is needed.

1:
Missing rk3066 TRM HDMI register info.
Could Rockchip (= Sandy Huang) disclose this info to the open source community?

As a way around we can look at older driver code and port to mainline.
More info gives better results.
rk30_hdmi_config_csc() function:
https://github.com/RockchipOpensourceCommunity/px2-android-kernel-3.0/blob/master/drivers/video/rockchip/hdmi/chips/rkpx2/rkpx2_hdmi_hw.c#L315

2:
Could DRM people show us examples for:
- How to advertise to the VOP driver what data formats (RGB, YCBCR) it can send 
to the HDMI driver or any other Rockchip DRM sub driver other then RGB.
- Advertise EDID data monitor modes RGB444, YCBCR444 and YCBCR422 to the HDMI 
driver.

https://github.com/RockchipOpensourceCommunity/px2-android-kernel-3.0/blob/master/drivers/video/rockchip/hdmi/rk_hdmi_edid.c#L217C1-L218C41

3:
Advise when what Infoframe is needed for only RGB vs. the rest according to the 
specification.
https://engineering.purdue.edu/ece477/Archive/2012/Spring/S12-Grp10/Datasheets/CEC_HDMI_Specification.pdf

rk3066 currently only sends avi info. Does it need vsi as well? Can anyone give 
some clarity here?
inno_hdime sends avi and vsi info.

4:
rk3066_hdmi and inno_hdmi are HDMI 1.4a drivers for DVI and HDMI.
Validated by drm_match_cea_mode() this function only gives us both HDMI + HDMI2 
focus, but nothing for old DVI monitors.
How to improve?

5:
Sound support was submitted:
Re: [PATCH v6 2/5] drm: rockchip: add sound support to rk3066 hdmi driver
https://lore.kernel.org/linux-rockchip/48dbe9b7-0aa0-f459-301f-f380e2b7f...@gmail.com/

No reply was given (by Heiko or others) on why it wasn't applied or what needs 
to be improved.

Without reply no improvement.

Johan


> 
> 
>> ---
>>  drivers/gpu/drm/rockchip/rk3066_hdmi.c | 20 +---
>>  1 file changed, 1 insertion(+), 19 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
>> b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
>> index 0e7aae341960..f2b1b2faa096 100644
>> --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
>> +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
>> @@ -23,8 +23,6 @@
>>
>>  struct hdmi_data_info {
>>  int vic; /* The CEA Video ID (VIC) of the current drm display mode. */
>> -unsigned int enc_out_format;
>> -unsigned int colorimetry;
>>  };
>>
>>  struct rk3066_hdmi_i2c {
>> @@ -200,14 +198,7 @@ static int rk3066_hdmi_config_avi(struct rk3066_hdmi 
>> *hdmi,
>>  rc = drm_hdmi_avi_infoframe_from_display_mode(,
>>>connector, mode);
>>
>> -if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
>> -frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
>> -else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422)
>> -frame.avi.colorspace = HDMI_COLORSPACE_YUV422;
>> -else
>> -frame.avi.colorspace = HDMI_COLORSPACE_RGB;
>> -
>> -frame.avi.colorimetry = hdmi->hdmi_data.colorimetry;
>> +frame.avi.colorspace = HDMI_COLORSPACE_RGB;
>>  frame.avi.scan_mode = HDMI_SCAN_MODE_NONE;
>>
>>  return rk3066_hdmi_upload_frame(hdmi, rc, ,
>> @@ -329,15 +320,6 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
>>  struct drm_display_info *display = >connector.display_info;
>>
>>  hdmi->hdmi_data.vic = drm_match_cea_mode(mode);
>> -hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB;
>> -
>> -if (hdmi->hdmi_data.vic == 6 || hdmi->hdmi_data.vic == 7 ||
>> -hdmi->hdmi_data.vic == 21 || hdmi->hdmi_data.vic == 22 ||
>> -hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3 ||
>> -hdmi->hdmi_data.vic == 17 || hdmi->hdmi_data.vic == 18)
>> -hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601;
>> -else
>> -hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709;
> 

> while I can understand the RGB output format, why does the colorimetry
> also get removed? This looks like it is dependent on the mode itself

[PATCH v1 4/4] drm/rockchip: rk3066_hdmi: Remove unused drm device pointer

2023-11-02 Thread Johan Jonker
The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index f2b1b2faa096..c51520ec58d2 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -38,7 +38,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
struct device *dev;
-   struct drm_device *drm_dev;
struct regmap *grf_regmap;
int irq;
struct clk *hclk;
@@ -734,7 +733,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct 
device *master,
return -ENOMEM;

hdmi->dev = dev;
-   hdmi->drm_dev = drm;
hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hdmi->regs))
return PTR_ERR(hdmi->regs);
--
2.39.2



[PATCH v1 3/4] drm/rockchip: rk3066_hdmi: Remove useless output format

2023-11-02 Thread Johan Jonker
The Rk3066 hdmi output format is hard coded to RGB. Remove
all useless code related to colorimetry and enc_out_format.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 20 +---
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0e7aae341960..f2b1b2faa096 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -23,8 +23,6 @@

 struct hdmi_data_info {
int vic; /* The CEA Video ID (VIC) of the current drm display mode. */
-   unsigned int enc_out_format;
-   unsigned int colorimetry;
 };

 struct rk3066_hdmi_i2c {
@@ -200,14 +198,7 @@ static int rk3066_hdmi_config_avi(struct rk3066_hdmi *hdmi,
rc = drm_hdmi_avi_infoframe_from_display_mode(,
  >connector, mode);

-   if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
-   frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
-   else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422)
-   frame.avi.colorspace = HDMI_COLORSPACE_YUV422;
-   else
-   frame.avi.colorspace = HDMI_COLORSPACE_RGB;
-
-   frame.avi.colorimetry = hdmi->hdmi_data.colorimetry;
+   frame.avi.colorspace = HDMI_COLORSPACE_RGB;
frame.avi.scan_mode = HDMI_SCAN_MODE_NONE;

return rk3066_hdmi_upload_frame(hdmi, rc, ,
@@ -329,15 +320,6 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
struct drm_display_info *display = >connector.display_info;

hdmi->hdmi_data.vic = drm_match_cea_mode(mode);
-   hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB;
-
-   if (hdmi->hdmi_data.vic == 6 || hdmi->hdmi_data.vic == 7 ||
-   hdmi->hdmi_data.vic == 21 || hdmi->hdmi_data.vic == 22 ||
-   hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3 ||
-   hdmi->hdmi_data.vic == 17 || hdmi->hdmi_data.vic == 18)
-   hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601;
-   else
-   hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709;

hdmi->tmdsclk = mode->clock * 1000;

--
2.39.2



[PATCH v1 2/4] drm/rockchip: rk3066_hdmi: Switch encoder hooks to atomic

2023-11-02 Thread Johan Jonker
The rk3066_hdmi encoder still uses the non atomic variants
of enable and disable. Convert to their atomic equivalents.
In atomic mode there is no need to save the adjusted mode,
so remove the mode_set function.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 35 +-
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 5c269081c691..0e7aae341960 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -55,7 +55,6 @@ struct rk3066_hdmi {
unsigned int tmdsclk;

struct hdmi_data_info hdmi_data;
-   struct drm_display_mode previous_mode;
 };

 static struct rk3066_hdmi *encoder_to_rk3066_hdmi(struct drm_encoder *encoder)
@@ -387,21 +386,21 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
return 0;
 }

-static void
-rk3066_hdmi_encoder_mode_set(struct drm_encoder *encoder,
-struct drm_display_mode *mode,
-struct drm_display_mode *adj_mode)
+static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder,
+  struct drm_atomic_state *state)
 {
struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);
+   struct drm_connector_state *conn_state;
+   struct drm_crtc_state *crtc_state;
+   int mux, val;

-   /* Store the display mode for plugin/DPMS poweron events. */
-   drm_mode_copy(>previous_mode, adj_mode);
-}
+   conn_state = drm_atomic_get_new_connector_state(state, 
>connector);
+   if (WARN_ON(!conn_state))
+   return;

-static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder)
-{
-   struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);
-   int mux, val;
+   crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
+   if (WARN_ON(!crtc_state))
+   return;

mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder);
if (mux)
@@ -414,10 +413,11 @@ static void rk3066_hdmi_encoder_enable(struct drm_encoder 
*encoder)
DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n",
  (mux) ? "1" : "0");

-   rk3066_hdmi_setup(hdmi, >previous_mode);
+   rk3066_hdmi_setup(hdmi, _state->adjusted_mode);
 }

-static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder)
+static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder,
+   struct drm_atomic_state *state)
 {
struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);

@@ -449,10 +449,9 @@ rk3066_hdmi_encoder_atomic_check(struct drm_encoder 
*encoder,

 static const
 struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = {
-   .enable   = rk3066_hdmi_encoder_enable,
-   .disable  = rk3066_hdmi_encoder_disable,
-   .mode_set = rk3066_hdmi_encoder_mode_set,
-   .atomic_check = rk3066_hdmi_encoder_atomic_check,
+   .atomic_check   = rk3066_hdmi_encoder_atomic_check,
+   .atomic_enable  = rk3066_hdmi_encoder_enable,
+   .atomic_disable = rk3066_hdmi_encoder_disable,
 };

 static enum drm_connector_status
--
2.39.2



[PATCH v1 1/4] drm/rockchip: rk3066_hdmi: Remove useless mode_fixup

2023-11-02 Thread Johan Jonker
The mode_fixup implementation doesn't do anything, so we can simply
remove it.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index fa6e592e0276..5c269081c691 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -434,14 +434,6 @@ static void rk3066_hdmi_encoder_disable(struct drm_encoder 
*encoder)
rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A);
 }

-static bool
-rk3066_hdmi_encoder_mode_fixup(struct drm_encoder *encoder,
-  const struct drm_display_mode *mode,
-  struct drm_display_mode *adj_mode)
-{
-   return true;
-}
-
 static int
 rk3066_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
 struct drm_crtc_state *crtc_state,
@@ -459,7 +451,6 @@ static const
 struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = {
.enable   = rk3066_hdmi_encoder_enable,
.disable  = rk3066_hdmi_encoder_disable,
-   .mode_fixup   = rk3066_hdmi_encoder_mode_fixup,
.mode_set = rk3066_hdmi_encoder_mode_set,
.atomic_check = rk3066_hdmi_encoder_atomic_check,
 };
--
2.39.2



[PATCH v1 0/4] Rockchip rk3066_hdmi update

2023-11-02 Thread Johan Jonker
Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Johan Jonker (4):
  drm/rockchip: rk3066_hdmi: Remove useless mode_fixup
  drm/rockchip: rk3066_hdmi: Switch encoder hooks to atomic
  drm/rockchip: rk3066_hdmi: Remove useless output format
  drm/rockchip: rk3066_hdmi: Remove unused drm device pointer

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 66 +++---
 1 file changed, 18 insertions(+), 48 deletions(-)

--
2.39.2



Re: [PATCH v6 01/17] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2023-02-03 Thread Johan Jonker



On 2/3/23 19:21, Rob Herring wrote:
> On Thu, Dec 22, 2022 at 03:22:14PM +0100, Johan Jonker wrote:
>> Convert rockchip-lvds.txt to YAML.
>>
>> Changed:
>>   Add power-domains property.
>>   Requirements between PX30 and RK3288
>>
>> Signed-off-by: Johan Jonker 
>> Reviewed-by: Rob Herring 
>> ---
>>
>> Changed V3:
>>   Filename matching compatible style
>>   Drop "Regulator phandle for "
>>   Specify properties and requirements per SoC
>>   Sort order and restyle
>>
>> Changed V2:
>>   Fix title
>> ---
>>  .../display/rockchip/rockchip,lvds.yaml   | 170 ++
>>  .../display/rockchip/rockchip-lvds.txt|  92 --
>>  2 files changed, 170 insertions(+), 92 deletions(-)
>>  create mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
>>  delete mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
> 

> What's the plan for these patches? Don't see them in linux-next still. 
> Do you want me to take patches 1-8?

Hi,

The display patches normally go through the DRM git.
Patch 2 must merge with grf.yaml.
Heiko has merged now 3 PHY related patches to grf.yaml first.

[PATCH v6 02/17] dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml

See current
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/log/?h=for-next=grep=jonker

Not sure what Heiko's plans are.
Patch 2 replaces  only a description text and some accolades removal, so not 
"too" important.

I urgent then you could merge without conflict:
1, 3-8

Patch 2 requires some adjusted now depending on the grf.yaml current next state.

Johan







> 
> Rob


[PATCH v6 17/17] arm64: dts: rockchip: rk356x: remove hclk from dsi node

2022-12-22 Thread Johan Jonker
The hclk is not used in the dw-mipi-dsi-rockchip.c driver,
so remove hclk from the rk356x.dtsi dsi node.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi 
b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index 5706c3e24..2cb61a783 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -743,8 +743,8 @@
compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x00 0xfe06 0x00 0x1>;
interrupts = ;
-   clock-names = "pclk", "hclk";
-   clocks = < PCLK_DSITX_0>, < HCLK_VO>;
+   clock-names = "pclk";
+   clocks = < PCLK_DSITX_0>;
phy-names = "dphy";
phys = <_dphy0>;
power-domains = < RK3568_PD_VO>;
@@ -771,8 +771,8 @@
compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xfe07 0x0 0x1>;
interrupts = ;
-   clock-names = "pclk", "hclk";
-   clocks = < PCLK_DSITX_1>, < HCLK_VO>;
+   clock-names = "pclk";
+   clocks = < PCLK_DSITX_1>;
phy-names = "dphy";
phys = <_dphy1>;
power-domains = < RK3568_PD_VO>;
--
2.20.1



[PATCH v6 16/17] arm64: dts: rockchip: rename vbus-supply to phy-supply in rk3566-box-demo.dts

2022-12-22 Thread Johan Jonker
'vbus-supply' does not match any of the regexes in rk3566-box-demo.dts
in the usb2phy0_otg node, so rename vbus-supply to phy-supply.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts 
b/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
index 4c7f9abd5..4dc9b7623 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
@@ -464,7 +464,7 @@
 };

 _otg {
-   vbus-supply = <_usb2_otg>;
+   phy-supply = <_usb2_otg>;
status = "okay";
 };

--
2.20.1



[PATCH v6 15/17] arm64: dts: rockchip: rk3399: fix dp node

2022-12-22 Thread Johan Jonker
Use generic node name for rk3399.dtsi dp node.
With the conversion of rockchip,analogix-dp.yaml a port@1 node
is required, so add a node with label edp_out.
Also restyle.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 2250533cf..e02483b72 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -2037,7 +2037,7 @@
};
};

-   edp: edp@ff97 {
+   edp: dp@ff97 {
compatible = "rockchip,rk3399-edp";
reg = <0x0 0xff97 0x0 0x8000>;
interrupts = ;
@@ -2054,6 +2054,7 @@
ports {
#address-cells = <1>;
#size-cells = <0>;
+
edp_in: port@0 {
reg = <0>;
#address-cells = <1>;
@@ -2069,6 +2070,10 @@
remote-endpoint = <_out_edp>;
};
};
+
+   edp_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 14/17] arm64: dts: rockchip: rk3399: fix dsi node

2022-12-22 Thread Johan Jonker
Use generic node name for rk3399.dtsi dsi node.
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label mipi_out.
Also restyle.

Signed-off-by: Johan Jonker 
---

Changed V6:
  Restyle
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 834d16acb..2250533cf 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1954,7 +1954,7 @@
};
};

-   mipi_dsi: mipi@ff96 {
+   mipi_dsi: dsi@ff96 {
compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff96 0x0 0x8000>;
interrupts = ;
@@ -1982,15 +1982,20 @@
reg = <0>;
remote-endpoint = <_out_mipi>;
};
+
mipi_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+   };
};
};

-   mipi_dsi1: mipi@ff968000 {
+   mipi_dsi1: dsi@ff968000 {
compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff968000 0x0 0x8000>;
interrupts = ;
@@ -2025,6 +2030,10 @@
remote-endpoint = <_out_mipi1>;
};
};
+
+   mipi1_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 13/17] arm64: dts: rockchip: px30: fix dsi node

2022-12-22 Thread Johan Jonker
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label dsi_out.
Also add label dsi_in to port@0.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi 
b/arch/arm64/boot/dts/rockchip/px30.dtsi
index e34d81f29..272b01154 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -1117,7 +1117,7 @@
#address-cells = <1>;
#size-cells = <0>;

-   port@0 {
+   dsi_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
@@ -1132,6 +1132,10 @@
remote-endpoint = <_out_dsi>;
};
};
+
+   dsi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 12/17] arm64: dts: rockchip: px30: fix lvds node

2022-12-22 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.
Also add label lvds_in to port@0.

Signed-off-by: Johan Jonker 
---

Changed V5:
  rename title
  add label lvds_in
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi 
b/arch/arm64/boot/dts/rockchip/px30.dtsi
index bfa358042..e34d81f29 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -453,7 +453,7 @@
#address-cells = <1>;
#size-cells = <0>;

-   port@0 {
+   lvds_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
@@ -468,6 +468,10 @@
remote-endpoint = 
<_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};
};
--
2.20.1



[PATCH v6 11/17] ARM: dts: rockchip: rk3288: fix dp node

2022-12-22 Thread Johan Jonker
With the conversion of rockchip,analogix-dp.yaml a port@1 node
is required, so add a node with label edp_out.
Also restyle.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3288.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 9def3988e..4d1bc6784 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1203,19 +1203,26 @@
ports {
#address-cells = <1>;
#size-cells = <0>;
+
edp_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
+
edp_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_edp>;
};
+
edp_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_edp>;
};
};
+
+   edp_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 10/17] ARM: dts: rockchip: rk3288: fix lvds node

2022-12-22 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.
Also restyle.

Signed-off-by: Johan Jonker 
---

Changed V6:
  Restyle

Changed V5:
  Rename title
---
 arch/arm/boot/dts/rk3288.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index fbb174729..9def3988e 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1167,7 +1167,6 @@

lvds_in: port@0 {
reg = <0>;
-
#address-cells = <1>;
#size-cells = <0>;

@@ -1175,11 +1174,16 @@
reg = <0>;
remote-endpoint = <_out_lvds>;
};
+
lvds_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 09/17] ARM: dts: rockchip: rk3288: fix dsi node

2022-12-22 Thread Johan Jonker
Use generic node name for rk3288.dtsi dsi node.
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label mipi_out.
Also restyle.

Signed-off-by: Johan Jonker 
---

Changed V6:
  Restyle
---
 arch/arm/boot/dts/rk3288.dtsi | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 487b0e03d..fbb174729 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1114,7 +1114,7 @@
status = "disabled";
};

-   mipi_dsi: mipi@ff96 {
+   mipi_dsi: dsi@ff96 {
compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff96 0x0 0x4000>;
interrupts = ;
@@ -1125,18 +1125,28 @@
status = "disabled";

ports {
-   mipi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   mipi_in: port@0 {
+   reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
+
mipi_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_mipi>;
};
+
mipi_in_vopl: endpoint@1 {
reg = <1>;
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v6 08/17] dt-bindings: usb: convert fcs,fusb302.txt to yaml

2022-12-22 Thread Johan Jonker
Convert fcs,fusb302.txt to yaml.

Changed:
  Add vbus-supply property

Signed-off-by: Johan Jonker 
---

Changed V6:
  Add unevaluatedProperties
  Drop unused labels
---
 .../devicetree/bindings/usb/fcs,fusb302.txt   | 34 --
 .../devicetree/bindings/usb/fcs,fusb302.yaml  | 67 +++
 2 files changed, 67 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
 create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.yaml

diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt 
b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
deleted file mode 100644
index 60e465429..0
--- a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Fairchild FUSB302 Type-C Port controllers
-
-Required properties :
-- compatible : "fcs,fusb302"
-- reg: I2C slave address
-- interrupts : Interrupt specifier
-
-Required sub-node:
-- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings
-  of the connector node are specified in:
-
-   Documentation/devicetree/bindings/connector/usb-connector.yaml
-
-
-Example:
-
-fusb302: typec-portc@54 {
-   compatible = "fcs,fusb302";
-   reg = <0x54>;
-   interrupt-parent = <_intc>;
-   interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-   usb_con: connector {
-   compatible = "usb-c-connector";
-   label = "USB-C";
-   power-role = "dual";
-   try-power-role = "sink";
-   source-pdos = ;
-   sink-pdos = ;
-   op-sink-microwatt = <1000>;
-   };
-};
diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml 
b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
new file mode 100644
index 0..b396ea0ab
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/fcs,fusb302.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Fairchild FUSB302 Type-C Port controller
+
+maintainers:
+  - Rob Herring 
+
+properties:
+  compatible:
+const: fcs,fusb302
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  vbus-supply:
+description: VBUS power supply
+
+  connector:
+type: object
+$ref: /schemas/connector/usb-connector.yaml#
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vbus-supply
+  - connector
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+
+i2c {
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  typec-portc@54 {
+compatible = "fcs,fusb302";
+reg = <0x54>;
+interrupt-parent = <_intc>;
+interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+vbus-supply = <_typec>;
+
+connector {
+  compatible = "usb-c-connector";
+  label = "USB-C";
+  power-role = "dual";
+  try-power-role = "sink";
+  source-pdos = ;
+  sink-pdos = ;
+  op-sink-microwatt = <1000>;
+};
+  };
+};
--
2.20.1



[PATCH v6 07/17] dt-bindings: display: rockchip: convert analogix_dp-rockchip.txt to yaml

2022-12-22 Thread Johan Jonker
Convert analogix_dp-rockchip.txt to yaml.

Changed:
  Add power-domains property
  File name

Signed-off-by: Johan Jonker 
---
 .../display/rockchip/analogix_dp-rockchip.txt |  98 -
 .../rockchip/rockchip,analogix-dp.yaml| 103 ++
 2 files changed, 103 insertions(+), 98 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
deleted file mode 100644
index 43561584c..0
--- 
a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-Rockchip RK3288 specific extensions to the Analogix Display Port
-
-
-Required properties:
-- compatible: "rockchip,rk3288-dp",
- "rockchip,rk3399-edp";
-
-- reg: physical base address of the controller and length
-
-- clocks: from common clock binding: handle to dp clock.
- of memory mapped region.
-
-- clock-names: from common clock binding:
-  Required elements: "dp" "pclk"
-
-- resets: Must contain an entry for each entry in reset-names.
- See ../reset/reset.txt for details.
-
-- pinctrl-names: Names corresponding to the chip hotplug pinctrl states.
-- pinctrl-0: pin-control mode. should be <_hpd>
-
-- reset-names: Must include the name "dp"
-
-- rockchip,grf: this soc should set GRF regs, so need get grf here.
-
-- ports: there are 2 port nodes with endpoint definitions as defined in
-  Documentation/devicetree/bindings/media/video-interfaces.txt.
-Port 0: contained 2 endpoints, connecting to the output of vop.
-Port 1: contained 1 endpoint, connecting to the input of panel.
-
-Optional property for different chips:
-- clocks: from common clock binding: handle to grf_vio clock.
-
-- clock-names: from common clock binding:
-  Required elements: "grf"
-
-For the below properties, please refer to Analogix DP binding document:
- * Documentation/devicetree/bindings/display/bridge/analogix_dp.txt
-- phys (required)
-- phy-names (required)
-- hpd-gpios (optional)
-- force-hpd (optional)

-
-Example:
-   dp-controller: dp@ff97 {
-   compatible = "rockchip,rk3288-dp";
-   reg = <0xff97 0x4000>;
-   interrupts = ;
-   clocks = < SCLK_EDP>, < PCLK_EDP_CTRL>;
-   clock-names = "dp", "pclk";
-   phys = <_phy>;
-   phy-names = "dp";
-
-   rockchip,grf = <>;
-   resets = < 111>;
-   reset-names = "dp";
-
-   pinctrl-names = "default";
-   pinctrl-0 = <_hpd>;
-
-
-   ports {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   edp_in: port@0 {
-   reg = <0>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-   edp_in_vopb: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_edp>;
-   };
-   edp_in_vopl: endpoint@1 {
-   reg = <1>;
-   remote-endpoint = <_out_edp>;
-   };
-   };
-
-   edp_out: port@1 {
-   reg = <1>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-   edp_out_panel: endpoint {
-   reg = <0>;
-   remote-endpoint = <_in_edp>
-   };
-   };
-   };
-   };
-
-   pinctrl {
-   edp {
-   edp_hpd: edp-hpd {
-   rockchip,pins = <7 11 RK_FUNC_2 
_pull_none>;
-   };
-   };
-   };
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
new file mode 100644
index 0..60dedf9b2
--- /dev/null
+++ 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
@@ -0,0 +1,103 

[PATCH v6 06/17] dt-bindings: display: bridge: convert analogix_dp.txt to yaml

2022-12-22 Thread Johan Jonker
Convert analogix_dp.txt to yaml for use as common document.

Changed:
  Relexed requirements

Signed-off-by: Johan Jonker 
---
 .../bindings/display/bridge/analogix,dp.yaml  | 63 +++
 .../bindings/display/bridge/analogix_dp.txt   | 51 ---
 .../bindings/display/exynos/exynos_dp.txt |  2 +-
 3 files changed, 64 insertions(+), 52 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
 delete mode 100644 
Documentation/devicetree/bindings/display/bridge/analogix_dp.txt

diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml 
b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
new file mode 100644
index 0..c9b06885c
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/analogix,dp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analogix Display Port bridge
+
+maintainers:
+  - Rob Herring 
+
+properties:
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  clocks: true
+
+  clock-names: true
+
+  phys: true
+
+  phy-names:
+const: dp
+
+  force-hpd:
+description:
+  Indicate driver need force hpd when hpd detect failed, this
+  is used for some eDP screen which don not have a hpd signal.
+
+  hpd-gpios:
+description:
+  Hotplug detect GPIO.
+  Indicates which GPIO should be used for hotplug detection
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Input node to receive pixel data.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Port node with one endpoint connected to a dp-connector node.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+  - ports
+
+additionalProperties: true
diff --git a/Documentation/devicetree/bindings/display/bridge/analogix_dp.txt 
b/Documentation/devicetree/bindings/display/bridge/analogix_dp.txt
deleted file mode 100644
index 027d76c27..0
--- a/Documentation/devicetree/bindings/display/bridge/analogix_dp.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-Analogix Display Port bridge bindings
-
-Required properties for dp-controller:
-   -compatible:
-   platform specific such as:
-* "samsung,exynos5-dp"
-* "rockchip,rk3288-dp"
-* "rockchip,rk3399-edp"
-   -reg:
-   physical base address of the controller and length
-   of memory mapped region.
-   -interrupts:
-   interrupt combiner values.
-   -clocks:
-   from common clock binding: handle to dp clock.
-   -clock-names:
-   from common clock binding: Shall be "dp".
-   -phys:
-   from general PHY binding: the phandle for the PHY device.
-   -phy-names:
-   from general PHY binding: Should be "dp".
-
-Optional properties for dp-controller:
-   -force-hpd:
-   Indicate driver need force hpd when hpd detect failed, this
-   is used for some eDP screen which don't have hpd signal.
-   -hpd-gpios:
-   Hotplug detect GPIO.
-   Indicates which GPIO should be used for hotplug detection
-   -port@[X]: SoC specific port nodes with endpoint definitions as defined
-   in Documentation/devicetree/bindings/media/video-interfaces.txt,
-   please refer to the SoC specific binding document:
-   * Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
-   * 
Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
-
-[1]: Documentation/devicetree/bindings/media/video-interfaces.txt

-
-Example:
-
-   dp-controller {
-   compatible = "samsung,exynos5-dp";
-   reg = <0x145b 0x1>;
-   interrupts = <10 3>;
-   interrupt-parent = <>;
-   clocks = < 342>;
-   clock-names = "dp";
-
-   phys = <_phy>;
-   phy-names = "dp";
-   };
diff --git a/Documentation/devicetree/bindings/display/exynos/exynos_dp.txt 
b/Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
index 9b6cba3f8..3a4015903 100644
--- a/Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/display/exynos/exynos_dp.txt
@@ -50,7 +50,7 @@ Optional properties for dp-controller:

Documentation/devicetree/bindings/display/panel/display-timing.txt

 For the

[PATCH v6 05/17] dt-bindings: display: rockchip: convert dw_mipi_dsi_rockchip.txt to yaml

2022-12-22 Thread Johan Jonker
Convert dw_mipi_dsi_rockchip.txt to yaml.

Changed:
  file name
  requirements

Signed-off-by: Johan Jonker 
---

Changed V6:
  Remove clock-master property
  Fix $ref
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  94 --
 .../rockchip/rockchip,dw-mipi-dsi.yaml| 166 ++
 2 files changed, 166 insertions(+), 94 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
deleted file mode 100644
index 9a223df85..0
--- 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-Rockchip specific extensions to the Synopsys Designware MIPI DSI
-
-
-Required properties:
-- #address-cells: Should be <1>.
-- #size-cells: Should be <0>.
-- compatible: one of
-   "rockchip,px30-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi"
-- reg: Represent the physical address range of the controller.
-- interrupts: Represent the controller's interrupt to the CPU(s).
-- clocks, clock-names: Phandles to the controller's pll reference
-  clock(ref) when using an internal dphy and APB clock(pclk).
-  For RK3399, a phy config clock (phy_cfg) and a grf clock(grf)
-  are required. As described in [1].
-- rockchip,grf: this soc should set GRF regs to mux vopl/vopb.
-- ports: contain a port node with endpoint definitions as defined in [2].
-  For vopb,set the reg = <0> and set the reg = <1> for vopl.
-- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
-- video port 1 for either a panel or subsequent encoder
-
-Optional properties:
-- phys: from general PHY binding: the phandle for the PHY device.
-- phy-names: Should be "dphy" if phys references an external phy.
-- #phy-cells: Defined when used as ISP phy, should be 0.
-- power-domains: a phandle to mipi dsi power domain node.
-- resets: list of phandle + reset specifier pairs, as described in [3].
-- reset-names: string reset name, must be "apb".
-
-[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/media/video-interfaces.txt
-[3] Documentation/devicetree/bindings/reset/reset.txt
-
-Example:
-   mipi_dsi: mipi@ff96 {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi";
-   reg = <0xff96 0x4000>;
-   interrupts = ;
-   clocks = < SCLK_MIPI_24M>, < PCLK_MIPI_DSI0>;
-   clock-names = "ref", "pclk";
-   resets = < SRST_MIPIDSI0>;
-   reset-names = "apb";
-   rockchip,grf = <>;
-
-   ports {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_in: port@0 {
-   reg = <0>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_in_vopb: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_mipi>;
-   };
-   mipi_in_vopl: endpoint@1 {
-   reg = <1>;
-   remote-endpoint = <_out_mipi>;
-   };
-   };
-
-   mipi_out: port@1 {
-   reg = <1>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_out_panel: endpoint {
-   remote-endpoint = <_in_mipi>;
-   };
-   };
-   };
-
-   panel {
-   compatible ="boe,tv080wum-nl0";
-   reg = <0>;
-
-   enable-gpios = < 3 GPIO_ACTIVE_HIGH>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_en>;
-   backlight = <>;
-
-   port {
-   panel_in_mipi

[PATCH v6 04/17] dt-bindings: display: bridge: snps, dw-mipi-dsi: fix clock properties

2022-12-22 Thread Johan Jonker
Fix clock properties from the common snps,dw-mipi-dsi.yaml file,
as they don't match with what is used on the SoCs.

Signed-off-by: Johan Jonker 
Reviewed-by: Rob Herring 
---
 .../display/bridge/snps,dw-mipi-dsi.yaml | 16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml 
b/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
index 11fd68a70..0b51c64f1 100644
--- a/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
@@ -26,19 +26,9 @@ properties:
   reg:
 maxItems: 1

-  clocks:
-items:
-  - description: Module clock
-  - description: DSI bus clock for either AHB and APB
-  - description: Pixel clock for the DPI/RGB input
-minItems: 2
-
-  clock-names:
-items:
-  - const: ref
-  - const: pclk
-  - const: px_clk
-minItems: 2
+  clocks: true
+
+  clock-names: true

   resets:
 maxItems: 1
--
2.20.1



[PATCH v6 03/17] dt-bindings: display: dsi-controller: move clock-master property

2022-12-22 Thread Johan Jonker
The clock-master property is used for the controller and not in the panel,
so move it there.

Signed-off-by: Johan Jonker 
---
 .../bindings/display/dsi-controller.yaml   | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/dsi-controller.yaml 
b/Documentation/devicetree/bindings/display/dsi-controller.yaml
index ca21671f6..67ce10307 100644
--- a/Documentation/devicetree/bindings/display/dsi-controller.yaml
+++ b/Documentation/devicetree/bindings/display/dsi-controller.yaml
@@ -30,6 +30,15 @@ properties:
   $nodename:
 pattern: "^dsi(@.*)?$"

+  clock-master:
+type: boolean
+description:
+  Should be enabled if the host is being used in conjunction with
+  another DSI host to drive the same peripheral. Hardware supporting
+  such a configuration generally requires the data on both the busses
+  to be driven by the same clock. Only the DSI host instance
+  controlling this clock should contain this property.
+
   "#address-cells":
 const: 1

@@ -52,15 +61,6 @@ patternProperties:
   case the reg property can take multiple entries, one for each virtual
   channel that the peripheral responds to.

-  clock-master:
-type: boolean
-description:
-  Should be enabled if the host is being used in conjunction with
-  another DSI host to drive the same peripheral. Hardware supporting
-  such a configuration generally requires the data on both the busses
-  to be driven by the same clock. Only the DSI host instance
-  controlling this clock should contain this property.
-
   enforce-video-mode:
 type: boolean
 description:
--
2.20.1



[PATCH v6 02/17] dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml

2022-12-22 Thread Johan Jonker
Add new converted rockchip,lvds.yaml to grf.yaml file.
Prepare for more SoCs with lvds output.

Signed-off-by: Johan Jonker 
Reviewed-by: Rob Herring 
---

Changed V5:
  Drop the quotes
---
 .../devicetree/bindings/soc/rockchip/grf.yaml | 24 +++
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml 
b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index 2ed8cca79..7ac9aa5fa 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -75,13 +75,17 @@ allOf:
   properties:
 compatible:
   contains:
-const: rockchip,px30-grf
+enum:
+  - rockchip,px30-grf

 then:
   properties:
 lvds:
-  description:
-
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+  type: object
+
+  $ref: /schemas/display/rockchip/rockchip,lvds.yaml#
+
+  unevaluatedProperties: false

   - if:
   properties:
@@ -109,7 +113,7 @@ allOf:
 usbphy:
   type: object

-  $ref: "/schemas/phy/rockchip-usb-phy.yaml#"
+  $ref: /schemas/phy/rockchip-usb-phy.yaml#

   unevaluatedProperties: false

@@ -124,14 +128,14 @@ allOf:
 gpio:
   type: object

-  $ref: "/schemas/gpio/rockchip,rk3328-grf-gpio.yaml#"
+  $ref: /schemas/gpio/rockchip,rk3328-grf-gpio.yaml#

   unevaluatedProperties: false

 power-controller:
   type: object

-  $ref: "/schemas/power/rockchip,power-controller.yaml#"
+  $ref: /schemas/power/rockchip,power-controller.yaml#

   unevaluatedProperties: false

@@ -146,7 +150,7 @@ allOf:
 mipi-dphy-rx0:
   type: object

-  $ref: "/schemas/phy/rockchip-mipi-dphy-rx0.yaml#"
+  $ref: /schemas/phy/rockchip-mipi-dphy-rx0.yaml#

   unevaluatedProperties: false

@@ -174,7 +178,7 @@ allOf:
 reboot-mode:
   type: object

-  $ref: "/schemas/power/reset/syscon-reboot-mode.yaml#"
+  $ref: /schemas/power/reset/syscon-reboot-mode.yaml#

   unevaluatedProperties: false

@@ -200,7 +204,7 @@ allOf:
 "usb2phy@[0-9a-f]+$":
   type: object

-  $ref: "/schemas/phy/phy-rockchip-inno-usb2.yaml#"
+  $ref: /schemas/phy/phy-rockchip-inno-usb2.yaml#

   unevaluatedProperties: false

@@ -228,7 +232,7 @@ allOf:
 io-domains:
   type: object

-  $ref: "/schemas/power/rockchip-io-domain.yaml#"
+  $ref: /schemas/power/rockchip-io-domain.yaml#

   unevaluatedProperties: false

--
2.20.1



[PATCH v6 01/17] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-22 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
Reviewed-by: Rob Herring 
---

Changed V3:
  Filename matching compatible style
  Drop "Regulator phandle for "
  Specify properties and requirements per SoC
  Sort order and restyle

Changed V2:
  Fix title
---
 .../display/rockchip/rockchip,lvds.yaml   | 170 ++
 .../display/rockchip/rockchip-lvds.txt|  92 --
 2 files changed, 170 insertions(+), 92 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
new file mode 100644
index 0..03b002a05
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,px30-lvds
+  - rockchip,rk3288-lvds
+
+  reg:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: pclk_lvds
+
+  avdd1v0-supply:
+description: 1.0V analog power.
+
+  avdd1v8-supply:
+description: 1.8V analog power.
+
+  avdd3v3-supply:
+description: 3.3V analog power.
+
+  rockchip,grf:
+$ref: /schemas/types.yaml#/definitions/phandle
+description: Phandle to the general register files syscon.
+
+  rockchip,output:
+$ref: /schemas/types.yaml#/definitions/string
+enum: [rgb, lvds, duallvds]
+description: This describes the output interface.
+
+  phys:
+maxItems: 1
+
+  phy-names:
+const: dphy
+
+  pinctrl-names:
+const: lcdc
+
+  pinctrl-0: true
+
+  power-domains:
+maxItems: 1
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 0 for the VOP input.
+  The remote endpoint maybe vopb or vopl.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 1 for either a panel or subsequent encoder.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - rockchip,grf
+  - rockchip,output
+  - ports
+
+allOf:
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,px30-lvds
+
+then:
+  properties:
+reg: false
+clocks: false
+clock-names: false
+avdd1v0-supply: false
+avdd1v8-supply: false
+avdd3v3-supply: false
+
+  required:
+- phys
+- phy-names
+
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,rk3288-lvds
+
+then:
+  properties:
+phys: false
+phy-names: false
+
+  required:
+- reg
+- clocks
+- clock-names
+- avdd1v0-supply
+- avdd1v8-supply
+- avdd3v3-supply
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+lvds: lvds@ff96c000 {
+  compatible = "rockchip,rk3288-lvds";
+  reg = <0xff96c000 0x4000>;
+  clocks = < PCLK_LVDS_PHY>;
+  clock-names = "pclk_lvds";
+  avdd1v0-supply = <_lcd>;
+  avdd1v8-supply = <_lcd>;
+  avdd3v3-supply = <_33>;
+  pinctrl-names = "lcdc";
+  pinctrl-0 = <_ctl>;
+  rockchip,grf = <>;
+  rockchip,output = "rgb";
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+lvds_in: port@0 {
+  reg = <0>;
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  lvds_in_vopb: endpoint@0 {
+reg = <0>;
+remote-endpoint = <_out_lvds>;
+  };
+  lvds_in_vopl: endpoint@1 {
+reg = <1>;
+remote-endpoint = <_out_lvds>;
+  };
+};
+
+lvds_out: port@1 {
+  reg = <1>;
+
+  lvds_out_panel: endpoint {
+remote-endpoint = <_in_lvds>;
+  };
+};
+  };
+};
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchi

[PATCH v5 12/12] arm64: dts: rockchip: rk356x: remove hclk from dsi node

2022-12-21 Thread Johan Jonker
The hclk is not used in the dw-mipi-dsi-rockchip.c driver,
so remove hclk from the rk356x.dtsi dsi node.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi 
b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index 5706c3e24..2cb61a783 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -743,8 +743,8 @@
compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x00 0xfe06 0x00 0x1>;
interrupts = ;
-   clock-names = "pclk", "hclk";
-   clocks = < PCLK_DSITX_0>, < HCLK_VO>;
+   clock-names = "pclk";
+   clocks = < PCLK_DSITX_0>;
phy-names = "dphy";
phys = <_dphy0>;
power-domains = < RK3568_PD_VO>;
@@ -771,8 +771,8 @@
compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xfe07 0x0 0x1>;
interrupts = ;
-   clock-names = "pclk", "hclk";
-   clocks = < PCLK_DSITX_1>, < HCLK_VO>;
+   clock-names = "pclk";
+   clocks = < PCLK_DSITX_1>;
phy-names = "dphy";
phys = <_dphy1>;
power-domains = < RK3568_PD_VO>;
--
2.20.1



[PATCH v5 11/12] arm64: dts: rockchip: rename vbus-supply to phy-supply in rk3566-box-demo.dts

2022-12-21 Thread Johan Jonker
'vbus-supply' does not match any of the regexes in rk3566-box-demo.dts
in the usb2phy0_otg node, so rename vbus-supply to phy-supply.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts 
b/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
index 4c7f9abd5..4dc9b7623 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
@@ -464,7 +464,7 @@
 };

 _otg {
-   vbus-supply = <_usb2_otg>;
+   phy-supply = <_usb2_otg>;
status = "okay";
 };

--
2.20.1



[PATCH v5 10/12] arm64: dts: rockchip: rk3399: fix dsi node

2022-12-21 Thread Johan Jonker
Use generic node name for rk3399.dtsi dsi node.
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label mipi_out.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 834d16acb..62047a5a0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1954,7 +1954,7 @@
};
};

-   mipi_dsi: mipi@ff96 {
+   mipi_dsi: dsi@ff96 {
compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff96 0x0 0x8000>;
interrupts = ;
@@ -1987,10 +1987,14 @@
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+   };
};
};

-   mipi_dsi1: mipi@ff968000 {
+   mipi_dsi1: dsi@ff968000 {
compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff968000 0x0 0x8000>;
interrupts = ;
@@ -2025,6 +2029,10 @@
remote-endpoint = <_out_mipi1>;
};
};
+
+   mipi1_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v5 09/12] arm64: dts: rockchip: px30: fix dsi node

2022-12-21 Thread Johan Jonker
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label dsi_out.
Also add label dsi_in to port@0.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi 
b/arch/arm64/boot/dts/rockchip/px30.dtsi
index e34d81f29..272b01154 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -1117,7 +1117,7 @@
#address-cells = <1>;
#size-cells = <0>;

-   port@0 {
+   dsi_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
@@ -1132,6 +1132,10 @@
remote-endpoint = <_out_dsi>;
};
};
+
+   dsi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v5 08/12] arm64: dts: rockchip: px30: fix lvds node

2022-12-21 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.
Also add label lvds_in to port@0.

Signed-off-by: Johan Jonker 
---

Changed V5:
  rename title
  add label lvds_in
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi 
b/arch/arm64/boot/dts/rockchip/px30.dtsi
index bfa358042..e34d81f29 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -453,7 +453,7 @@
#address-cells = <1>;
#size-cells = <0>;

-   port@0 {
+   lvds_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
@@ -468,6 +468,10 @@
remote-endpoint = 
<_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};
};
--
2.20.1



[PATCH v5 07/12] ARM: dts: rockchip: rk3288: fix lvds node

2022-12-21 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.

Signed-off-by: Johan Jonker 
---

Changed V5:
  rename title
---
 arch/arm/boot/dts/rk3288.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index c22f90e53..cedaa633d 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1174,6 +1174,10 @@
remote-endpoint = <_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v5 06/12] ARM: dts: rockchip: rk3288: fix dsi node

2022-12-21 Thread Johan Jonker
Use generic node name for rk3288.dtsi dsi node.
With the conversion of rockchip,dw-mipi-dsi.yaml a port@1 node
is required, so add a node with label mipi_out.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3288.dtsi | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 487b0e03d..c22f90e53 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1114,7 +1114,7 @@
status = "disabled";
};

-   mipi_dsi: mipi@ff96 {
+   mipi_dsi: dsi@ff96 {
compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi";
reg = <0x0 0xff96 0x0 0x4000>;
interrupts = ;
@@ -1137,6 +1137,10 @@
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v5 05/12] dt-bindings: usb: convert fcs,fusb302.txt to yaml

2022-12-21 Thread Johan Jonker
Convert fcs,fusb302.txt to yaml.

Changed:
  Add vbus-supply property

Signed-off-by: Johan Jonker 
---
 .../devicetree/bindings/usb/fcs,fusb302.txt   | 34 --
 .../devicetree/bindings/usb/fcs,fusb302.yaml  | 66 +++
 2 files changed, 66 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
 create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.yaml

diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt 
b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
deleted file mode 100644
index 60e465429..0
--- a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Fairchild FUSB302 Type-C Port controllers
-
-Required properties :
-- compatible : "fcs,fusb302"
-- reg: I2C slave address
-- interrupts : Interrupt specifier
-
-Required sub-node:
-- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings
-  of the connector node are specified in:
-
-   Documentation/devicetree/bindings/connector/usb-connector.yaml
-
-
-Example:
-
-fusb302: typec-portc@54 {
-   compatible = "fcs,fusb302";
-   reg = <0x54>;
-   interrupt-parent = <_intc>;
-   interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-   usb_con: connector {
-   compatible = "usb-c-connector";
-   label = "USB-C";
-   power-role = "dual";
-   try-power-role = "sink";
-   source-pdos = ;
-   sink-pdos = ;
-   op-sink-microwatt = <1000>;
-   };
-};
diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml 
b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
new file mode 100644
index 0..9b172fda9
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.yaml
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/fcs,fusb302.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Fairchild FUSB302 Type-C Port controller
+
+maintainers:
+  - Rob Herring 
+
+properties:
+  compatible:
+const: fcs,fusb302
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  vbus-supply:
+description: VBUS power supply
+
+  connector:
+type: object
+$ref: /schemas/connector/usb-connector.yaml#
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vbus-supply
+  - connector
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+
+i2c {
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  fusb302: typec-portc@54 {
+compatible = "fcs,fusb302";
+reg = <0x54>;
+interrupt-parent = <_intc>;
+interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+vbus-supply = <_typec>;
+
+usb_con: connector {
+  compatible = "usb-c-connector";
+  label = "USB-C";
+  power-role = "dual";
+  try-power-role = "sink";
+  source-pdos = ;
+  sink-pdos = ;
+  op-sink-microwatt = <1000>;
+};
+  };
+};
--
2.20.1



[PATCH v5 04/12] dt-bindings: display: rockchip: convert dw_mipi_dsi_rockchip.txt to yaml

2022-12-21 Thread Johan Jonker
Convert dw_mipi_dsi_rockchip.txt to yaml.

Changed:
  add clock-master property
  file name
  requirements

Signed-off-by: Johan Jonker 
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  94 --
 .../rockchip/rockchip,dw-mipi-dsi.yaml| 173 ++
 2 files changed, 173 insertions(+), 94 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
deleted file mode 100644
index 9a223df85..0
--- 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-Rockchip specific extensions to the Synopsys Designware MIPI DSI
-
-
-Required properties:
-- #address-cells: Should be <1>.
-- #size-cells: Should be <0>.
-- compatible: one of
-   "rockchip,px30-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi"
-   "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi"
-- reg: Represent the physical address range of the controller.
-- interrupts: Represent the controller's interrupt to the CPU(s).
-- clocks, clock-names: Phandles to the controller's pll reference
-  clock(ref) when using an internal dphy and APB clock(pclk).
-  For RK3399, a phy config clock (phy_cfg) and a grf clock(grf)
-  are required. As described in [1].
-- rockchip,grf: this soc should set GRF regs to mux vopl/vopb.
-- ports: contain a port node with endpoint definitions as defined in [2].
-  For vopb,set the reg = <0> and set the reg = <1> for vopl.
-- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
-- video port 1 for either a panel or subsequent encoder
-
-Optional properties:
-- phys: from general PHY binding: the phandle for the PHY device.
-- phy-names: Should be "dphy" if phys references an external phy.
-- #phy-cells: Defined when used as ISP phy, should be 0.
-- power-domains: a phandle to mipi dsi power domain node.
-- resets: list of phandle + reset specifier pairs, as described in [3].
-- reset-names: string reset name, must be "apb".
-
-[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/media/video-interfaces.txt
-[3] Documentation/devicetree/bindings/reset/reset.txt
-
-Example:
-   mipi_dsi: mipi@ff96 {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi";
-   reg = <0xff96 0x4000>;
-   interrupts = ;
-   clocks = < SCLK_MIPI_24M>, < PCLK_MIPI_DSI0>;
-   clock-names = "ref", "pclk";
-   resets = < SRST_MIPIDSI0>;
-   reset-names = "apb";
-   rockchip,grf = <>;
-
-   ports {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_in: port@0 {
-   reg = <0>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_in_vopb: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_mipi>;
-   };
-   mipi_in_vopl: endpoint@1 {
-   reg = <1>;
-   remote-endpoint = <_out_mipi>;
-   };
-   };
-
-   mipi_out: port@1 {
-   reg = <1>;
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   mipi_out_panel: endpoint {
-   remote-endpoint = <_in_mipi>;
-   };
-   };
-   };
-
-   panel {
-   compatible ="boe,tv080wum-nl0";
-   reg = <0>;
-
-   enable-gpios = < 3 GPIO_ACTIVE_HIGH>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_en>;
-   backlight = <>;
-
-   port {
-   panel_in_mipi: endpoint {
-

[PATCH v5 03/12] dt-bindings: display: bridge: snps, dw-mipi-dsi: fix clock properties

2022-12-21 Thread Johan Jonker
Fix clock properties from the common snps,dw-mipi-dsi.yaml file,
as they don't match with what is used on the SoCs.

Signed-off-by: Johan Jonker 
---
 .../display/bridge/snps,dw-mipi-dsi.yaml | 16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml 
b/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
index 11fd68a70..0b51c64f1 100644
--- a/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/snps,dw-mipi-dsi.yaml
@@ -26,19 +26,9 @@ properties:
   reg:
 maxItems: 1

-  clocks:
-items:
-  - description: Module clock
-  - description: DSI bus clock for either AHB and APB
-  - description: Pixel clock for the DPI/RGB input
-minItems: 2
-
-  clock-names:
-items:
-  - const: ref
-  - const: pclk
-  - const: px_clk
-minItems: 2
+  clocks: true
+
+  clock-names: true

   resets:
 maxItems: 1
--
2.20.1



[PATCH v5 02/12] dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml

2022-12-21 Thread Johan Jonker
Add new converted rockchip,lvds.yaml to grf.yaml file.
Prepare for more SoCs with lvds output.

Signed-off-by: Johan Jonker 
Reviewed-by: Rob Herring 
---

Changed V5:
  Drop the quotes
---
 .../devicetree/bindings/soc/rockchip/grf.yaml | 24 +++
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml 
b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index 2ed8cca79..7ac9aa5fa 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -75,13 +75,17 @@ allOf:
   properties:
 compatible:
   contains:
-const: rockchip,px30-grf
+enum:
+  - rockchip,px30-grf

 then:
   properties:
 lvds:
-  description:
-
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+  type: object
+
+  $ref: /schemas/display/rockchip/rockchip,lvds.yaml#
+
+  unevaluatedProperties: false

   - if:
   properties:
@@ -109,7 +113,7 @@ allOf:
 usbphy:
   type: object

-  $ref: "/schemas/phy/rockchip-usb-phy.yaml#"
+  $ref: /schemas/phy/rockchip-usb-phy.yaml#

   unevaluatedProperties: false

@@ -124,14 +128,14 @@ allOf:
 gpio:
   type: object

-  $ref: "/schemas/gpio/rockchip,rk3328-grf-gpio.yaml#"
+  $ref: /schemas/gpio/rockchip,rk3328-grf-gpio.yaml#

   unevaluatedProperties: false

 power-controller:
   type: object

-  $ref: "/schemas/power/rockchip,power-controller.yaml#"
+  $ref: /schemas/power/rockchip,power-controller.yaml#

   unevaluatedProperties: false

@@ -146,7 +150,7 @@ allOf:
 mipi-dphy-rx0:
   type: object

-  $ref: "/schemas/phy/rockchip-mipi-dphy-rx0.yaml#"
+  $ref: /schemas/phy/rockchip-mipi-dphy-rx0.yaml#

   unevaluatedProperties: false

@@ -174,7 +178,7 @@ allOf:
 reboot-mode:
   type: object

-  $ref: "/schemas/power/reset/syscon-reboot-mode.yaml#"
+  $ref: /schemas/power/reset/syscon-reboot-mode.yaml#

   unevaluatedProperties: false

@@ -200,7 +204,7 @@ allOf:
 "usb2phy@[0-9a-f]+$":
   type: object

-  $ref: "/schemas/phy/phy-rockchip-inno-usb2.yaml#"
+  $ref: /schemas/phy/phy-rockchip-inno-usb2.yaml#

   unevaluatedProperties: false

@@ -228,7 +232,7 @@ allOf:
 io-domains:
   type: object

-  $ref: "/schemas/power/rockchip-io-domain.yaml#"
+  $ref: /schemas/power/rockchip-io-domain.yaml#

   unevaluatedProperties: false

--
2.20.1



[PATCH v5 01/12] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-21 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
Reviewed-by: Rob Herring 
---

Changed V3:
  Filename matching compatible style
  Drop "Regulator phandle for "
  Specify properties and requirements per SoC
  Sort order and restyle

Changed V2:
  Fix title
---
 .../display/rockchip/rockchip,lvds.yaml   | 170 ++
 .../display/rockchip/rockchip-lvds.txt|  92 --
 2 files changed, 170 insertions(+), 92 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
new file mode 100644
index 0..03b002a05
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,px30-lvds
+  - rockchip,rk3288-lvds
+
+  reg:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: pclk_lvds
+
+  avdd1v0-supply:
+description: 1.0V analog power.
+
+  avdd1v8-supply:
+description: 1.8V analog power.
+
+  avdd3v3-supply:
+description: 3.3V analog power.
+
+  rockchip,grf:
+$ref: /schemas/types.yaml#/definitions/phandle
+description: Phandle to the general register files syscon.
+
+  rockchip,output:
+$ref: /schemas/types.yaml#/definitions/string
+enum: [rgb, lvds, duallvds]
+description: This describes the output interface.
+
+  phys:
+maxItems: 1
+
+  phy-names:
+const: dphy
+
+  pinctrl-names:
+const: lcdc
+
+  pinctrl-0: true
+
+  power-domains:
+maxItems: 1
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 0 for the VOP input.
+  The remote endpoint maybe vopb or vopl.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 1 for either a panel or subsequent encoder.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - rockchip,grf
+  - rockchip,output
+  - ports
+
+allOf:
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,px30-lvds
+
+then:
+  properties:
+reg: false
+clocks: false
+clock-names: false
+avdd1v0-supply: false
+avdd1v8-supply: false
+avdd3v3-supply: false
+
+  required:
+- phys
+- phy-names
+
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,rk3288-lvds
+
+then:
+  properties:
+phys: false
+phy-names: false
+
+  required:
+- reg
+- clocks
+- clock-names
+- avdd1v0-supply
+- avdd1v8-supply
+- avdd3v3-supply
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+lvds: lvds@ff96c000 {
+  compatible = "rockchip,rk3288-lvds";
+  reg = <0xff96c000 0x4000>;
+  clocks = < PCLK_LVDS_PHY>;
+  clock-names = "pclk_lvds";
+  avdd1v0-supply = <_lcd>;
+  avdd1v8-supply = <_lcd>;
+  avdd3v3-supply = <_33>;
+  pinctrl-names = "lcdc";
+  pinctrl-0 = <_ctl>;
+  rockchip,grf = <>;
+  rockchip,output = "rgb";
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+lvds_in: port@0 {
+  reg = <0>;
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  lvds_in_vopb: endpoint@0 {
+reg = <0>;
+remote-endpoint = <_out_lvds>;
+  };
+  lvds_in_vopl: endpoint@1 {
+reg = <1>;
+remote-endpoint = <_out_lvds>;
+  };
+};
+
+lvds_out: port@1 {
+  reg = <1>;
+
+  lvds_out_panel: endpoint {
+remote-endpoint = <_in_lvds>;
+  };
+};
+  };
+};
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchi

[PATCH v4 5/5] arm64: dts: rockchip: px30: add lvds_out node

2022-12-19 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi 
b/arch/arm64/boot/dts/rockchip/px30.dtsi
index bfa358042..eb414d0f8 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -468,6 +468,10 @@
remote-endpoint = 
<_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};
};
--
2.20.1



[PATCH v4 4/5] ARM: dts: rockchip: rk3288: add lvds_out node

2022-12-19 Thread Johan Jonker
With the conversion of rockchip,lvds.yaml a port@1 node
is required, so add a node with label lvds_out.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3288.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 487b0e03d..60207136f 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -1170,6 +1170,10 @@
remote-endpoint = <_out_lvds>;
};
};
+
+   lvds_out: port@1 {
+   reg = <1>;
+   };
};
};

--
2.20.1



[PATCH v4 3/5] dt-bindings: phy: add port node to phy-rockchip-inno-usb2.yaml

2022-12-19 Thread Johan Jonker
On Rockchip rk3399 a port node with one endpoint can be connected
to a USB Type-C connector node.
Add a port node to the phy-rockchip-inno-usb2.yaml file.

Signed-off-by: Johan Jonker 
---
 .../devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml  | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml 
b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml
index f71920082..ffc7e7560 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml
@@ -115,6 +115,11 @@ properties:
 required:
   - "#phy-cells"

+  port:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Port node with one endpoint connected to a USB Type-C connector node.
+
 required:
   - compatible
   - reg
--
2.20.1



[PATCH v4 2/5] dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml

2022-12-19 Thread Johan Jonker
Add new converted rockchip,lvds.yaml to grf.yaml file.
Prepare for more SoCs with lvds output.

Signed-off-by: Johan Jonker 
---
 .../devicetree/bindings/soc/rockchip/grf.yaml  | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml 
b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index 2ed8cca79..d74295e98 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -75,13 +75,17 @@ allOf:
   properties:
 compatible:
   contains:
-const: rockchip,px30-grf
+enum:
+  - rockchip,px30-grf

 then:
   properties:
 lvds:
-  description:
-
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+  type: object
+
+  $ref: "/schemas/display/rockchip/rockchip,lvds.yaml#"
+
+  unevaluatedProperties: false

   - if:
   properties:
--
2.20.1



[PATCH v4 1/5] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-19 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
---

Changed V3:
  Filename matching compatible style
  Drop "Regulator phandle for "
  Specify properties and requirements per SoC
  Sort order and restyle

Changed V2:
  Fix title
---
 .../display/rockchip/rockchip,lvds.yaml   | 170 ++
 .../display/rockchip/rockchip-lvds.txt|  92 --
 2 files changed, 170 insertions(+), 92 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
new file mode 100644
index 0..03b002a05
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,px30-lvds
+  - rockchip,rk3288-lvds
+
+  reg:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: pclk_lvds
+
+  avdd1v0-supply:
+description: 1.0V analog power.
+
+  avdd1v8-supply:
+description: 1.8V analog power.
+
+  avdd3v3-supply:
+description: 3.3V analog power.
+
+  rockchip,grf:
+$ref: /schemas/types.yaml#/definitions/phandle
+description: Phandle to the general register files syscon.
+
+  rockchip,output:
+$ref: /schemas/types.yaml#/definitions/string
+enum: [rgb, lvds, duallvds]
+description: This describes the output interface.
+
+  phys:
+maxItems: 1
+
+  phy-names:
+const: dphy
+
+  pinctrl-names:
+const: lcdc
+
+  pinctrl-0: true
+
+  power-domains:
+maxItems: 1
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 0 for the VOP input.
+  The remote endpoint maybe vopb or vopl.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 1 for either a panel or subsequent encoder.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - rockchip,grf
+  - rockchip,output
+  - ports
+
+allOf:
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,px30-lvds
+
+then:
+  properties:
+reg: false
+clocks: false
+clock-names: false
+avdd1v0-supply: false
+avdd1v8-supply: false
+avdd3v3-supply: false
+
+  required:
+- phys
+- phy-names
+
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,rk3288-lvds
+
+then:
+  properties:
+phys: false
+phy-names: false
+
+  required:
+- reg
+- clocks
+- clock-names
+- avdd1v0-supply
+- avdd1v8-supply
+- avdd3v3-supply
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+lvds: lvds@ff96c000 {
+  compatible = "rockchip,rk3288-lvds";
+  reg = <0xff96c000 0x4000>;
+  clocks = < PCLK_LVDS_PHY>;
+  clock-names = "pclk_lvds";
+  avdd1v0-supply = <_lcd>;
+  avdd1v8-supply = <_lcd>;
+  avdd3v3-supply = <_33>;
+  pinctrl-names = "lcdc";
+  pinctrl-0 = <_ctl>;
+  rockchip,grf = <>;
+  rockchip,output = "rgb";
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+lvds_in: port@0 {
+  reg = <0>;
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  lvds_in_vopb: endpoint@0 {
+reg = <0>;
+remote-endpoint = <_out_lvds>;
+  };
+  lvds_in_vopl: endpoint@1 {
+reg = <1>;
+remote-endpoint = <_out_lvds>;
+  };
+};
+
+lvds_out: port@1 {
+  reg = <1>;
+
+  lvds_out_panel: endpoint {
+remote-endpoint = <_in_lvds>;
+  };
+};
+  };
+};
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchip RK3288 LVDS interface
-===

Re: [PATCH v3] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-19 Thread Johan Jonker



On 12/19/22 14:04, Krzysztof Kozlowski wrote:
> On 19/12/2022 13:32, Johan Jonker wrote:
>> Convert rockchip-lvds.txt to YAML.
>>
>> Changed:
>>   Add power-domains property.
>>   Requirements between PX30 and RK3288
>>
>> Signed-off-by: Johan Jonker 
>> ---
>>
>> Changed V3:
>>   Filename matching compatible style
>>   Drop "Regulator phandle for "
>>   Specify properties and requirements per SoC
>>   Sort order and restyle
>>
>> Changed V2:
>>   Fix title
>> ---
>>  .../display/rockchip/rockchip,lvds.yaml   | 170 ++
>>  .../display/rockchip/rockchip-lvds.txt|  92 --
>>  2 files changed, 170 insertions(+), 92 deletions(-)
>>  create mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
>>  delete mode 100644 
>> Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml 
>> b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
>> new file mode 100644
>> index 0..03b002a05
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
>> @@ -0,0 +1,170 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/display/rockchip/rockchip,lvds.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Rockchip low-voltage differential signal (LVDS) transmitter
>> +
>> +maintainers:
>> +  - Sandy Huang 
>> +  - Heiko Stuebner 
>> +
>> +properties:
>> +  compatible:
>> +enum:
>> +  - rockchip,px30-lvds
>> +  - rockchip,rk3288-lvds
>> +
>> +  reg:
>> +maxItems: 1
>> +
>> +  clocks:
>> +maxItems: 1
>> +
>> +  clock-names:
>> +const: pclk_lvds
>> +
>> +  avdd1v0-supply:
>> +description: 1.0V analog power.
>> +
>> +  avdd1v8-supply:
>> +description: 1.8V analog power.
>> +
>> +  avdd3v3-supply:
>> +description: 3.3V analog power.
>> +
>> +  rockchip,grf:
>> +$ref: /schemas/types.yaml#/definitions/phandle
>> +description: Phandle to the general register files syscon.
>> +
>> +  rockchip,output:
>> +$ref: /schemas/types.yaml#/definitions/string
>> +enum: [rgb, lvds, duallvds]
>> +description: This describes the output interface.
>> +
>> +  phys:
>> +maxItems: 1
>> +
>> +  phy-names:
>> +const: dphy
>> +
>> +  pinctrl-names:
>> +const: lcdc
>> +
>> +  pinctrl-0: true
>> +
>> +  power-domains:
>> +maxItems: 1
>> +
>> +  ports:
>> +$ref: /schemas/graph.yaml#/properties/ports
>> +
>> +properties:
>> +  port@0:
>> +$ref: /schemas/graph.yaml#/properties/port
>> +description:
>> +  Video port 0 for the VOP input.
>> +  The remote endpoint maybe vopb or vopl.
>> +
>> +  port@1:
>> +$ref: /schemas/graph.yaml#/properties/port
>> +description:
>> +  Video port 1 for either a panel or subsequent encoder.
>> +
>> +required:
>> +  - port@0
>> +  - port@1
>> +
>> +required:
>> +  - compatible
>> +  - rockchip,grf
>> +  - rockchip,output
>> +  - ports
>> +
>> +allOf:
>> +  - if:
>> +  properties:
>> +compatible:
>> +  contains:
>> +const: rockchip,px30-lvds
>> +
>> +then:
>> +  properties:
>> +reg: false
>> +clocks: false
>> +clock-names: false
>> +avdd1v0-supply: false
>> +avdd1v8-supply: false
>> +avdd3v3-supply: false
>> +
> 

> I see one compatible expects regmap from parent (grf is the parent here)
> and other is directly on MMIO bus. Not the best combination... Maybe
> this  should be just split to two separate bindings? Looking at driver,
> their code is also very different between these two variants.

Looking at the manufacturer tree we can expect the rest with grf parent, but 
also in the same driver combined with different registers and common probe.
Due to common probe I prefer one common document.

Johan

===

https://github.com/rockchip-linux/kernel/blob/develop-5.10/drivers/gpu/drm/rockchip/rockchip_lvds.c#L671


rockchip,rk3126-lvds
https://github.com/rockchip-linux/kernel/blob/develop-5.10/arch/arm/boot/dts/rk312x.dtsi#L914

rockchip,rk3368-lvds
https://github.com/rockchip-linux/kernel/blob/develop-4.4/arch/arm64/boot/dts/rockchip/rk3368.dtsi#L1196

rockchip,rk3568-lvds
https://github.com/rockchip-linux/kernel/blob/develop-5.10/arch/arm64/boot/dts/rockchip/rk3568.dtsi#L734

> 
> Best regards,
> Krzysztof
> 


[PATCH v3] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-19 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
---

Changed V3:
  Filename matching compatible style
  Drop "Regulator phandle for "
  Specify properties and requirements per SoC
  Sort order and restyle

Changed V2:
  Fix title
---
 .../display/rockchip/rockchip,lvds.yaml   | 170 ++
 .../display/rockchip/rockchip-lvds.txt|  92 --
 2 files changed, 170 insertions(+), 92 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
new file mode 100644
index 0..03b002a05
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,lvds.yaml
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,px30-lvds
+  - rockchip,rk3288-lvds
+
+  reg:
+maxItems: 1
+
+  clocks:
+maxItems: 1
+
+  clock-names:
+const: pclk_lvds
+
+  avdd1v0-supply:
+description: 1.0V analog power.
+
+  avdd1v8-supply:
+description: 1.8V analog power.
+
+  avdd3v3-supply:
+description: 3.3V analog power.
+
+  rockchip,grf:
+$ref: /schemas/types.yaml#/definitions/phandle
+description: Phandle to the general register files syscon.
+
+  rockchip,output:
+$ref: /schemas/types.yaml#/definitions/string
+enum: [rgb, lvds, duallvds]
+description: This describes the output interface.
+
+  phys:
+maxItems: 1
+
+  phy-names:
+const: dphy
+
+  pinctrl-names:
+const: lcdc
+
+  pinctrl-0: true
+
+  power-domains:
+maxItems: 1
+
+  ports:
+$ref: /schemas/graph.yaml#/properties/ports
+
+properties:
+  port@0:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 0 for the VOP input.
+  The remote endpoint maybe vopb or vopl.
+
+  port@1:
+$ref: /schemas/graph.yaml#/properties/port
+description:
+  Video port 1 for either a panel or subsequent encoder.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - rockchip,grf
+  - rockchip,output
+  - ports
+
+allOf:
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,px30-lvds
+
+then:
+  properties:
+reg: false
+clocks: false
+clock-names: false
+avdd1v0-supply: false
+avdd1v8-supply: false
+avdd3v3-supply: false
+
+  required:
+- phys
+- phy-names
+
+  - if:
+  properties:
+compatible:
+  contains:
+const: rockchip,rk3288-lvds
+
+then:
+  properties:
+phys: false
+phy-names: false
+
+  required:
+- reg
+- clocks
+- clock-names
+- avdd1v0-supply
+- avdd1v8-supply
+- avdd3v3-supply
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+lvds: lvds@ff96c000 {
+  compatible = "rockchip,rk3288-lvds";
+  reg = <0xff96c000 0x4000>;
+  clocks = < PCLK_LVDS_PHY>;
+  clock-names = "pclk_lvds";
+  avdd1v0-supply = <_lcd>;
+  avdd1v8-supply = <_lcd>;
+  avdd3v3-supply = <_33>;
+  pinctrl-names = "lcdc";
+  pinctrl-0 = <_ctl>;
+  rockchip,grf = <>;
+  rockchip,output = "rgb";
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+lvds_in: port@0 {
+  reg = <0>;
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  lvds_in_vopb: endpoint@0 {
+reg = <0>;
+remote-endpoint = <_out_lvds>;
+  };
+  lvds_in_vopl: endpoint@1 {
+reg = <1>;
+remote-endpoint = <_out_lvds>;
+  };
+};
+
+lvds_out: port@1 {
+  reg = <1>;
+
+  lvds_out_panel: endpoint {
+remote-endpoint = <_in_lvds>;
+  };
+};
+  };
+};
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchip RK3288 LVDS interface
-===

[PATCH v2] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-17 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
---

Changed V2:
  Fix title
---
 .../display/rockchip/rockchip-lvds.txt|  92 --
 .../display/rockchip/rockchip-lvds.yaml   | 157 ++
 2 files changed, 157 insertions(+), 92 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchip RK3288 LVDS interface
-
-
-Required properties:
-- compatible: matching the soc type, one of
-   - "rockchip,rk3288-lvds";
-   - "rockchip,px30-lvds";
-
-- reg: physical base address of the controller and length
-   of memory mapped region.
-- clocks: must include clock specifiers corresponding to entries in the
-   clock-names property.
-- clock-names: must contain "pclk_lvds"
-
-- avdd1v0-supply: regulator phandle for 1.0V analog power
-- avdd1v8-supply: regulator phandle for 1.8V analog power
-- avdd3v3-supply: regulator phandle for 3.3V analog power
-
-- rockchip,grf: phandle to the general register files syscon
-- rockchip,output: "rgb", "lvds" or "duallvds", This describes the output 
interface
-
-- phys: LVDS/DSI DPHY (px30 only)
-- phy-names: name of the PHY, must be "dphy" (px30 only)
-
-Optional properties:
-- pinctrl-names: must contain a "lcdc" entry.
-- pinctrl-0: pin control group to be used for this controller.
-
-Required nodes:
-
-The lvds has two video ports as described by
-   Documentation/devicetree/bindings/media/video-interfaces.txt
-Their connections are modeled using the OF graph bindings specified in
-   Documentation/devicetree/bindings/graph.txt.
-
-- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
-- video port 1 for either a panel or subsequent encoder
-
-Example:
-
-lvds_panel: lvds-panel {
-   compatible = "auo,b101ean01";
-   enable-gpios = < 21 GPIO_ACTIVE_HIGH>;
-   data-mapping = "jeida-24";
-
-   ports {
-   panel_in_lvds: endpoint {
-   remote-endpoint = <_out_panel>;
-   };
-   };
-};
-
-For Rockchip RK3288:
-
-   lvds: lvds@ff96c000 {
-   compatible = "rockchip,rk3288-lvds";
-   rockchip,grf = <>;
-   reg = <0xff96c000 0x4000>;
-   clocks = < PCLK_LVDS_PHY>;
-   clock-names = "pclk_lvds";
-   pinctrl-names = "lcdc";
-   pinctrl-0 = <_ctl>;
-   avdd1v0-supply = <_lcd>;
-   avdd1v8-supply = <_lcd>;
-   avdd3v3-supply = <_33>;
-   rockchip,output = "rgb";
-   ports {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   lvds_in: port@0 {
-   reg = <0>;
-
-   lvds_in_vopb: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_lvds>;
-   };
-   lvds_in_vopl: endpoint@1 {
-   reg = <1>;
-   remote-endpoint = <_out_lvds>;
-   };
-   };
-
-   lvds_out: port@1 {
-   reg = <1>;
-
-   lvds_out_panel: endpoint {
-   remote-endpoint = <_in_lvds>;
-   };
-   };
-   };
-   };
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml
new file mode 100644
index 0..f05901633
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml
@@ -0,0 +1,157 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+  - rockchip,px30-lvds
+  - rockch

[PATCH v1] dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML

2022-12-17 Thread Johan Jonker
Convert rockchip-lvds.txt to YAML.

Changed:
  Add power-domains property.
  Requirements between PX30 and RK3288

Signed-off-by: Johan Jonker 
---
 .../display/rockchip/rockchip-lvds.txt|  92 --
 .../display/rockchip/rockchip-lvds.yaml   | 159 ++
 2 files changed, 159 insertions(+), 92 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
 create mode 100644 
Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
deleted file mode 100644
index aaf8c44cf..0
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-Rockchip RK3288 LVDS interface
-
-
-Required properties:
-- compatible: matching the soc type, one of
-   - "rockchip,rk3288-lvds";
-   - "rockchip,px30-lvds";
-
-- reg: physical base address of the controller and length
-   of memory mapped region.
-- clocks: must include clock specifiers corresponding to entries in the
-   clock-names property.
-- clock-names: must contain "pclk_lvds"
-
-- avdd1v0-supply: regulator phandle for 1.0V analog power
-- avdd1v8-supply: regulator phandle for 1.8V analog power
-- avdd3v3-supply: regulator phandle for 3.3V analog power
-
-- rockchip,grf: phandle to the general register files syscon
-- rockchip,output: "rgb", "lvds" or "duallvds", This describes the output 
interface
-
-- phys: LVDS/DSI DPHY (px30 only)
-- phy-names: name of the PHY, must be "dphy" (px30 only)
-
-Optional properties:
-- pinctrl-names: must contain a "lcdc" entry.
-- pinctrl-0: pin control group to be used for this controller.
-
-Required nodes:
-
-The lvds has two video ports as described by
-   Documentation/devicetree/bindings/media/video-interfaces.txt
-Their connections are modeled using the OF graph bindings specified in
-   Documentation/devicetree/bindings/graph.txt.
-
-- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
-- video port 1 for either a panel or subsequent encoder
-
-Example:
-
-lvds_panel: lvds-panel {
-   compatible = "auo,b101ean01";
-   enable-gpios = < 21 GPIO_ACTIVE_HIGH>;
-   data-mapping = "jeida-24";
-
-   ports {
-   panel_in_lvds: endpoint {
-   remote-endpoint = <_out_panel>;
-   };
-   };
-};
-
-For Rockchip RK3288:
-
-   lvds: lvds@ff96c000 {
-   compatible = "rockchip,rk3288-lvds";
-   rockchip,grf = <>;
-   reg = <0xff96c000 0x4000>;
-   clocks = < PCLK_LVDS_PHY>;
-   clock-names = "pclk_lvds";
-   pinctrl-names = "lcdc";
-   pinctrl-0 = <_ctl>;
-   avdd1v0-supply = <_lcd>;
-   avdd1v8-supply = <_lcd>;
-   avdd3v3-supply = <_33>;
-   rockchip,output = "rgb";
-   ports {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   lvds_in: port@0 {
-   reg = <0>;
-
-   lvds_in_vopb: endpoint@0 {
-   reg = <0>;
-   remote-endpoint = <_out_lvds>;
-   };
-   lvds_in_vopl: endpoint@1 {
-   reg = <1>;
-   remote-endpoint = <_out_lvds>;
-   };
-   };
-
-   lvds_out: port@1 {
-   reg = <1>;
-
-   lvds_out_panel: endpoint {
-   remote-endpoint = <_in_lvds>;
-   };
-   };
-   };
-   };
diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml
new file mode 100644
index 0..13e12f4b5
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.yaml
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip SoC display controller (VOP)
+
+description: Rockchip low-voltage differential signal (LVDS) transmitter
+
+maintainers:
+  - Sandy Huang 
+  - Heiko Stuebner 
+
+properties:
+  compatible:
+enum:
+ 

[PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function

2022-10-19 Thread Johan Jonker
The function rockchip_drm_framebuffer_init() was in use
in the rockchip_drm_fbdev.c file, but that is now replaced
by a generic fbdev setup. Reduce the image size by
removing the rockchip_drm_framebuffer_init() and sub function
rockchip_fb_alloc() and cleanup the rockchip_drm_fb.h header file.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 43 --
 drivers/gpu/drm/rockchip/rockchip_drm_fb.h |  6 ---
 2 files changed, 49 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 092bf863110b..409eaa1bf092 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -25,35 +25,6 @@ static const struct drm_framebuffer_funcs 
rockchip_drm_fb_funcs = {
.dirty = drm_atomic_helper_dirtyfb,
 };
 
-static struct drm_framebuffer *
-rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 
*mode_cmd,
- struct drm_gem_object **obj, unsigned int num_planes)
-{
-   struct drm_framebuffer *fb;
-   int ret;
-   int i;
-
-   fb = kzalloc(sizeof(*fb), GFP_KERNEL);
-   if (!fb)
-   return ERR_PTR(-ENOMEM);
-
-   drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
-
-   for (i = 0; i < num_planes; i++)
-   fb->obj[i] = obj[i];
-
-   ret = drm_framebuffer_init(dev, fb, _drm_fb_funcs);
-   if (ret) {
-   DRM_DEV_ERROR(dev->dev,
- "Failed to initialize framebuffer: %d\n",
- ret);
-   kfree(fb);
-   return ERR_PTR(ret);
-   }
-
-   return fb;
-}
-
 static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers 
= {
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
@@ -106,20 +77,6 @@ static const struct drm_mode_config_funcs 
rockchip_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
 };
 
-struct drm_framebuffer *
-rockchip_drm_framebuffer_init(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd,
- struct drm_gem_object *obj)
-{
-   struct drm_framebuffer *fb;
-
-   fb = rockchip_fb_alloc(dev, mode_cmd, , 1);
-   if (IS_ERR(fb))
-   return ERR_CAST(fb);
-
-   return fb;
-}
-
 void rockchip_drm_mode_config_init(struct drm_device *dev)
 {
dev->mode_config.min_width = 0;
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
index 1a696521096d..bae4e079dfb1 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
@@ -7,11 +7,5 @@
 #ifndef _ROCKCHIP_DRM_FB_H
 #define _ROCKCHIP_DRM_FB_H
 
-struct drm_framebuffer *
-rockchip_drm_framebuffer_init(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd,
- struct drm_gem_object *obj);
-void rockchip_drm_framebuffer_fini(struct drm_framebuffer *fb);
-
 void rockchip_drm_mode_config_init(struct drm_device *dev);
 #endif /* _ROCKCHIP_DRM_FB_H */
-- 
2.20.1



Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup

2022-10-17 Thread Johan Jonker



On 10/17/22 21:00, John Keeping wrote:
> On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote:
>>
>>
>> On 10/17/22 13:29, Heiko Stuebner wrote:
>>> Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping:
>>>> Hi Johan,
>>>>
>>>> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote:
>>>>> Your patch contribution causes a kernel panic on MK808 with Rockchip 
>>>>> rk3066a SoC.
>>>>> Would you like to contribute to fix this issue?
>>>>> The assumtion that drm_fbdev_generic_setup() does what 
>>>>> rockchip_drm_fbdev_init did is not true!
>>>>> A revert makes it work again.
>>>>
>>
>>>> It looks like there are 3 different ways to end up with -ENOMEM here,
>>>> can you track down whether you're hitting one of the cases in
>>>> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in
>>>> drm_gem_vmap()?
>>
>> It looks like it comes from rockchip_gem_prime_vmap() second return (2).
>>
>>
>>  if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) {
>>
>> 
>>
>>  printk("FBDEV rockchip_gem_prime_vmap 2");
>>
>> 
>>  return -ENOMEM;
>>  }
> 
> Ah-ha, Heiko was right that this is because the no-iommu path is broken
> as a result of switching to the generic fbdev code.
> 
> This patch should fix it, but I wonder if Thomas has any ideas about a
> better way to handle this since it feels a bit hacky to special-case the
> fb_helper inside the GEM code:

The penguin is back on screen. Thanks!

> 
> -- >8 --
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c 
> b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index 614e97aaac80..da8a69953706 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file 
> *file_priv,
>  {
>   struct rockchip_gem_object *rk_obj;
>   struct drm_gem_object *obj;
> + bool is_framebuffer;
>   int ret;
>  
> - rk_obj = rockchip_gem_create_object(drm, size, false);
> + is_framebuffer = drm->fb_helper && file_priv == 
> drm->fb_helper->client.file;
> +
> + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer);
>   if (IS_ERR(rk_obj))
>   return ERR_CAST(rk_obj);
> -- 8< -- 


Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup

2022-10-17 Thread Johan Jonker



On 10/17/22 13:29, Heiko Stuebner wrote:
> Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping:
>> Hi Johan,
>>
>> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote:
>>> Your patch contribution causes a kernel panic on MK808 with Rockchip 
>>> rk3066a SoC.
>>> Would you like to contribute to fix this issue?
>>> The assumtion that drm_fbdev_generic_setup() does what 
>>> rockchip_drm_fbdev_init did is not true!
>>> A revert makes it work again.
>>

>> It looks like there are 3 different ways to end up with -ENOMEM here,
>> can you track down whether you're hitting one of the cases in
>> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in
>> drm_gem_vmap()?

It looks like it comes from rockchip_gem_prime_vmap() second return (2).





int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
{
struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);

if (rk_obj->pages) {
void *vaddr = vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP,
  pgprot_writecombine(PAGE_KERNEL));
if (!vaddr) {
printk("FBDEV rockchip_gem_prime_vmap 1");
return -ENOMEM;
}
iosys_map_set_vaddr(map, vaddr);
return 0;
}

if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) {



printk("FBDEV rockchip_gem_prime_vmap 2");


return -ENOMEM;
}
iosys_map_set_vaddr(map, rk_obj->kvaddr);

return 0;
}



[7.678392] [drm:drm_client_modeset_probe] connector 39 enabled? yes
[7.678435] [drm:drm_client_modeset_probe] Not using firmware configuration
[7.678465] [drm:drm_client_modeset_probe] looking for cmdline mode on 
connector 39
[7.678494] [drm:drm_client_modeset_probe] looking for preferred mode on 
connector 39 0
[7.678521] [drm:drm_client_modeset_probe] found mode 1920x1080
[7.678545] [drm:drm_client_modeset_probe] picking CRTCs for 1920x1080 config
[7.678585] [drm:drm_client_modeset_probe] desired mode 1920x1080 set on 
crtc 35 (0,0)
[7.801673] Console: switching to colour frame buffer device 240x67


[7.811047] FBDEV rockchip_gem_prime_vmap 2


[7.811071] [ cut here ]
[7.811084] WARNING: CPU: 0 PID: 35 at drivers/gpu/drm/drm_fb_helper.c:471 
drm_fb_helper_damage_work+0x138/0x3b4
[7.811198] rockchip-drm display-subsystem: Damage blitter failed: ret=-12
[7.811219] Modules linked in:
[7.811244] CPU: 0 PID: 35 Comm: kworker/0:4 Not tainted 
6.0.0-next-20221013+ #46
[7.811281] Hardware name: Rockchip (Device Tree)
[7.811300] Workqueue: events drm_fb_helper_damage_work
[7.811352] Backtrace: 
[7.811370]  dump_backtrace from show_stack+0x20/0x24
[7.811431]  r7:01d7 r6:0009 r5:c0b2bc60 r4:6013
[7.811444]  show_stack from dump_stack_lvl+0x48/0x54
[7.811512]  dump_stack_lvl from dump_stack+0x18/0x1c
[7.811580]  r5:c0586064 r4:c0b6374c
[7.811590]  dump_stack from __warn+0xdc/0x154
[7.811677]  __warn from warn_slowpath_fmt+0xa4/0xd8
[7.811740]  r7:01d7 r6:c0b6374c r5:c1004ec8 r4:c0b639e8
[7.811750]  warn_slowpath_fmt from drm_fb_helper_damage_work+0x138/0x3b4
[7.811821]  r9:ef7cf105 r8:c15dfc00 r7:fff4 r6:c200b490 r5:c1004ec8 
r4:c200b494
[7.811833]  drm_fb_helper_damage_work from process_one_work+0x230/0x518
[7.811912]  r10:c110d140 r9:ef7cf105 r8: r7:ef7cf100 r6:ef7cbf00 
r5:c200e300
[7.811927]  r4:c200b494
[7.811936]  process_one_work from worker_thread+0x54/0x554
[7.811991]  r10:ef7cbf00 r9:0008 r8:c1003d40 r7:ef7cbf1c r6:c200e318 
r5:ef7cbf00
[7.812006]  r4:c200e300
[7.812015]  worker_thread from kthread+0xe8/0x104
[7.812100]  r10:f0929e84 r9:c200da00 r8:c169aa80 r7:c200e300 r6:c01419e4 
r5:
[7.812114]  r4:c200d780
[7.812124]  kthread from ret_from_fork+0x14/0x2c
[7.812178] Exception stack(0xf092dfb0 to 0xf092dff8)
[7.812205] dfa0:   
 
[7.812232] dfc0:       
 
[7.812255] dfe0:     0013 
[7.812282]  r10: r9: r8: r7: r6: 
r5:c01491a8
[7.812299]  r4:c200d780 r3:0001
[7.812309] ---[ end trace  ]---
[7.812336] FBDEV rockchip_gem_prime_vmap 2
[7.889795] FBDEV rockchip_gem_prime_vmap 2
[7.890418] FBDEV rockchip_gem_prime_vmap 2
[7.899447] FBDEV rockchip_gem_prime_vmap 2
[7.905252] FBDEV rockchip_gem_prime_vmap 2

>>
>> I guess the memory usage increases slightly using the generic code and
>> RK3066 has less memory available.
> 
> also rk3066 and rk3188 do not have an iommu, so rely
> on cma allocations.
> 
> 
> Heiko
> 
> 


[BUG] [PATCH] drm/rockchip: use generic fbdev setup

2022-10-17 Thread Johan Jonker
Hi John,

Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a 
SoC.
Would you like to contribute to fix this issue?
The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init 
did is not true!
A revert makes it work again.

Johan

==

[7.975906] [ cut here ]
[7.975929] WARNING: CPU: 0 PID: 35 at drivers/gpu/drm/drm_fb_helper.c:471 
drm_fb_helper_damage_work+0x138/0x3b4
[7.976044] rockchip-drm display-subsystem: Damage blitter failed: ret=-12
[7.976064] Modules linked in:
[7.976090] CPU: 0 PID: 35 Comm: kworker/0:4 Not tainted 6.0.0-next-20221013 
#1
[7.976126] Hardware name: Rockchip (Device Tree)
[7.976145] Workqueue: events drm_fb_helper_damage_work
[7.976196] Backtrace: 
[7.976214]  dump_backtrace from show_stack+0x20/0x24
[7.976276]  r7:01d7 r6:0009 r5:c0b2bc78 r4:6013
[7.976289]  show_stack from dump_stack_lvl+0x48/0x54
[7.976357]  dump_stack_lvl from dump_stack+0x18/0x1c
[7.976426]  r5:c0586054 r4:c0b63750
[7.976436]  dump_stack from __warn+0xdc/0x154
[7.976525]  __warn from warn_slowpath_fmt+0xa4/0xd8
[7.976588]  r7:01d7 r6:c0b63750 r5:c1004ec8 r4:c0b639ec
[7.976598]  warn_slowpath_fmt from drm_fb_helper_damage_work+0x138/0x3b4
[7.976670]  r9:ef7cf105 r8:c15dfc00 r7:fff4 r6:c200a590 r5:c1004ec8 
r4:c200a594
[7.976681]  drm_fb_helper_damage_work from process_one_work+0x230/0x518
[7.976761]  r10:c110d140 r9:ef7cf105 r8: r7:ef7cf100 r6:ef7cbf00 
r5:c200f300
[7.976775]  r4:c200a594
[7.976785]  process_one_work from worker_thread+0x54/0x554
[7.976841]  r10:ef7cbf00 r9:0008 r8:c1003d40 r7:ef7cbf1c r6:c200f318 
r5:ef7cbf00
[7.976855]  r4:c200f300
[7.976864]  worker_thread from kthread+0xe8/0x104
[7.976948]  r10:f0929e84 r9:c200ea40 r8:c169aa80 r7:c200f300 r6:c01419e4 
r5:
[7.976962]  r4:c200e800
[7.976971]  kthread from ret_from_fork+0x14/0x2c
[7.977026] Exception stack(0xf092dfb0 to 0xf092dff8)
[7.977052] dfa0:   
 
[7.977078] dfc0:       
 
[7.977100] dfe0:     0013 
[7.977128]  r10: r9: r8: r7: r6: 
r5:c01491a8
[7.977144]  r4:c200e800 r3:0001
[7.977155] ---[ end trace  ]---

On 10/29/21 13:50, John Keeping wrote:
> The Rockchip fbdev code does not add anything compared to
> drm_fbdev_generic_setup(); the one custom function for .fb_mmap does the
> same thing as gem_prime_mmap which is called by the helper.
> 
> Signed-off-by: John Keeping 
> ---
>  drivers/gpu/drm/rockchip/Makefile |   1 -
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c   |  10 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.h   |   2 -
>  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 164 --
>  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h |  24 ---
>  5 files changed, 2 insertions(+), 199 deletions(-)
>  delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
>  delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h
> 
> diff --git a/drivers/gpu/drm/rockchip/Makefile 
> b/drivers/gpu/drm/rockchip/Makefile
> index 17a9e7eb2130..1a56f696558c 100644
> --- a/drivers/gpu/drm/rockchip/Makefile
> +++ b/drivers/gpu/drm/rockchip/Makefile
> @@ -5,7 +5,6 @@
>  
>  rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o \
>   rockchip_drm_gem.o rockchip_drm_vop.o rockchip_vop_reg.o
> -rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o
>  
>  rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
>  rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
> b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index 69c699459dce..20d81ae69828 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -26,7 +26,6 @@
>  
>  #include "rockchip_drm_drv.h"
>  #include "rockchip_drm_fb.h"
> -#include "rockchip_drm_fbdev.h"
>  #include "rockchip_drm_gem.h"
>  
>  #define DRIVER_NAME  "rockchip"
> @@ -159,10 +158,6 @@ static int rockchip_drm_bind(struct device *dev)
>  
>   drm_mode_config_reset(drm_dev);
>  
> - ret = rockchip_drm_fbdev_init(drm_dev);
> - if (ret)
> - goto err_unbind_all;
> -
>   /* init kms poll for handling hpd */
>   drm_kms_helper_poll_init(drm_dev);
>  
> @@ -170,10 +165,11 @@ static int rockchip_drm_bind(struct device *dev)
>   if (ret)
>   goto err_kms_helper_poll_fini;
>  
> + drm_fbdev_generic_setup(drm_dev, 32);
> +
>   return 0;
>  err_kms_helper_poll_fini:
>   drm_kms_helper_poll_fini(drm_dev);
> - rockchip_drm_fbdev_fini(drm_dev);
>  err_unbind_all:
>   

Re: [PATCH v5 19/23] arm64: dts: rockchip: rk3568-evb: Enable VOP2 and hdmi

2022-02-10 Thread Johan Jonker



On 2/10/22 12:47, Sascha Hauer wrote:
> On Thu, Feb 10, 2022 at 01:10:32AM +0100, Johan Jonker wrote:
>> Hi Sascha,
>>
>> Something with port and endpoint gives notifications.
>> Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
>> options were checked/covered (see rk3328 and rk3568).
>>
>> Allow multiple vop:
>> port or
>> port@0
>> 1x vop -> endpoint
>>
>> 2x vop -> endpoint@0
>>-> endpoint@1
>>
>> Also allow for connector:
>> (not all existing DT have this yet)
>> port@1
>>   -> endpoint
>>
>> See also at graph.yaml
> 
> Ok, let me see if I get this right. The HDMI can either have one or two
> ports. It has one when the HDMI connector is not described in the device
> tree and two when it is. Also the first (or only) port can have one or
> two endpoints. It has one endpoint when the SoC has a single VOP and two
> endpoints when the SoC has two VOPs.
> 
> It's been a painful morning because my YAML knowledge is fairly limited,
> but here's what I came up with:
> 
>   ports:
> $ref: /schemas/graph.yaml#/properties/ports
> unevaluatedProperties: false
> patternProperties:
>   "^port(@0)?$":
> $ref: /schemas/graph.yaml#/properties/port
> description: Input of the DWC HDMI TX
> properties:
>   endpoint:
> description: Connection to the VOP
>   endpoint@0:
> description: Connection to the VOPB
>   endpoint@1:
> description: Connection to the VOPL
> properties:
>   port@1:
> $ref: /schemas/graph.yaml#/properties/port
> description: Output of the DWC HDMI TX
> 
> Does this look sane to you? With this a make dtbs_check on this binding
> doesn't generate warnings anymore, and even better it does generate
> warnings when I add some wrong nodes/properties to the dts files.

Hi,

Send a patch to rob+dt and he will let you know... ;)

Also could you test the ARM branch as well just for sure with:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make  dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

Could you group your serie a bit:
dt-bindings
drm patches
dts changes

Johan

> 
>> ===
>>
>> dtc -I dtb -O dts rk3568-evb1-v10.dtb
>> : Warning (avoid_unnecessary_addr_size):
>> /hdmi@fe0a/ports/port@1: unnecessary #address-cells/#size-cells
>> without "ranges" or child "reg" property
>> : Warning (graph_child_address): /hdmi@fe0a/ports/port@0:
>> graph node has single child node 'endpoint@0',
>> #address-cells/#size-cells are not necessary
>> : Warning (graph_child_address): /hdmi@fe0a/ports/port@1:
>> graph node has single child node 'endpoint', #address-cells/#size-cells
>> are not necessary
> 
> That's easy. I dropped the @0 suffix and reg property from the node.
> 
> Sascha
> 


Re: [PATCH v5 19/23] arm64: dts: rockchip: rk3568-evb: Enable VOP2 and hdmi

2022-02-09 Thread Johan Jonker
Hi Sascha,

Something with port and endpoint gives notifications.
Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
options were checked/covered (see rk3328 and rk3568).

Allow multiple vop:
port or
port@0
1x vop -> endpoint

2x vop -> endpoint@0
   -> endpoint@1

Also allow for connector:
(not all existing DT have this yet)
port@1
  -> endpoint

See also at graph.yaml
===

dtc -I dtb -O dts rk3568-evb1-v10.dtb
: Warning (avoid_unnecessary_addr_size):
/hdmi@fe0a/ports/port@1: unnecessary #address-cells/#size-cells
without "ranges" or child "reg" property
: Warning (graph_child_address): /hdmi@fe0a/ports/port@0:
graph node has single child node 'endpoint@0',
#address-cells/#size-cells are not necessary
: Warning (graph_child_address): /hdmi@fe0a/ports/port@1:
graph node has single child node 'endpoint', #address-cells/#size-cells
are not necessary

===

ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

  DTC arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml
  CHECK   arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml
/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml: hdmi@fe0a:
ports: 'port' is a required property
From schema:
/home/user/Downloads/linux-next-20220202/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
  DTC arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml
  CHECK   arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml
/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml: hdmi@fe0a:
ports: 'port' is a required property
From schema:
/home/user/Downloads/linux-next-20220202/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

===

On 2/9/22 10:53, Sascha Hauer wrote:
> This enabled the VOP2 display controller along with hdmi and the
> required port routes which is enough to get a picture out of the
> hdmi port of the board.
> 
> Signed-off-by: Sascha Hauer 
> ---
> 
> Notes:
> Changes since v4:
> - Sort nodes alphabetically
> 
> Changes since v3:
> - Fix HDMI connector type
> 
>  .../boot/dts/rockchip/rk3568-evb1-v10.dts | 48 +++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts 
> b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> index 184e2aa2416a..18f0f5abddcf 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> @@ -7,6 +7,7 @@
>  /dts-v1/;
>  #include 
>  #include 
> +#include 
>  #include "rk3568.dtsi"
>  
>  / {
> @@ -33,6 +34,17 @@ dc_12v: dc-12v {
>   regulator-max-microvolt = <1200>;
>   };
>  
> + hdmi-con {
> + compatible = "hdmi-connector";
> + type = "a";
> +
> + port {
> + hdmi_con_in: endpoint {
> + remote-endpoint = <_out_con>;
> + };
> + };
> + };
> +
>   vcc3v3_sys: vcc3v3-sys {
>   compatible = "regulator-fixed";
>   regulator-name = "vcc3v3_sys";
> @@ -106,6 +118,25 @@ _rgmii_clk
>   status = "okay";
>  };
>  
> + {
> + avdd-0v9-supply = <_image>;
> + avdd-1v8-supply = <_image>;
> + status = "okay";
> +};
> +
> +_in {
> + hdmi_in_vp0: endpoint@0 {
> + reg = <0>;
> + remote-endpoint = <_out_hdmi>;
> + };
> +};
> +
> +_out {
> + hdmi_out_con: endpoint {
> + remote-endpoint = <_con_in>;
> + };
> +};
> +
>   {
>   status = "okay";
>  
> @@ -390,3 +421,20 @@  {
>   {
>   status = "okay";
>  };
> +
> + {
> + assigned-clocks = < DCLK_VOP0>, < DCLK_VOP1>;
> + assigned-clock-parents = < PLL_HPLL>, < PLL_VPLL>;
> + status = "okay";
> +};
> +
> +_mmu {
> + status = "okay";
> +};
> +
> + {
> + vp0_out_hdmi: endpoint@RK3568_VOP2_EP_HDMI {
> + reg = ;
> + remote-endpoint = <_in_vp0>;
> + };
> +};


Re: [PATCH 13/18] arm64: dts: rockchip: rk3568-evb: Enable VOP2 and hdmi

2021-12-08 Thread Johan Jonker
Hi,

Could add a patch version to the subject?

On 12/8/21 4:12 PM, Sascha Hauer wrote:
> This enabled the VOP2 display controller along with hdmi and the
> required port routes which is enough to get a picture out of the
> hdmi port of the board.
> 
> Signed-off-by: Sascha Hauer 
> ---
>  .../boot/dts/rockchip/rk3568-evb1-v10.dts | 31 +++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts 
> b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> index 184e2aa2416af..b1b0963fa8525 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> @@ -7,6 +7,7 @@
>  /dts-v1/;
>  #include 
>  #include 
> +#include 
>  #include "rk3568.dtsi"
>  
>  / {
> @@ -106,6 +107,12 @@ _rgmii_clk
>   status = "okay";
>  };
>  
> + {

> + status = "okay";
> + avdd-0v9-supply = <_image>;
> + avdd-1v8-supply = <_image>;

status below

> +};

===
Example from rk3066a-mk808.dts
In dtsi:
hdmi {
ports {
#address-cells = <1>;
#size-cells = <0>;
hdmi_in: port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
};

hdmi_out: port@1 {
reg = <1>;
};

===
In dts:
hdmi-con {
compatible = "hdmi-connector";
type = "c";

port {
hdmi_con_in: endpoint {
remote-endpoint = <_out_con>;
};
};
};

===

_out {
hdmi_out_con: endpoint {
remote-endpoint = <_con_in>;
};
};

===

> +
>   {
>   status = "okay";
>  
> @@ -390,3 +397,27 @@  {
>   {
>   status = "okay";
>  };
> +
> + {

> + status = "okay";
> + assigned-clocks = < DCLK_VOP0>, < DCLK_VOP1>;
> + assigned-clock-parents = < PLL_HPLL>, < PLL_VPLL>;

status below

> +};
> +
> +_mmu {
> + status = "okay";
> +};
> +
> +_in {
> + hdmi_in_vp0: endpoint@0 {
> + reg = <0>;
> + remote-endpoint = <_out_hdmi>;
> + };
> +};
> +
> + {
> + vp0_out_hdmi: endpoint@RK3568_VOP2_EP_HDMI {
> + reg = ;
> + remote-endpoint = <_in_vp0>;
> + };
> +};
> 


Re: [PATCH 17/18] drm: rockchip: Add VOP2 driver

2021-12-08 Thread Johan Jonker
Hi,

On 12/8/21 4:12 PM, Sascha Hauer wrote:
> From: Andy Yan 
> 
> The VOP2 unit is found on Rockchip SoCs beginning with rk3566/rk3568.
> It replaces the VOP unit found in the older Rockchip SoCs.
> 
> This driver has been derived from the downstream Rockchip Kernel and
> heavily modified:
> 
> - All nonstandard DRM properties have been removed
> - dropped struct vop2_plane_state and pass around less data between
>   functions
> - Dropped all DRM_FORMAT_* not known on upstream
> - rework register access to get rid of excessively used macros
> - Drop all waiting for framesyncs
> 
> The driver is tested with HDMI and MIPI-DSI display on a RK3568-EVB
> board. Overlay support is tested with the modetest utility. AFBC support
> on the cluster windows is tested with weston-simple-dmabuf-egl on
> weston using the (yet to be upstreamed) panfrost driver support.
> 
> Signed-off-by: Sascha Hauer 
> ---

[..]

> +
> +static const struct of_device_id vop2_dt_match[] = {
> + {
> + .compatible = "rockchip,rk3568-vop",
> + .data = _vop
> + }, {

> + .compatible = "rockchip,rk3568-vop",

Maybe use:
.compatible = "rockchip,rk3566-vop",

> + .data = _vop
> + }, {
> + },

Maybe sort this list alphabetical based on compatible in case later more
SoCs are added.

rk3566
rk3568

===

The structure layout size above could be reduced for if we get more
compatible strings additions.

Example vop1:

static const struct of_device_id vop_driver_dt_match[] = {
{ .compatible = "rockchip,rk3036-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3126-vop",
  .data = _vop },
{ .compatible = "rockchip,px30-vop-big",
  .data = _vop_big },
{ .compatible = "rockchip,px30-vop-lit",
  .data = _vop_lit },
{ .compatible = "rockchip,rk3066-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3188-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3288-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3368-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3366-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3399-vop-big",
  .data = _vop_big },
{ .compatible = "rockchip,rk3399-vop-lit",
  .data = _vop_lit },
{ .compatible = "rockchip,rk3228-vop",
  .data = _vop },
{ .compatible = "rockchip,rk3328-vop",
  .data = _vop },
{},
};

> +};
> +MODULE_DEVICE_TABLE(of, vop2_dt_match);
> +
> +static int vop2_probe(struct platform_device *pdev)
> +{
> + struct device *dev = >dev;
> +
> + return component_add(dev, _component_ops);
> +}
> +
> +static int vop2_remove(struct platform_device *pdev)
> +{
> + component_del(>dev, _component_ops);
> +
> + return 0;
> +}
> +
> +struct platform_driver vop2_platform_driver = {
> + .probe = vop2_probe,
> + .remove = vop2_remove,
> + .driver = {
> + .name = "rockchip-vop2",
> + .of_match_table = of_match_ptr(vop2_dt_match),
> + },
> +};
> 


Re: [PATCH 08/12] arm64: dts: rockchip: rk356x: Add VOP2 nodes

2021-11-25 Thread Johan Jonker
Hi Sascha,


On 11/17/21 3:33 PM, Sascha Hauer wrote:
> The VOP2 is the display output controller on the RK3568. Add the node
> for it to the dtsi file along with the required display-subsystem node
> and the iommu node.
> 
> Signed-off-by: Sascha Hauer 
> ---
>  arch/arm64/boot/dts/rockchip/rk356x.dtsi | 52 
>  1 file changed, 52 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi 
> b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
> index 46d9552f60284..6ebf7c14e096a 100644
> --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
> @@ -447,6 +447,58 @@ gmac1_mtl_tx_setup: tx-queues-config {
>   };
>   };
>  

> + display_subsystem: display-subsystem {
> + compatible = "rockchip,display-subsystem";
> + ports = <_out>;
> + };

Some DT sort rules:

For nodes:
Sort things without reg alphabetical first,
then sort the rest by reg address.

> +
> + vop: vop@fe04 {

> + compatible = "rockchip,rk3568-vop";

>From rockchip-vop2.yaml:
+properties:
+  compatible:
+enum:

+  - rockchip,rk3568-vop
+  - rockchip,rk3566-vop

Maybe sort yaml compatibles in alphabetical order.

rockchip,rk3566-vop is not used in the dtsi I think.

Comment by Andy Yan:
> 
> But take care that the vop on rk3566 has a special limitation: there are 
> three
> 
> windows(Cluster1/Esmart1/Smart1) that have a mirror lock, that means they
> 
> can't be programed framebuffer address independently , they can only
> 
> share framebuffer address with Cluster0/Esmart0/Smart0.

Question:
Given Andy's comment could someone explain weather the vop and hdmi
nodes should be in rk3566.dtsi and rk3568.dtsi with an extra
rockchip,rk3566-dw-hdmi compatible?

> + reg = <0x0 0xfe04 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>;
> + reg-names = "regs", "gamma_lut";

> + rockchip,grf = <>;
Heiko's sort rules:

compatible
reg
interrupts
[alphabetical]
status [if needed]

> + interrupts = ;
> + clocks = < ACLK_VOP>, < HCLK_VOP>, < DCLK_VOP0>, 
> < DCLK_VOP1>, < DCLK_VOP2>;
> + clock-names = "aclk_vop", "hclk_vop", "dclk_vp0", "dclk_vp1", 
> "dclk_vp2";
> + iommus = <_mmu>;
> + power-domains = < RK3568_PD_VO>;
> + status = "disabled";
> +
> + vop_out: ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + vp0: port@0 {

> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0>;

My incomplete list:

Inside nodes:
If exists on top: compatible, reg and interrupts.
In alphabetical order the required properties.
Then in alphabetical order the other properties.
And as last things that start with '#' in alphabetical order.
Add status below all other properties for soc internal components with
any board-specifics.

> + };
> +
> + vp1: port@1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1>;
> + };
> +
> + vp2: port@2 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <2>;
> + };
> + };
> + };
> +
> + vop_mmu: iommu@fe043e00 {
> + compatible = "rockchip,rk3568-iommu";
> + reg = <0x0 0xfe043e00 0x0 0x100>, <0x0 0xfe043f00 0x0 0x100>;
> + interrupts = ;

> + interrupt-names = "vop_mmu";

ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml

arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml: iommu@fe043e00:
'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: 
/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml

> + clocks = < ACLK_VOP>, < HCLK_VOP>;
> + clock-names = "aclk", "iface";
> + #iommu-cells = <0>;
> + status = "disabled";
> + };
> +
>   qos_gpu: qos@fe128000 {
>   compatible = "rockchip,rk3568-qos", "syscon";
>   reg = <0x0 0xfe128000 0x0 0x20>;
> 


Re: [PATCH] arm64: dts: rockchip: enable vop2 and hdmi tx on quartz64a

2021-11-25 Thread Johan Jonker



On 11/17/21 4:44 PM, Michael Riesch wrote:
> Enable the RK356x Video Output Processor (VOP) 2 on the Pine64
> Quartz64 Model A.
> 
> Signed-off-by: Michael Riesch 
> ---
>  .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 24 +++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts 
> b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
> index 4d4b2a301b1a..9fba790c6af4 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
> @@ -205,6 +205,16 @@ _clkinout
>   status = "okay";
>  };
>  
> + {

> + status = "okay";
> + avdd-0v9-supply = <_0v9>;
> + avdd-1v8-supply = <_1v8>;

Heiko's sort rules:

compatible
reg
interrupts
[alphabetical]
status [if needed]

> +};
> +
> +_in_vp0 {
> + status = "okay";
> +};
> +
>   {
>   status = "okay";
>  
> @@ -546,3 +556,17 @@ bluetooth {
>   {
>   status = "okay";
>  };
> +
> + {

> + status = "okay";

status below

> + assigned-clocks = < DCLK_VOP0>, < DCLK_VOP1>;
> + assigned-clock-parents = < PLL_HPLL>, < PLL_VPLL>;
> +};
> +
> +_mmu {
> + status = "okay";
> +};
> +
> +_out_hdmi {
> + status = "okay";
> +};
> 


Re: [PATCH v6 2/5] drm: rockchip: add sound support to rk3066 hdmi driver

2021-03-22 Thread Johan Jonker
ping

On 12/6/20 2:33 PM, Johan Jonker wrote:
> From: Zheng Yang 
> 
> Add sound support to the rk3066 HDMI driver.
> 
> The I2S input of the HDMI TX allows transmission of
> DVD-Audio and decoded Dolby Digital
> to A/V Receivers and high-end displays.
> The interface supports 2 to 8 channels audio up to 192 kHz.
> The HDMI TX supports variable word length of
> 16bits to 32bits for I2S audio inputs.(This driver 24bit max)
> There are three I2S input modes supported.(This driver HDMI_I2S only)
> On RK3066/PX2 the HDMI TX audio source is connected to I2S_8CH.
> 
> Signed-off-by: Zheng Yang 
> Signed-off-by: Johan Jonker 
> ---
>  drivers/gpu/drm/rockchip/Kconfig   |   2 +
>  drivers/gpu/drm/rockchip/rk3066_hdmi.c | 277 
> -
>  2 files changed, 278 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/Kconfig 
> b/drivers/gpu/drm/rockchip/Kconfig
> index 310aa1546..4c20445dc 100644
> --- a/drivers/gpu/drm/rockchip/Kconfig
> +++ b/drivers/gpu/drm/rockchip/Kconfig
> @@ -11,6 +11,8 @@ config DRM_ROCKCHIP
>   select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
>   select DRM_RGB if ROCKCHIP_RGB
>   select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
> + select SND_SOC_HDMI_CODEC if ROCKCHIP_RK3066_HDMI && SND_SOC
> + select SND_SOC_ROCKCHIP_I2S if ROCKCHIP_RK3066_HDMI && SND_SOC
>   help
> Choose this option if you have a Rockchip soc chipset.
> This driver provides kernel mode setting and buffer
> diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
> b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
> index 1c546c3a8..2f8654023 100644
> --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
> @@ -13,6 +13,8 @@
>  #include 
>  #include 
>  
> +#include 
> +
>  #include "rk3066_hdmi.h"
>  
>  #include "rockchip_drm_drv.h"
> @@ -20,9 +22,16 @@
>  
>  #define DEFAULT_PLLA_RATE 3000
>  
> +struct audio_info {
> + int channels;
> + int sample_rate;
> + int sample_width;
> +};
> +
>  struct hdmi_data_info {
>   int vic; /* The CEA Video ID (VIC) of the current drm display mode. */
>   bool sink_is_hdmi;
> + bool sink_has_audio;
>   unsigned int enc_out_format;
>   unsigned int colorimetry;
>  };
> @@ -54,12 +63,19 @@ struct rk3066_hdmi {
>  
>   unsigned int tmdsclk;
>  
> + struct platform_device *audio_pdev;
> + struct audio_info audio;
> + bool audio_enable;
> +
>   struct hdmi_data_info hdmi_data;
>   struct drm_display_mode previous_mode;
>  };
>  
>  #define to_rk3066_hdmi(x) container_of(x, struct rk3066_hdmi, x)
>  
> +static int
> +rk3066_hdmi_config_audio(struct rk3066_hdmi *hdmi, struct audio_info *audio);
> +
>  static inline u8 hdmi_readb(struct rk3066_hdmi *hdmi, u16 offset)
>  {
>   return readl_relaxed(hdmi->regs + offset);
> @@ -205,6 +221,23 @@ static int rk3066_hdmi_config_avi(struct rk3066_hdmi 
> *hdmi,
>   HDMI_INFOFRAME_AVI, 0, 0, 0);
>  }
>  
> +static int rk3066_hdmi_config_aai(struct rk3066_hdmi *hdmi,
> +   struct audio_info *audio)
> +{
> + union hdmi_infoframe frame;
> + int rc;
> +
> + rc = hdmi_audio_infoframe_init();
> +
> + frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM;
> + frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
> + frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
> + frame.audio.channels = hdmi->audio.channels;
> +
> + return rk3066_hdmi_upload_frame(hdmi, rc, ,
> + HDMI_INFOFRAME_AAI, 0, 0, 0);
> +}
> +
>  static int rk3066_hdmi_config_video_timing(struct rk3066_hdmi *hdmi,
>  struct drm_display_mode *mode)
>  {
> @@ -353,6 +386,7 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
>   hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK,
> HDMI_VIDEO_MODE_HDMI);
>   rk3066_hdmi_config_avi(hdmi, mode);
> + rk3066_hdmi_config_audio(hdmi, >audio);
>   } else {
>   hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0);
>   }
> @@ -369,9 +403,20 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
>*/
>   rk3066_hdmi_i2c_init(hdmi);
>  
> - /* Unmute video output. */
> + /* Unmute video and audio output. */
>   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
> HDMI_VIDEO_AUDIO_DISABLE_MASK, HDMI_AUDIO_DISABLE);
> + if (hdmi->audio_enabl

[RFC PATCH] drm/rockchip: vop_reg: add rk3036 hdmi support

2021-02-01 Thread Johan Jonker
A Rockchip Inno HDMI driver was added, but the rk3036
VOP regs with HDMI support in the manufacturer tree never
made it to the mainline kernel.
This patch adds only hdmi_en and hdmi_dclk_pol.
The inno hdmi driver must set hdmi_pin_pol in
GRF_SOC_CON2.

Signed-off-by: Johan Jonker 
---
Not tested with hardware
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c 
b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index 0697057e7..c164690a1 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -147,6 +147,8 @@ static const struct vop_modeset rk3036_modeset = {
 
 static const struct vop_output rk3036_output = {
.pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4),
+   .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22),
+   .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23),
 };
 
 static const struct vop_common rk3036_common = {
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/rockchip: vop_reg: add PX30 version info

2021-02-01 Thread Johan Jonker
To reduce memory various Rockchip VOP versions share
common reg structures. However more recent added SoCs not
always have to same futures as the old ones.
Add PX30 missing version info, so all VOP version checks
work correct if needed in the future.

Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c 
b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index 80053d91a..0697057e7 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -312,6 +312,7 @@ static const struct vop_win_data px30_vop_big_win_data[] = {
 };
 
 static const struct vop_data px30_vop_big = {
+   .version = VOP_VERSION(2, 6),
.intr = _intr,
.feature = VOP_FEATURE_INTERNAL_RGB,
.common = _common,
@@ -327,6 +328,7 @@ static const struct vop_win_data px30_vop_lit_win_data[] = {
 };
 
 static const struct vop_data px30_vop_lit = {
+   .version = VOP_VERSION(2, 5),
.intr = _intr,
.feature = VOP_FEATURE_INTERNAL_RGB,
.common = _common,
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 5/5] ARM: dts: rockchip: enable hdmi_sound and i2s0 for rk3066a-mk808

2020-12-07 Thread Johan Jonker
Make some noise with mk808. Enable the hdmi_sound node and
add i2s0 as sound source for hdmi.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3066a-mk808.dts | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/rk3066a-mk808.dts 
b/arch/arm/boot/dts/rk3066a-mk808.dts
index eed9e60cf..5fe74c097 100644
--- a/arch/arm/boot/dts/rk3066a-mk808.dts
+++ b/arch/arm/boot/dts/rk3066a-mk808.dts
@@ -116,6 +116,14 @@
};
 };
 
+_sound {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
  {
bus-width = <4>;
cap-mmc-highspeed;
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 0/5] Enable rk3066a HDMI sound

2020-12-07 Thread Johan Jonker
Update the rk3066a HDMI documents with a #sound-dai-cells property.
Include the code for sound in the HDMI driver.
Add a simple-sound-card compatible node to rk3066a.dtsi,
because I2S0 and HDMI TX are connected internally.
And as last enable rk3066a HDMI sound in the rk3066a-mk808.dts file.

make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j4
cp ./arch/arm/boot/zImage ../zImage-dtb
cat ./arch/arm/boot/dts/rk3066a-mk808.dtb >> ../zImage-dtb
../tools/rkcrc -k ../zImage-dtb ../mk808.img
sudo ../tools/rkflashtool w 0x4000 0x8000 < ../mk808.img
sudo ../tools/rkflashtool b

Changed v6:
  remove patches that are applied to linux-next
  add platform_device_unregister()
  restyle

Changed v5:
  removed unused variable
  fill frame structure

Johan Jonker (4):
  dt-bindings: display: add #sound-dai-cells property to rockchip rk3066
hdmi
  ARM: dts: rockchip: rk3066a: add #sound-dai-cells to hdmi node
  ARM: dts: rockchip: add hdmi-sound node to rk3066a.dtsi
  ARM: dts: rockchip: enable hdmi_sound and i2s0 for rk3066a-mk808

Zheng Yang (1):
  drm: rockchip: add sound support to rk3066 hdmi driver

 .../display/rockchip/rockchip,rk3066-hdmi.yaml |   4 +
 arch/arm/boot/dts/rk3066a-mk808.dts|   8 +
 arch/arm/boot/dts/rk3066a.dtsi |  17 ++
 drivers/gpu/drm/rockchip/Kconfig   |   2 +
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 277 -
 5 files changed, 307 insertions(+), 1 deletion(-)

-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 1/5] dt-bindings: display: add #sound-dai-cells property to rockchip rk3066 hdmi

2020-12-07 Thread Johan Jonker
'#sound-dai-cells' is required to properly interpret
the list of DAI specified in the 'sound-dai' property.
Add it to rockchip,rk3066-hdmi.yaml to document that the
rk3066 HDMI TX also can be used to transmit some audio.

Signed-off-by: Johan Jonker 
---
 .../devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml| 4 
 1 file changed, 4 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
index 4110d003c..585a8d3b9 100644
--- 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
+++ 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
@@ -42,6 +42,9 @@ properties:
 description:
   This soc uses GRF regs to switch the HDMI TX input between vop0 and vop1.
 
+  "#sound-dai-cells":
+const: 0
+
   ports:
 type: object
 
@@ -101,6 +104,7 @@ examples:
   pinctrl-names = "default";
   power-domains = < RK3066_PD_VIO>;
   rockchip,grf = <>;
+  #sound-dai-cells = <0>;
 
   ports {
 #address-cells = <1>;
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 4/5] ARM: dts: rockchip: add hdmi-sound node to rk3066a.dtsi

2020-12-07 Thread Johan Jonker
Add hdmi-sound node to rk3066a.dtsi, so that it
can be reused by boards with HDMI support.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3066a.dtsi | 16 
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi
index 67fcb0dc9..f91ce3054 100644
--- a/arch/arm/boot/dts/rk3066a.dtsi
+++ b/arch/arm/boot/dts/rk3066a.dtsi
@@ -49,6 +49,22 @@
ports = <_out>, <_out>;
};
 
+   hdmi_sound: hdmi-sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "HDMI";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,mclk-fs = <256>;
+   status = "disabled";
+
+   simple-audio-card,codec {
+   sound-dai = <>;
+   };
+
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+   };
+
sram: sram@1008 {
compatible = "mmio-sram";
reg = <0x1008 0x1>;
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 2/5] drm: rockchip: add sound support to rk3066 hdmi driver

2020-12-07 Thread Johan Jonker
From: Zheng Yang 

Add sound support to the rk3066 HDMI driver.

The I2S input of the HDMI TX allows transmission of
DVD-Audio and decoded Dolby Digital
to A/V Receivers and high-end displays.
The interface supports 2 to 8 channels audio up to 192 kHz.
The HDMI TX supports variable word length of
16bits to 32bits for I2S audio inputs.(This driver 24bit max)
There are three I2S input modes supported.(This driver HDMI_I2S only)
On RK3066/PX2 the HDMI TX audio source is connected to I2S_8CH.

Signed-off-by: Zheng Yang 
Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/Kconfig   |   2 +
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 277 -
 2 files changed, 278 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 310aa1546..4c20445dc 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -11,6 +11,8 @@ config DRM_ROCKCHIP
select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
select DRM_RGB if ROCKCHIP_RGB
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
+   select SND_SOC_HDMI_CODEC if ROCKCHIP_RK3066_HDMI && SND_SOC
+   select SND_SOC_ROCKCHIP_I2S if ROCKCHIP_RK3066_HDMI && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
  This driver provides kernel mode setting and buffer
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 1c546c3a8..2f8654023 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -13,6 +13,8 @@
 #include 
 #include 
 
+#include 
+
 #include "rk3066_hdmi.h"
 
 #include "rockchip_drm_drv.h"
@@ -20,9 +22,16 @@
 
 #define DEFAULT_PLLA_RATE 3000
 
+struct audio_info {
+   int channels;
+   int sample_rate;
+   int sample_width;
+};
+
 struct hdmi_data_info {
int vic; /* The CEA Video ID (VIC) of the current drm display mode. */
bool sink_is_hdmi;
+   bool sink_has_audio;
unsigned int enc_out_format;
unsigned int colorimetry;
 };
@@ -54,12 +63,19 @@ struct rk3066_hdmi {
 
unsigned int tmdsclk;
 
+   struct platform_device *audio_pdev;
+   struct audio_info audio;
+   bool audio_enable;
+
struct hdmi_data_info hdmi_data;
struct drm_display_mode previous_mode;
 };
 
 #define to_rk3066_hdmi(x) container_of(x, struct rk3066_hdmi, x)
 
+static int
+rk3066_hdmi_config_audio(struct rk3066_hdmi *hdmi, struct audio_info *audio);
+
 static inline u8 hdmi_readb(struct rk3066_hdmi *hdmi, u16 offset)
 {
return readl_relaxed(hdmi->regs + offset);
@@ -205,6 +221,23 @@ static int rk3066_hdmi_config_avi(struct rk3066_hdmi *hdmi,
HDMI_INFOFRAME_AVI, 0, 0, 0);
 }
 
+static int rk3066_hdmi_config_aai(struct rk3066_hdmi *hdmi,
+ struct audio_info *audio)
+{
+   union hdmi_infoframe frame;
+   int rc;
+
+   rc = hdmi_audio_infoframe_init();
+
+   frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM;
+   frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
+   frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
+   frame.audio.channels = hdmi->audio.channels;
+
+   return rk3066_hdmi_upload_frame(hdmi, rc, ,
+   HDMI_INFOFRAME_AAI, 0, 0, 0);
+}
+
 static int rk3066_hdmi_config_video_timing(struct rk3066_hdmi *hdmi,
   struct drm_display_mode *mode)
 {
@@ -353,6 +386,7 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK,
  HDMI_VIDEO_MODE_HDMI);
rk3066_hdmi_config_avi(hdmi, mode);
+   rk3066_hdmi_config_audio(hdmi, >audio);
} else {
hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0);
}
@@ -369,9 +403,20 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
 */
rk3066_hdmi_i2c_init(hdmi);
 
-   /* Unmute video output. */
+   /* Unmute video and audio output. */
hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
  HDMI_VIDEO_AUDIO_DISABLE_MASK, HDMI_AUDIO_DISABLE);
+   if (hdmi->audio_enable) {
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, HDMI_AUDIO_DISABLE, 0);
+   /* Reset audio capture logic. */
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
+ HDMI_AUDIO_CP_LOGIC_RESET_MASK,
+ HDMI_AUDIO_CP_LOGIC_RESET);
+   usleep_range(900, 1000);
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
+ HDMI_AUDIO_CP_LOGIC_RESET_MASK, 0);
+   }
+
return 0;
 }
 
@@ -473,9 +518,13 @@ static int rk3066_hdmi_connector_get_modes(struct 
drm_connector *connector)
edi

[PATCH v6 3/5] ARM: dts: rockchip: rk3066a: add #sound-dai-cells to hdmi node

2020-12-07 Thread Johan Jonker
'#sound-dai-cells' is required to properly interpret
the list of DAI specified in the 'sound-dai' property,
so add them to the 'hdmi' node for 'rk3066a.dtsi'.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3066a.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi
index 252750c97..67fcb0dc9 100644
--- a/arch/arm/boot/dts/rk3066a.dtsi
+++ b/arch/arm/boot/dts/rk3066a.dtsi
@@ -124,6 +124,7 @@
pinctrl-0 = <_xfer>, <_hpd>;
power-domains = < RK3066_PD_VIO>;
rockchip,grf = <>;
+   #sound-dai-cells = <0>;
status = "disabled";
 
ports {
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 4/7] drm: rockchip: add sound support to rk3066 hdmi driver

2020-11-19 Thread Johan Jonker
From: Zheng Yang 

Add sound support to the rk3066 HDMI driver.

The I2S input of the HDMI TX allows transmission of
DVD-Audio and decoded Dolby Digital
to A/V Receivers and high-end displays.
The interface supports 2 to 8 channels audio up to 192 kHz.
The HDMI TX supports variable word length of
16bits to 32bits for I2S audio inputs.(This driver 24bit max)
There are three I2S input modes supported.(This driver HDMI_I2S only)
On RK3066/PX2 the HDMI TX audio source is connected to I2S_8CH.

Signed-off-by: Zheng Yang 
Signed-off-by: Johan Jonker 
---
 drivers/gpu/drm/rockchip/Kconfig   |   2 +
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 275 -
 2 files changed, 276 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 310aa1546..4c20445dc 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -11,6 +11,8 @@ config DRM_ROCKCHIP
select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
select DRM_RGB if ROCKCHIP_RGB
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
+   select SND_SOC_HDMI_CODEC if ROCKCHIP_RK3066_HDMI && SND_SOC
+   select SND_SOC_ROCKCHIP_I2S if ROCKCHIP_RK3066_HDMI && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
  This driver provides kernel mode setting and buffer
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 1c546c3a8..243e4077f 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -13,6 +13,8 @@
 #include 
 #include 
 
+#include 
+
 #include "rk3066_hdmi.h"
 
 #include "rockchip_drm_drv.h"
@@ -20,9 +22,16 @@
 
 #define DEFAULT_PLLA_RATE 3000
 
+struct audio_info {
+   int sample_rate;
+   int channels;
+   int sample_width;
+};
+
 struct hdmi_data_info {
int vic; /* The CEA Video ID (VIC) of the current drm display mode. */
bool sink_is_hdmi;
+   bool sink_has_audio;
unsigned int enc_out_format;
unsigned int colorimetry;
 };
@@ -54,12 +63,19 @@ struct rk3066_hdmi {
 
unsigned int tmdsclk;
 
+   struct platform_device *audio_pdev;
+   bool audio_enable;
+
struct hdmi_data_info hdmi_data;
+   struct audio_info audio;
struct drm_display_mode previous_mode;
 };
 
 #define to_rk3066_hdmi(x) container_of(x, struct rk3066_hdmi, x)
 
+static int
+rk3066_hdmi_config_audio(struct rk3066_hdmi *hdmi, struct audio_info *audio);
+
 static inline u8 hdmi_readb(struct rk3066_hdmi *hdmi, u16 offset)
 {
return readl_relaxed(hdmi->regs + offset);
@@ -205,6 +221,23 @@ static int rk3066_hdmi_config_avi(struct rk3066_hdmi *hdmi,
HDMI_INFOFRAME_AVI, 0, 0, 0);
 }
 
+static int rk3066_hdmi_config_aai(struct rk3066_hdmi *hdmi,
+ struct audio_info *audio)
+{
+   union hdmi_infoframe frame;
+   int rc;
+
+   rc = hdmi_audio_infoframe_init();
+
+   frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM;
+   frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
+   frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
+   frame.audio.channels = hdmi->audio.channels;
+
+   return rk3066_hdmi_upload_frame(hdmi, rc, ,
+   HDMI_INFOFRAME_AAI, 0, 0, 0);
+}
+
 static int rk3066_hdmi_config_video_timing(struct rk3066_hdmi *hdmi,
   struct drm_display_mode *mode)
 {
@@ -353,6 +386,7 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK,
  HDMI_VIDEO_MODE_HDMI);
rk3066_hdmi_config_avi(hdmi, mode);
+   rk3066_hdmi_config_audio(hdmi, >audio);
} else {
hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0);
}
@@ -369,9 +403,20 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
 */
rk3066_hdmi_i2c_init(hdmi);
 
-   /* Unmute video output. */
+   /* Unmute video and audio output. */
hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
  HDMI_VIDEO_AUDIO_DISABLE_MASK, HDMI_AUDIO_DISABLE);
+   if (hdmi->audio_enable) {
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, HDMI_AUDIO_DISABLE, 0);
+   /* Reset audio capture logic. */
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
+ HDMI_AUDIO_CP_LOGIC_RESET_MASK,
+ HDMI_AUDIO_CP_LOGIC_RESET);
+   usleep_range(900, 1000);
+   hdmi_modb(hdmi, HDMI_VIDEO_CTRL2,
+ HDMI_AUDIO_CP_LOGIC_RESET_MASK, 0);
+   }
+
return 0;
 }
 
@@ -473,9 +518,13 @@ static int rk3066_hdmi_connector_get_modes(struct 
drm_connector *connector)
edi

[PATCH v5 3/7] dt-bindings: display: add #sound-dai-cells property to rockchip rk3066 hdmi

2020-11-19 Thread Johan Jonker
'#sound-dai-cells' is required to properly interpret
the list of DAI specified in the 'sound-dai' property.
Add it to rockchip,rk3066-hdmi.yaml to document that the
rk3066 HDMI TX also can be used to transmit some audio.

Signed-off-by: Johan Jonker 
---
 .../devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml| 4 
 1 file changed, 4 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
index 4110d003c..585a8d3b9 100644
--- 
a/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
+++ 
b/Documentation/devicetree/bindings/display/rockchip/rockchip,rk3066-hdmi.yaml
@@ -42,6 +42,9 @@ properties:
 description:
   This soc uses GRF regs to switch the HDMI TX input between vop0 and vop1.
 
+  "#sound-dai-cells":
+const: 0
+
   ports:
 type: object
 
@@ -101,6 +104,7 @@ examples:
   pinctrl-names = "default";
   power-domains = < RK3066_PD_VIO>;
   rockchip,grf = <>;
+  #sound-dai-cells = <0>;
 
   ports {
 #address-cells = <1>;
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 7/7] ARM: dts: rockchip: enable hdmi_sound and i2s0 for rk3066a-mk808

2020-11-19 Thread Johan Jonker
Make some noise with mk808. Enable the hdmi_sound node and
add i2s0 as sound source for hdmi.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3066a-mk808.dts | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/rk3066a-mk808.dts 
b/arch/arm/boot/dts/rk3066a-mk808.dts
index eed9e60cf..5fe74c097 100644
--- a/arch/arm/boot/dts/rk3066a-mk808.dts
+++ b/arch/arm/boot/dts/rk3066a-mk808.dts
@@ -116,6 +116,14 @@
};
 };
 
+_sound {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
  {
bus-width = <4>;
cap-mmc-highspeed;
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 2/7] clk: rockchip: fix i2s gate bits on rk3066 and rk3188

2020-11-19 Thread Johan Jonker
The Rockchip PX2/RK3066 uses these bits in CRU_CLKGATE7_CON:

hclk_i2s_8ch_gate_en  bit 4 (dtsi: i2s0)
hclk_i2s0_2ch_gate_en bit 2 (dtsi: i2s1)
hclk_i2s1_2ch_gate_en bit 3 (dtsi: i2s2)

The Rockchip PX3/RK3188 uses this bit in CRU_CLKGATE7_CON:

hclk_i2s_2ch_gate_en  bit 2 (dtsi: i2s0)

The bits got somehow mixed up in the clk-rk3188.c file.
The labels in the dtsi files are not suppose to change.
The sclk and hclk names should match for
"trace_event=clk_disable,clk_enable",
so remove GATE HCLK_I2S0 from the common clock tree and
fix the bits in the rk3066 and rk3188 clock tree.

Signed-off-by: Johan Jonker 
---
Changed v3:
  reword
---
 drivers/clk/rockchip/clk-rk3188.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/rockchip/clk-rk3188.c 
b/drivers/clk/rockchip/clk-rk3188.c
index db8c58813..0b76ad34d 100644
--- a/drivers/clk/rockchip/clk-rk3188.c
+++ b/drivers/clk/rockchip/clk-rk3188.c
@@ -449,7 +449,6 @@ static struct rockchip_clk_branch common_clk_branches[] 
__initdata = {
 
/* hclk_cpu gates */
GATE(HCLK_ROM, "hclk_rom", "hclk_cpu", 0, RK2928_CLKGATE_CON(5), 6, 
GFLAGS),
-   GATE(HCLK_I2S0, "hclk_i2s0", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 2, 
GFLAGS),
GATE(HCLK_SPDIF, "hclk_spdif", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 1, 
GFLAGS),
GATE(0, "hclk_cpubus", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 8, GFLAGS),
/* hclk_ahb2apb is part of a clk branch */
@@ -634,8 +633,9 @@ static struct rockchip_clk_branch rk3066a_clk_branches[] 
__initdata = {
RK2928_CLKGATE_CON(0), 12, GFLAGS,
_i2s2_fracmux),
 
-   GATE(HCLK_I2S1, "hclk_i2s1", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 3, 
GFLAGS),
-   GATE(HCLK_I2S2, "hclk_i2s2", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 4, 
GFLAGS),
+   GATE(HCLK_I2S0, "hclk_i2s0", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 4, 
GFLAGS),
+   GATE(HCLK_I2S1, "hclk_i2s1", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 2, 
GFLAGS),
+   GATE(HCLK_I2S2, "hclk_i2s2", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 3, 
GFLAGS),
GATE(HCLK_CIF1, "hclk_cif1", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 6, 
GFLAGS),
GATE(HCLK_HDMI, "hclk_hdmi", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, 
GFLAGS),
 
@@ -728,6 +728,7 @@ static struct rockchip_clk_branch rk3188_clk_branches[] 
__initdata = {
RK2928_CLKGATE_CON(0), 10, GFLAGS,
_i2s0_fracmux),
 
+   GATE(HCLK_I2S0, "hclk_i2s0", "hclk_cpu", 0, RK2928_CLKGATE_CON(7), 2, 
GFLAGS),
GATE(0, "hclk_imem0", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS),
GATE(0, "hclk_imem1", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 15, GFLAGS),
 
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 5/7] ARM: dts: rockchip: rk3066a: add #sound-dai-cells to hdmi node

2020-11-19 Thread Johan Jonker
'#sound-dai-cells' is required to properly interpret
the list of DAI specified in the 'sound-dai' property,
so add them to the 'hdmi' node for 'rk3066a.dtsi'.

Signed-off-by: Johan Jonker 
---
 arch/arm/boot/dts/rk3066a.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi
index 252750c97..67fcb0dc9 100644
--- a/arch/arm/boot/dts/rk3066a.dtsi
+++ b/arch/arm/boot/dts/rk3066a.dtsi
@@ -124,6 +124,7 @@
pinctrl-0 = <_xfer>, <_hpd>;
power-domains = < RK3066_PD_VIO>;
rockchip,grf = <>;
+   #sound-dai-cells = <0>;
status = "disabled";
 
ports {
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   >