Skip to contentSkip to conversation

Add eDP support for RK3576

PATCH Superseded Damon Ding 3 participants 21 messages Mar 19 – Mar 25

Subsystems (6)

v2 of 11 Superseded Latest is v11 →

lore
Share & tools
lore

Damon Ding

author
#0 lore raw

v2 cover Add eDP support for RK3576

These patchs have been tested with a 1536x2048p60 eDP panel on RK3576 EVB1 board (hardware modified specially).

Patch 1~4 are to add missing clock "hclk" for RK3588 eDP nodes. Patch 5~6 are to add the RK3576 eDP node.
Patch 7~9 are to support the RK3576 Analogix DP controller.

Damon Ding (9):
dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk"
for the third clock
arm64: dts: rockchip: Add missing clock "hclk" for RK3588 eDP0 nodes.
arm64: dts: rockchip: Add missing clock "hclk" for RK3588 eDP1 nodes. drm/rockchip: analogix_dp: Enable clock "hclk" for RK3588
dt-bindings: display: rockchip: analogix-dp: Add support for RK3576
arm64: dts: rockchip: Add eDP node for RK3576
drm/bridge: analogix_dp: Rename and simplify is_rockchip() drm/bridge: analogix_dp: Add support for RK3576 drm/rockchip: analogix_dp: Add support for RK3576

 .../rockchip/rockchip,analogix-dp.yaml        |  6 +++-
 arch/arm64/boot/dts/rockchip/rk3576.dtsi      | 28 +++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi |  4 +--
 .../arm64/boot/dts/rockchip/rk3588-extra.dtsi |  4 +--
 .../drm/bridge/analogix/analogix_dp_core.c    |  3 +-
 .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 18 ++++++------
 .../gpu/drm/rockchip/analogix_dp-rockchip.c   | 15 ++++++++++
 include/drm/bridge/analogix_dp.h              | 13 +++++++--
 8 files changed, 74 insertions(+), 17 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/9 dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")
---
 .../bindings/display/rockchip/rockchip,analogix-dp.yaml       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -1
index d99b23b88cc5..d2bc8636b626 100644
@@ -26,7 +26,9 @@ properties:
     items:
       - const: dp
       - const: pclk
-      - const: grf
+      - enum:
+          - grf
+          - hclk
 
   power-domains:
     maxItems: 1
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

Quoted 15 lines · Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")
---
 .../bindings/display/rockchip/rockchip,analogix-dp.yaml       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +0 -0
index d99b23b88cc5..d2bc8636b626 100644

Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml properties: · line 31

Quoted 7 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -1
@@ -26,7 +26,9 @@ properties:
     items:
       - const: dp
       - const: pclk
-      - const: grf
+      - enum:
+          - grf
+          - hclk

You just told me it is the same clock, no? I asked that and you confirmed? Or you replied with an answer not relevant to the question?

If this device takes reference to grf, why does it also take grf clock? Devices MUST NOT take clocks on behalf of other devices, so please answer with a list of all clock inputs according to datasheet/manual.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")

---

BTW, all your patches (this and previous set... actually, everything you ever sent IIRC) end up marked as spam. I don't see anything in the headers pointing to the issue. There is no score assigned and DMARC+SPF+DKIM pass.

However it seems you are using @rock-chips.com and SMTP server 163.com, so maybe that difference. Or maybe it is rock-chips lack of DMARC policy (p=none dis=none)?

Regardless of the reason, if you do not ever receive answers from people, it is likely that is the reason.

Best regards,
Krzysztof

author
#4 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

Hi Krzysztof,

Quoted 15 lines · Krzysztof Kozlowski
Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")

---

BTW, all your patches (this and previous set... actually, everything you ever sent IIRC) end up marked as spam. I don't see anything in the headers pointing to the issue. There is no score assigned and DMARC+SPF+DKIM pass.

Quoted 8 lines

However it seems you are using @rock-chips.com and SMTP server 163.com, so maybe that difference. Or maybe it is rock-chips lack of DMARC policy (p=none dis=none)?

Regardless of the reason, if you do not ever receive answers from people, it is likely that is the reason.

Thank you for the kind heads-up! And I’m sorry for the extra work you have to go through checking the spam folder.

It looks like I really need to have a good talk with our IT team about this.

Thanks again for letting me know — much appreciated!

Best regards,
Damon

author
#5 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")
---
  .../bindings/display/rockchip/rockchip,analogix-dp.yaml       | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 16 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml properties: · line 31

Quoted 12 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -1
index d99b23b88cc5..d2bc8636b626 100644
@@ -26,7 +26,9 @@ properties:
      items:
        - const: dp
        - const: pclk
-      - const: grf
+      - enum:
+          - grf
+          - hclk

You just told me it is the same clock, no? I asked that and you confirmed? Or you replied with an answer not relevant to the question?

Aha, I may have misunderstood your earlier advice as meaning that since the RK3576 and RK3588 platforms share the same design, their clock dependencies should also be identical.

The 'grf' clock and 'hclk' clock are different.
On RK3399, the GRF clock is for accessing VIO GRF registers.
On RK3588/RK3576, the eDP 'hclk' is required as it is the parent clock of 'pclk' in the AHB bus topology.

Quoted 4 lines

If this device takes reference to grf, why does it also take grf clock? Devices MUST NOT take clocks on behalf of other devices, so please answer with a list of all clock inputs according to datasheet/manual.

On earlier platforms, the GRF was not partitioned into separate functional small GRF units as on newer designs. Therefore, the 'grf' clock was designed as the clock dependency for all relevant modules.

For RK3588/RK3576 eDP module, the list of all clock inputs is:

CLK_EDP0_24M: Reference clock.
PCLK_EDP0: AHB clock.
HCLK_VO1/HCLK_VO0_ROOT: Video datapath clock.

It would be better to add above comments as the descriptions of these clocks in yaml.

Best regards,
Damon

#6 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

Quoted 17 lines · Damon Ding
Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +0 -0
index d99b23b88cc5..d2bc8636b626 100644
@@ -26,7 +26,9 @@ properties:
      items:
        - const: dp
Quoted 9 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml properties: · line 31

Quoted 5 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -1
        - const: pclk
-      - const: grf
+      - enum:
+          - grf
+          - hclk

You just told me it is the same clock, no? I asked that and you confirmed? Or you replied with an answer not relevant to the question?

Quoted 6 lines

Aha, I may have misunderstood your earlier advice as meaning that since the RK3576 and RK3588 platforms share the same design, their clock dependencies should also be identical.

The 'grf' clock and 'hclk' clock are different.
On RK3399, the GRF clock is for accessing VIO GRF registers.

OK

Quoted 2 lines

On RK3588/RK3576, the eDP 'hclk' is required as it is the parent clock of 'pclk' in the AHB bus topology.

Heh, device takes pclk, so you do not need to take its parent.

Quoted 10 lines
Quoted 5 lines

If this device takes reference to grf, why does it also take grf clock? Devices MUST NOT take clocks on behalf of other devices, so please answer with a list of all clock inputs according to datasheet/manual.

On earlier platforms, the GRF was not partitioned into separate functional small GRF units as on newer designs. Therefore, the 'grf' clock was designed as the clock dependency for all relevant modules.

Quoted 5 lines

For RK3588/RK3576 eDP module, the list of all clock inputs is:

CLK_EDP0_24M: Reference clock.
PCLK_EDP0: AHB clock.
HCLK_VO1/HCLK_VO0_ROOT: Video datapath clock.

Best regards,
Krzysztof

author
#7 lore raw

Re: [PATCH v2 1/9] dt-bindings: display: rockchip: analogix-dp: Expand clock-names "hclk" for the third clock

Quoted 25 lines · Krzysztof Kozlowski
Quoted 17 lines · Damon Ding
Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +0 -0
index d99b23b88cc5..d2bc8636b626 100644
@@ -26,7 +26,9 @@ properties:
       items:
         - const: dp
Quoted 9 lines

Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml properties: · line 31

Quoted 5 lines
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -1
         - const: pclk
-      - const: grf
+      - enum:
+          - grf
+          - hclk

You just told me it is the same clock, no? I asked that and you confirmed? Or you replied with an answer not relevant to the question?

Quoted 6 lines

Aha, I may have misunderstood your earlier advice as meaning that since the RK3576 and RK3588 platforms share the same design, their clock dependencies should also be identical.

The 'grf' clock and 'hclk' clock are different.
On RK3399, the GRF clock is for accessing VIO GRF registers.

Quoted 6 lines

OK

Quoted 2 lines

On RK3588/RK3576, the eDP 'hclk' is required as it is the parent clock of 'pclk' in the AHB bus topology.

Heh, device takes pclk, so you do not need to take its parent.

Emm, my explanation may not have been clear enough. At the clock tree level, the hclk and pclk are two separate clocks, while pclk's parent clock is hclk in the NOC design, as illustrated below:
(Take the NOC design of RK3576 as example)

PD_VOP
hclk_vop

    ├─ PD_VO1/hclk_vo1
    │    ├─ hclk_vo1_s (VO1 AHBS)
    │    └─ pclk_vo1_s (VO1 APB)
    └─ PD_VO0/hclk_vo0
         ├─ hclk_vo0_s (VO0 AHB)
         ├─ pclk_vo0   (VO0 AHBS)
         └─ pclk_vo0_s (VO0 APBS)

Then, the clock tree design is:

hclk_vo0_root (200M)

├─ hclk_spdifrx2_en
│    └─ hclk_spdifrx2 (200M)
├─ hclk_spdif2_en
│    └─ hclk_spdif2 (200M)
├─ hclk_sai6_8ch_en
│    └─ hclk_sai6_8ch (200M)
├─ hclk_hdcp0_en
│    └─ hclk_hdcp0 (200M)
├─ hclk_vo0_biu_en
│    └─ hclk_vo0_biu (200M)
└─ hclk_sai5_8ch_en
     └─ hclk_sai5_8ch (200M)

pclk_vo0_root (150M)

├─ pclk_hdmitx0_en
│    └─ pclk_hdmitx0 (150M)
├─ pclk_vo0_grf_en
│    └─ pclk_vo0_grf (150M)
├─ pclk_edp0_en
│    └─ pclk_edp0 (150M)
├─ pclk_dsihost0_en
│    └─ pclk_dsihost0 (150M)
├─ pclk_hdcp0_en
│    └─ pclk_hdcp0 (150M)
└─ pclk_vo0_biu_en
     └─ pclk_vo0_biu (150M)

Therefore, we need take 'hclk' as reference clock.

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

If this device takes reference to grf, why does it also take grf clock? Devices MUST NOT take clocks on behalf of other devices, so please answer with a list of all clock inputs according to datasheet/manual.

On earlier platforms, the GRF was not partitioned into separate functional small GRF units as on newer designs. Therefore, the 'grf' clock was designed as the clock dependency for all relevant modules.

Quoted 6 lines
Quoted 5 lines

For RK3588/RK3576 eDP module, the list of all clock inputs is:

CLK_EDP0_24M: Reference clock.
PCLK_EDP0: AHB clock.
HCLK_VO1/HCLK_VO0_ROOT: Video datapath clock.

Best regards,
Damon

author
#8 lore raw

PATCH v2 2/9 arm64: dts: rockchip: Add missing clock "hclk" for RK3588 eDP0 nodes.

In reply to Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes dc79d3d5e7c7 ("arm64: dts: rockchip: Add eDP0 node for RK3588")
---
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +2 -2
index 2a7921793020..4cf87d0c82cd 100644
@@ -1648,8 +1648,8 @@ hdmi0_out: port@1 {
 	edp0: edp@fdec0000 {
 		compatible = "rockchip,rk3588-edp";
 		reg = <0x0 0xfdec0000 0x0 0x1000>;
-		clocks = <&cru CLK_EDP0_24M>, <&cru PCLK_EDP0>;
-		clock-names = "dp", "pclk";
+		clocks = <&cru CLK_EDP0_24M>, <&cru PCLK_EDP0>, <&cru HCLK_VO1>;
+		clock-names = "dp", "pclk", "hclk";
 		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH 0>;
 		phys = <&hdptxphy0>;
 		phy-names = "dp";
Signature · 1 line
2.34.1
author
#9 lore raw

PATCH v2 3/9 arm64: dts: rockchip: Add missing clock "hclk" for RK3588 eDP1 nodes.

In reply to Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes a481bb0b1ad9 ("arm64: dts: rockchip: Add eDP1 dt node for rk3588")
---
 arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi +2 -2
index 6e5a58428bba..71fc4fc9e556 100644
@@ -285,8 +285,8 @@ hdmi1_out: port@1 {
 	edp1: edp@fded0000 {
 		compatible = "rockchip,rk3588-edp";
 		reg = <0x0 0xfded0000 0x0 0x1000>;
-		clocks = <&cru CLK_EDP1_24M>, <&cru PCLK_EDP1>;
-		clock-names = "dp", "pclk";
+		clocks = <&cru CLK_EDP1_24M>, <&cru PCLK_EDP1>, <&cru HCLK_VO1>;
+		clock-names = "dp", "pclk", "hclk";
 		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH 0>;
 		phys = <&hdptxphy1>;
 		phy-names = "dp";
Signature · 1 line
2.34.1
author
#10 lore raw

PATCH v2 4/9 drm/rockchip: analogix_dp: Enable clock "hclk" for RK3588

In reply to Damon Ding

The RK3588 eDP controller needs the video datapath clock "hclk" to work well. Previously, it works without explicitly adding this clock because the 'rockchip,vo-grf = <&vo1_grf>' property implicitly enables HCLK_VO1.

Fixes 729f8eefdcad ("drm/rockchip: analogix_dp: Add support for RK3588")
---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +6 -0
index 832e9766bef0..aa01ede4945e 100644
@@ -311,6 +311,7 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
 {
 	struct device *dev = dp->dev;
 	struct device_node *np = dev->of_node;
+	struct clk *clk;
 
 	dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
 	if (IS_ERR(dp->grf))
@@ -327,6 +328,11 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
 		return dev_err_probe(dev, PTR_ERR(dp->pclk),
 				     "failed to get pclk property\n");
 
+	clk = devm_clk_get_optional_enabled(dev, "hclk");
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk),
+				     "failed to get hclk property\n");
+
 	dp->rst = devm_reset_control_get(dev, "dp");
 	if (IS_ERR(dp->rst))
 		return dev_err_probe(dev, PTR_ERR(dp->rst),
Signature · 1 line
2.34.1
author
#11 lore raw

PATCH v2 5/9 dt-bindings: display: rockchip: analogix-dp: Add support for RK3576

In reply to Damon Ding

The eDP TX controller on RK3576 is the same as that on RK3588.

-----

Changes in v2:
- Split out a separate patch to add the "hclk" clock reference.

---
 .../bindings/display/rockchip/rockchip,analogix-dp.yaml         | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +2 -0
index d2bc8636b626..4496a43881f9 100644
@@ -15,6 +15,7 @@ properties:
     enum:
       - rockchip,rk3288-dp
       - rockchip,rk3399-edp
+      - rockchip,rk3576-edp
       - rockchip,rk3588-edp
 
   clocks:
@@ -67,6 +68,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - rockchip,rk3576-edp
               - rockchip,rk3588-edp
     then:
       properties:
Signature · 1 line
2.34.1
author
#12 lore raw

PATCH v2 6/9 arm64: dts: rockchip: Add eDP node for RK3576

In reply to Damon Ding

Add support for the eDP output on RK3576 SoC.

-----

Changes in v2:
- Add Reviewed-by tag.

---
 arch/arm64/boot/dts/rockchip/rk3576.dtsi | 28 ++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3576.dtsi +28 -0
index a86fc6b4e8c4..14900a66d3e1 100644
@@ -1446,6 +1446,34 @@ hdmi_out: port@1 {
 			};
 		};
 
+		edp: edp@27dc0000 {
+			compatible = "rockchip,rk3576-edp";
+			reg = <0x0 0x27dc0000 0x0 0x1000>;
+			clocks = <&cru CLK_EDP0_24M>, <&cru PCLK_EDP0>, <&cru HCLK_VO0_ROOT>;
+			clock-names = "dp", "pclk", "hclk";
+			interrupts = <GIC_SPI 365 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&hdptxphy>;
+			phy-names = "dp";
+			power-domains = <&power RK3576_PD_VO0>;
+			resets = <&cru SRST_EDP0_24M>, <&cru SRST_P_EDP0>;
+			reset-names = "dp", "apb";
+			rockchip,grf = <&vo0_grf>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				edp_in: port@0 {
+					reg = <0>;
+				};
+
+				edp_out: port@1 {
+					reg = <1>;
+				};
+			};
+		};
+
 		sai7: sai@27ed0000 {
 			compatible = "rockchip,rk3576-sai";
 			reg = <0x0 0x27ed0000 0x0 0x1000>;
Signature · 1 line
2.34.1
author
#13 lore raw

PATCH v2 7/9 drm/bridge: analogix_dp: Rename and simplify is_rockchip()

In reply to Damon Ding

Rename is_rockchip() to analogix_dp_is_rockchip() for naming consistency and readability, and simplify the code with switch.

---
 .../gpu/drm/bridge/analogix/analogix_dp_core.c |  2 +-
 .../gpu/drm/bridge/analogix/analogix_dp_reg.c  | 18 +++++++++---------
 include/drm/bridge/analogix_dp.h               | 11 +++++++++--
 3 files changed, 19 insertions(+), 12 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -1
index fe7158d9edde..045fdb77531f 100644
@@ -869,7 +869,7 @@ static int analogix_dp_bridge_atomic_check(struct drm_bridge *bridge,
 	struct drm_display_info *di = &conn_state->connector->display_info;
 	u32 mask = DRM_COLOR_FORMAT_YCBCR444 | DRM_COLOR_FORMAT_YCBCR422;
 
-	if (is_rockchip(dp->plat_data->dev_type)) {
+	if (analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
 		if ((di->color_formats & mask)) {
 			DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
 			di->color_formats &= ~mask;
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +9 -9
index 38fd8d5014d2..6207ded7ffd5 100644
@@ -72,7 +72,7 @@ void analogix_dp_init_analog_param(struct analogix_dp_device *dp)
 	reg = SEL_24M | TX_DVDD_BIT_1_0625V;
 	writel(reg, dp->reg_base + ANALOGIX_DP_ANALOG_CTL_2);
 
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) {
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
 		reg = REF_CLK_24M;
 		if (dp->plat_data->dev_type == RK3288_DP)
 			reg ^= REF_CLK_MASK;
@@ -123,7 +123,7 @@ void analogix_dp_reset(struct analogix_dp_device *dp)
 	analogix_dp_stop_video(dp);
 	analogix_dp_enable_video_mute(dp, 0);
 
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 		reg = RK_VID_CAP_FUNC_EN_N | RK_VID_FIFO_FUNC_EN_N |
 			SW_FUNC_EN_N;
 	else
@@ -233,7 +233,7 @@ void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable)
 	u32 mask = DP_PLL_PD;
 	u32 pd_addr = ANALOGIX_DP_PLL_CTL;
 
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) {
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
 		pd_addr = ANALOGIX_DP_PD;
 		mask = RK_PLL_PD;
 	}
@@ -254,12 +254,12 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
 	u32 phy_pd_addr = ANALOGIX_DP_PHY_PD;
 	u32 mask;
 
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 		phy_pd_addr = ANALOGIX_DP_PD;
 
 	switch (block) {
 	case AUX_BLOCK:
-		if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+		if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 			mask = RK_AUX_PD;
 		else
 			mask = AUX_PD;
@@ -317,7 +317,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
 		 * to power off everything instead of DP_PHY_PD in
 		 * Rockchip
 		 */
-		if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+		if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 			mask = DP_INC_BG;
 		else
 			mask = DP_PHY_PD;
@@ -329,7 +329,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
 			reg &= ~mask;
 
 		writel(reg, dp->reg_base + phy_pd_addr);
-		if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+		if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 			usleep_range(10, 15);
 		break;
 	case POWER_ALL:
@@ -465,7 +465,7 @@ void analogix_dp_init_aux(struct analogix_dp_device *dp)
 	analogix_dp_reset_aux(dp);
 
 	/* AUX_BIT_PERIOD_EXPECTED_DELAY doesn't apply to Rockchip IP */
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type))
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type))
 		reg = 0;
 	else
 		reg = AUX_BIT_PERIOD_EXPECTED_DELAY(3);
@@ -837,7 +837,7 @@ void analogix_dp_config_video_slave_mode(struct analogix_dp_device *dp)
 	u32 reg;
 
 	reg = readl(dp->reg_base + ANALOGIX_DP_FUNC_EN_1);
-	if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) {
+	if (dp->plat_data && analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
 		reg &= ~(RK_VID_CAP_FUNC_EN_N | RK_VID_FIFO_FUNC_EN_N);
 	} else {
 		reg &= ~(MASTER_VID_FUNC_EN_N | SLAVE_VID_FUNC_EN_N);
include/drm/bridge/analogix_dp.h +9 -2
index 854af692229b..7b670dd769e9 100644
@@ -19,9 +19,16 @@ enum analogix_dp_devtype {
 	RK3588_EDP,
 };
 
-static inline bool is_rockchip(enum analogix_dp_devtype type)
+static inline bool analogix_dp_is_rockchip(enum analogix_dp_devtype type)
 {
-	return type == RK3288_DP || type == RK3399_EDP || type == RK3588_EDP;
+	switch (type) {
+	case RK3288_DP:
+	case RK3399_EDP:
+	case RK3588_EDP:
+		return true;
+	default:
+		return false;
+	}
 }
 
 struct analogix_dp_plat_data {
Signature · 1 line
2.34.1
reviewer Reviewed-by on v2 7/9
#14 lore raw

Re: [PATCH v2 7/9] drm/bridge: analogix_dp: Rename and simplify is_rockchip()

Quoted 5 lines · Damon Ding

Rename is_rockchip() to analogix_dp_is_rockchip() for naming consistency and readability, and simplify the code with switch.

The patch content is OK:

However this won't apply without [0], correct?

So, worth mentioning in the cover letter that this series depends on the
[0] series.

[0] https://lore.kernel.org/all/[email protected]/

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

author
#15 lore raw

Re: [PATCH v2 7/9] drm/bridge: analogix_dp: Rename and simplify is_rockchip()

Hi Luca,

Quoted 8 lines · Luca Ceresoli
Quoted 5 lines · Damon Ding

Rename is_rockchip() to analogix_dp_is_rockchip() for naming consistency and readability, and simplify the code with switch.

The patch content is OK:

Quoted 9 lines

However this won't apply without [0], correct?

So, worth mentioning in the cover letter that this series depends on the
[0] series.

[0] https://lore.kernel.org/all/[email protected]/

Yes, I will add it in v3.

Best regards,
Damon

author
#16 lore raw

Re: [PATCH v2 7/9] drm/bridge: analogix_dp: Rename and simplify is_rockchip()

Hi Luca,

Quoted 13 lines · Damon Ding
Quoted 12 lines · Luca Ceresoli
Quoted 5 lines · Damon Ding

Rename is_rockchip() to analogix_dp_is_rockchip() for naming consistency and readability, and simplify the code with switch.

The patch content is OK:

However this won't apply without [0], correct?

Quoted 8 lines
Quoted 5 lines

So, worth mentioning in the cover letter that this series depends on the
[0] series.

[0] https://lore.kernel.org/all/20260319071452.1961274-8- [email protected]/

Yes, I will add it in v3.

BTW: Could you also help review the following two patches [0][1] when you get a chance? Your review would be much appreciated.

[0] https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/[email protected]/

Best regards,
Damon

author
#17 lore raw

PATCH v2 8/9 drm/bridge: analogix_dp: Add support for RK3576

In reply to Damon Ding

Expand enum analogix_dp_devtype with RK3576_EDP, and add max_link_rate and max_lane_count configs for it.

---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 +
 include/drm/bridge/analogix_dp.h                   | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -0
index 045fdb77531f..641f37fbea27 100644
@@ -1248,6 +1248,7 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 		video_info->max_link_rate = 0x0A;
 		video_info->max_lane_count = 0x04;
 		break;
+	case RK3576_EDP:
 	case RK3588_EDP:
 		video_info->max_link_rate = 0x14;
 		video_info->max_lane_count = 0x04;
include/drm/bridge/analogix_dp.h +2 -0
index 7b670dd769e9..0e0b87abee59 100644
@@ -16,6 +16,7 @@ enum analogix_dp_devtype {
 	EXYNOS_DP,
 	RK3288_DP,
 	RK3399_EDP,
+	RK3576_EDP,
 	RK3588_EDP,
 };
 
@@ -24,6 +25,7 @@ static inline bool analogix_dp_is_rockchip(enum analogix_dp_devtype type)
 	switch (type) {
 	case RK3288_DP:
 	case RK3399_EDP:
+	case RK3576_EDP:
 	case RK3588_EDP:
 		return true;
 	default:
Signature · 1 line
2.34.1
author
#19 lore raw

PATCH v2 9/9 drm/rockchip: analogix_dp: Add support for RK3576

In reply to Damon Ding

RK3576 integrates the Analogix eDP 1.3 TX controller IP and the HDMI/eDP TX Combo PHY based on a Samsung IP block - both of which are the same as those on RK3588.

The patch currently adds only the basic support, specifically RGB output up to 4K@60Hz, without the tests for audio, PSR and other eDP 1.3 specific features.

-----

Changes in v2:
- Split out a separate patch to enable the "hclk" clock.
- Add Reviewed-by tag.

---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +9 -0
index aa01ede4945e..942f81edddfa 100644
@@ -520,6 +520,14 @@ static const struct rockchip_dp_chip_data rk3288_dp[] = {
 	{ /* sentinel */ }
 };
 
+static const struct rockchip_dp_chip_data rk3576_edp[] = {
+	{
+		.chip_type = RK3576_EDP,
+		.reg = 0x27dc0000,
+	},
+	{ /* sentinel */ }
+};
+
 static const struct rockchip_dp_chip_data rk3588_edp[] = {
 	{
 		.edp_mode = GRF_REG_FIELD(0x0000, 0, 0),
@@ -537,6 +545,7 @@ static const struct rockchip_dp_chip_data rk3588_edp[] = {
 static const struct of_device_id rockchip_dp_dt_ids[] = {
 	{.compatible = "rockchip,rk3288-dp", .data = &rk3288_dp },
 	{.compatible = "rockchip,rk3399-edp", .data = &rk3399_edp },
+	{.compatible = "rockchip,rk3576-edp", .data = &rk3576_edp },
 	{.compatible = "rockchip,rk3588-edp", .data = &rk3588_edp },
 	{}
 };
Signature · 1 line
2.34.1
reviewer Reviewed-by on v2 9/9
#20 lore raw

Re: [PATCH v2 9/9] drm/rockchip: analogix_dp: Add support for RK3576

Quoted 10 lines · Damon Ding

RK3576 integrates the Analogix eDP 1.3 TX controller IP and the HDMI/eDP TX Combo PHY based on a Samsung IP block - both of which are the same as those on RK3588.

The patch currently adds only the basic support, specifically RGB output up to 4K@60Hz, without the tests for audio, PSR and other eDP 1.3 specific features.

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com