Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
@ 2026-11-27 15:27 Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

This series moves the Amlogic Meson HDMI TX PHY handling (covering GXBB,
GXL, GXM, and G12A SoCs) out of the meson_dw_hdmi DRM driver and into a
dedicated generic PHY driver.

Until now, meson_dw_hdmi directly manipulated the HHI system controller
registers (HHI_HDMI_PHY_CNTL0..5) to configure analog parameters, toggle
resets, and manage power states, as well as manually ungating HDMI
clocks and power domains already described in the DT.

By extracting this logic into a standalone PHY driver under
drivers/phy/amlogic/:
- Hardware representation in the DT is cleaner, modeling the HDMI TX PHY
  as a child node of the HHI syscon referenced via standard "phys"
  properties.
- The DRM bridge driver relies on the standard generic PHY API
  (phy_init, phy_configure, phy_power_on/off, phy_exit) rather than
  touching syscon registers directly.
- Legacy DTs lacking the "phys" property remain supported via a
  temporary fallback helper (meson_hdmi_phy_create_legacy) to preserve
  backward compatibility to be removed on next phase of component
  removal.

Overview of the series:
- Patches 1-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
  add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
  "hdmi-phy" child node under the HHI syscon.
- Patch 4: Rename the Meson8 HDMI TX PHY driver to be more SoC generic.
- Patch 5: Add GXBB, GXL, GXM and G12A SoCs to the Meson HDMI TX PHY
  driver, implementing the HDMI PHY configuration ops, along with the
  temporary legacy creation helper.
- Patch 6: Document the optional "phys" and properties in the
  amlogic,meson-dw-hdmi binding.
- Patch 7: Make meson-ee-pwrc power up the domain memories when the
  domain is already on at probe time, as this is a prerequisite for
  dropping the explicit write from meson_dw_hdmi
- Patches 8-9: Clean up manual HHI clock/power-domain writes in
  meson_dw_hdmi (relying on runtime PM instead) and convert the driver
  to use the generic PHY framework.
- Patches 10-12: Add the "hdmi-phy" child node and wire up the "phys"
  phandle for G12, GXBB, and GXL Device Trees.

Tested on:
- Khadas VIM1 (GXL)
- dtbs_check and dt_binding_check run cleanly with no new warnings.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
Changes in v5:
- Add Patch 4: Rename Meson8 HDMI TX driver to prepare other SoCs
               integration. Martin's review.
- Patch 5: Adapt the GXBB, GXL, GXM and G12A SoCs code to Patch 4.
- Link to v4: https://patch.msgid.link/20261123-meson-drm-create-hdmitx-phy-v4-0-3fb94f5534ca@aliel.fr

Changes in v4:
- Patch 2: Change commit title. Sashiko and Neil review.
- Patch 4: Change the phy min_rate to 15.9 MHz mathematical limit.
           Thanks to Sashiko's review.
- Patch 8: Drop introduced double free with phy_destroy.
           Add missing device_link_remove()
           Change the device_link order and use prepare/complete in the
           VPU drv for drm_mode_config_helper. Sashiko's review.
- Link to v3: https://patch.msgid.link/20261121-meson-drm-create-hdmitx-phy-v3-0-f8f471788076@aliel.fr

Changes in v3:
- Patch 6: reuse meson_ee_pwrc_mem_power_up() in meson_ee_pwrc_on()
  function.
- Patch 8: revert the code to v1 and add a device link to solve
  suspend/resume order in dpm_list.
- Link to v2: https://patch.msgid.link/20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr

Changes in v2:
- Patches 5,9-11: Remove unecessary "phy-names" for uniq phy.
                  Thanks to Neil's feedback.
- Add Patch 6: Power up the memories when the domain is already on.
               From Sashiko's feedback.
- Patch 4: Add a 600MHz max_rate and a 25Mhz min_rate check and
           exclude PHY_HDMI_MODE_FRL for phy_validate. Thx Sashiko.
- Patch 8: Move phy_init in dw_hdmi_phy_init and phy_exit
           in dw_hdmi_phy_disable. From Sashiko review.
- Link to v1: https://patch.msgid.link/20261117-meson-drm-create-hdmitx-phy-v1-0-9e0ac931381c@aliel.fr

To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Kevin Hilman <khilman@baylibre.com>
To: Jerome Brunet <jbrunet@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Vinod Koul <vkoul@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
To: Ronald Claveau <linux-kernel-dev@aliel.fr>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: Ulf Hansson <ulfh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-phy@lists.infradead.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-pm@vger.kernel.org

---
Ronald Claveau (12):
      dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
      dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY
      dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
      phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
      phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
      dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
      pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains
      drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
      drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
      arm64: dts: amlogic: Add HDMI TX PHY node for G12
      arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
      arm64: dts: amlogic: Add HDMI TX PHY node for GXL

 .../bindings/display/amlogic,meson-dw-hdmi.yaml    |   4 +
 .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml    |  33 ++
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  |  43 ++-
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi  |   6 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   6 +
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |   6 +
 drivers/gpu/drm/meson/Kconfig                      |   2 +
 drivers/gpu/drm/meson/meson_drv.c                  |  16 +-
 drivers/gpu/drm/meson/meson_dw_hdmi.c              | 223 +++++-------
 drivers/phy/amlogic/Kconfig                        |   9 +-
 drivers/phy/amlogic/Makefile                       |   2 +-
 drivers/phy/amlogic/phy-meson-hdmi-tx.c            | 391 +++++++++++++++++++++
 drivers/phy/amlogic/phy-meson8-hdmi-tx.c           | 160 ---------
 drivers/pmdomain/amlogic/meson-ee-pwrc.c           |  19 +-
 include/linux/phy/phy-meson-hdmi-tx.h              |  19 +
 15 files changed, 627 insertions(+), 312 deletions(-)
---
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09

Best regards,
--  
Ronald Claveau <linux-kernel-dev@aliel.fr>



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:37   ` sashiko-bot
  2026-11-27 15:27 ` [PATCH v5 02/12] dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY Ronald Claveau via B4 Relay
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The conditional schemas select on "compatible" with a bare enum. On a
list such as:

  compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";

an enum applied to the whole array only matches single-entry lists, so
the if: blocks never match as intended and the per-variant constraints
are not applied reliably.

Wrap the enums in "contains" so that the conditions match on any entry
of the compatible list.

Doing so exposes the "phy" child node of "amlogic,meson-gx-hhi-sysctrl":
it was forbidden (phy: false), but some DT legitimately describe an
"amlogic,g12a-mipi-dphy-analog" PHY node under this system controller,
which resulted in dtbs_check warnings such as:

  system-controller@0 (amlogic,meson-gx-hhi-sysctrl): False schema does
  not allow {'compatible': ['amlogic,g12a-mipi-dphy-analog'],
  '#phy-cells': 0, ...}

Allow the phy child node for amlogic,meson-gx-hhi-sysctrl by referencing
the amlogic,g12a-mipi-dphy-analog binding instead of rejecting it.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  | 32 +++++++++++++---------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
index f3a85c67ce8a..285edac4c082 100644
--- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
@@ -40,8 +40,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-hhi-sysctrl
     then:
       properties:
         clock-controller:
@@ -53,9 +54,10 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-hhi-sysctrl
-            - amlogic,meson-axg-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-hhi-sysctrl
+              - amlogic,meson-axg-hhi-sysctrl
     then:
       properties:
         clock-controller:
@@ -67,9 +69,10 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-ao-sysctrl
-            - amlogic,meson-axg-ao-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-ao-sysctrl
+              - amlogic,meson-axg-ao-sysctrl
     then:
       properties:
         clock-controller:
@@ -81,17 +84,20 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-gx-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-gx-hhi-sysctrl
     then:
       properties:
-        phy: false
+        phy:
+          $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
 
   - if:
       properties:
         compatible:
-          enum:
-            - amlogic,meson-axg-hhi-sysctrl
+          contains:
+            enum:
+              - amlogic,meson-axg-hhi-sysctrl
     then:
       properties:
         phy:

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 02/12] dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 03/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Add a YAML binding for the HDMI TX PHY found on Amlogic Meson SoCs.
It covers the GXBB, GXL and G12A variants, which are described by
their own compatible strings:

  - amlogic,meson-gxbb-hdmi-tx-phy
  - amlogic,meson-gxl-hdmi-tx-phy
  - amlogic,meson-g12a-hdmi-tx-phy

The PHY is a child of the HHI system controller.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml    | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml b/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml
new file mode 100644
index 000000000000..c5dd1036c375
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/amlogic,meson-hdmi-tx-phy.yaml
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/amlogic,meson-hdmi-tx-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic HDMI TX PHY
+
+maintainers:
+  - Ronald Claveau <linux-kernel-dev@aliel.fr>
+
+properties:
+  compatible:
+    enum:
+      - amlogic,meson-gxbb-hdmi-tx-phy
+      - amlogic,meson-gxl-hdmi-tx-phy
+      - amlogic,meson-g12a-hdmi-tx-phy
+
+  "#phy-cells":
+    const: 0
+
+required:
+  - compatible
+  - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hdmi-phy {
+        compatible = "amlogic,meson-gxbb-hdmi-tx-phy";
+        #phy-cells = <0>;
+    };

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 03/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 02/12] dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY found on Amlogic Meson SoCs is a child of the HHI
system controller.

Add an optional "hdmi-phy" child node referencing the
amlogic,meson-hdmi-tx-phy binding, and add it to the example.

The node is forbidden for the other system controller variants.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 .../bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
index 285edac4c082..97e47592aff2 100644
--- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
@@ -36,6 +36,9 @@ properties:
   phy:
     type: object
 
+  hdmi-phy:
+    $ref: /schemas/phy/amlogic,meson-hdmi-tx-phy.yaml
+
 allOf:
   - if:
       properties:
@@ -50,6 +53,7 @@ allOf:
 
         pinctrl: false
         phy: false
+        hdmi-phy: false
 
   - if:
       properties:
@@ -80,6 +84,7 @@ allOf:
 
         power-controller: false
         phy: false
+        hdmi-phy: false
 
   - if:
       properties:
@@ -104,6 +109,7 @@ allOf:
           oneOf:
             - $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
             - $ref: /schemas/phy/amlogic,meson-axg-mipi-pcie-analog.yaml
+        hdmi-phy: false
 
 required:
   - compatible
@@ -155,6 +161,11 @@ examples:
                 clocks = <&clk_vpu>, <&clk_vapb>;
                 clock-names = "vpu", "vapb";
             };
+
+            hdmi-phy {
+                compatible = "amlogic,meson-g12a-hdmi-tx-phy";
+                #phy-cells = <0>;
+            };
         };
     };
 

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (2 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 03/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:33   ` Neil Armstrong
  2026-11-27 15:27 ` [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY driver is currently named after the Meson8 family
(Meson8, Meson8b and Meson8m2), but the same IP block is found, with
SoC-specific register programming, on the newer GXBB, GXL, GXM and
G12A SoCs.

In preparation for adding support for these SoCs, make the driver
generic:

 - rename phy-meson8-hdmi-tx.c to phy-meson-hdmi-tx.c
 - rename the Kconfig symbol PHY_MESON8_HDMI_TX to PHY_MESON_HDMI_TX
   and update the Makefile accordingly
 - drop the "(ARCH_MESON && ARM)" dependency in favour of
   "ARCH_MESON", since the driver is no longer ARM32-only, and
   select GENERIC_PHY
 - rename the phy_meson8_hdmi_tx_* symbols to meson_hdmi_phy_*
 - update the platform driver name, the Kconfig help text and the
   module description
 - drop the unused <linux/property.h> include

No functional change intended: the only supported compatible remains
"amlogic,meson8-hdmi-tx-phy".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/phy/amlogic/Kconfig                        |  9 ++--
 drivers/phy/amlogic/Makefile                       |  2 +-
 .../{phy-meson8-hdmi-tx.c => phy-meson-hdmi-tx.c}  | 54 +++++++++++-----------
 3 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
index ce7ba3eb2a8e..294996869e83 100644
--- a/drivers/phy/amlogic/Kconfig
+++ b/drivers/phy/amlogic/Kconfig
@@ -2,14 +2,15 @@
 #
 # Phy drivers for Amlogic platforms
 #
-config PHY_MESON8_HDMI_TX
-	tristate "Meson8, Meson8b and Meson8m2 HDMI TX PHY driver"
-	depends on (ARCH_MESON && ARM) || COMPILE_TEST
+config PHY_MESON_HDMI_TX
+	tristate "Meson HDMI TX PHY driver"
+	depends on ARCH_MESON || COMPILE_TEST
 	depends on OF
+	select GENERIC_PHY
 	select MFD_SYSCON
 	help
 	  Enable this to support the HDMI TX PHYs found in Meson8,
-	  Meson8b and Meson8m2 SoCs.
+	  Meson8b, Meson8m2, GXBB, GXL, GXM and G12A SoCs.
 	  If unsure, say N.
 
 config PHY_MESON8B_USB2
diff --git a/drivers/phy/amlogic/Makefile b/drivers/phy/amlogic/Makefile
index 91e3b9790c03..2611ec8a056d 100644
--- a/drivers/phy/amlogic/Makefile
+++ b/drivers/phy/amlogic/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_PHY_MESON8_HDMI_TX)		+= phy-meson8-hdmi-tx.o
+obj-$(CONFIG_PHY_MESON_HDMI_TX)			+= phy-meson-hdmi-tx.o
 obj-$(CONFIG_PHY_MESON8B_USB2)			+= phy-meson8b-usb2.o
 obj-$(CONFIG_PHY_MESON_GXL_USB2)		+= phy-meson-gxl-usb2.o
 obj-$(CONFIG_PHY_MESON_G12A_USB2)		+= phy-meson-g12a-usb2.o
diff --git a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
similarity index 68%
rename from drivers/phy/amlogic/phy-meson8-hdmi-tx.c
rename to drivers/phy/amlogic/phy-meson-hdmi-tx.c
index f6b5df74a58f..e4e606ab4eef 100644
--- a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c
+++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
+ * Amlogic Meson HDMI TX PHY driver
+ * (Meson8/8b/8m2)
  *
  * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  */
@@ -13,7 +14,6 @@
 #include <linux/of.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
-#include <linux/property.h>
 #include <linux/regmap.h>
 
 /*
@@ -32,30 +32,30 @@
 
 #define HHI_HDMI_PHY_CNTL2				0x3a8
 
-struct phy_meson8_hdmi_tx_priv {
+struct meson_hdmi_phy {
 	struct regmap		*hhi;
 	struct clk		*tmds_clk;
 };
 
-static int phy_meson8_hdmi_tx_init(struct phy *phy)
+static int meson_hdmi_phy_init(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	return clk_prepare_enable(priv->tmds_clk);
 }
 
-static int phy_meson8_hdmi_tx_exit(struct phy *phy)
+static int meson_hdmi_phy_exit(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	clk_disable_unprepare(priv->tmds_clk);
 
 	return 0;
 }
 
-static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
+static int meson_hdmi_phy_power_on(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 	unsigned int i;
 	u16 hdmi_ctl0;
 
@@ -85,9 +85,9 @@ static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
 	return 0;
 }
 
-static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
+static int meson_hdmi_phy_power_off(struct phy *phy)
 {
-	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
 	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
 		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
@@ -96,18 +96,18 @@ static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
 	return 0;
 }
 
-static const struct phy_ops phy_meson8_hdmi_tx_ops = {
-	.init		= phy_meson8_hdmi_tx_init,
-	.exit		= phy_meson8_hdmi_tx_exit,
-	.power_on	= phy_meson8_hdmi_tx_power_on,
-	.power_off	= phy_meson8_hdmi_tx_power_off,
+static const struct phy_ops meson_hdmi_phy_ops = {
+	.init		= meson_hdmi_phy_init,
+	.exit		= meson_hdmi_phy_exit,
+	.power_on	= meson_hdmi_phy_power_on,
+	.power_off	= meson_hdmi_phy_power_off,
 	.owner		= THIS_MODULE,
 };
 
-static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
+static int meson_hdmi_phy_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct phy_meson8_hdmi_tx_priv *priv;
+	struct meson_hdmi_phy *priv;
 	struct phy_provider *phy_provider;
 	struct resource *res;
 	struct phy *phy;
@@ -128,7 +128,7 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->tmds_clk))
 		return PTR_ERR(priv->tmds_clk);
 
-	phy = devm_phy_create(&pdev->dev, np, &phy_meson8_hdmi_tx_ops);
+	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
 	if (IS_ERR(phy))
 		return PTR_ERR(phy);
 
@@ -140,21 +140,21 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
-static const struct of_device_id phy_meson8_hdmi_tx_of_match[] = {
+static const struct of_device_id meson_hdmi_phy_of_match[] = {
 	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, phy_meson8_hdmi_tx_of_match);
+MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
 
-static struct platform_driver phy_meson8_hdmi_tx_driver = {
-	.probe	= phy_meson8_hdmi_tx_probe,
+static struct platform_driver meson_hdmi_phy_driver = {
+	.probe	= meson_hdmi_phy_probe,
 	.driver	= {
-		.name		= "phy-meson8-hdmi-tx",
-		.of_match_table	= phy_meson8_hdmi_tx_of_match,
+		.name		= "meson-hdmi-tx-phy",
+		.of_match_table	= meson_hdmi_phy_of_match,
 	},
 };
-module_platform_driver(phy_meson8_hdmi_tx_driver);
+module_platform_driver(meson_hdmi_phy_driver);
 
 MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");
-MODULE_DESCRIPTION("Meson8, Meson8b and Meson8m2 HDMI TX PHY driver");
+MODULE_DESCRIPTION("Amlogic Meson HDMI TX PHY driver");
 MODULE_LICENSE("GPL v2");

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (3 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:34   ` Neil Armstrong
  2026-11-27 15:27 ` [PATCH v5 06/12] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Extend the Meson8 HDMI TX PHY driver  for the HDMI TX PHY found on
Amlogic GXBB, GXL, GXM and G12A SoCs. The PHY is controlled through
the HHI_HDMI_PHY_CNTL0..5 registers of the same HHI system controller,
but differ in the analog settings, in the CNTL1 enable bits
(FIFO enable and FIFO write enable on GXBB and newer) and in the
presence of CNTL3 to CNTL5. The PHY node is a child of the HHI syscon,
so the regmap is still obtained from the parent syscon.

To support this, move the Meson8 hardcoded values into per-SoC match
data (register init values, rate table and maximum TMDS character
rate). The TMDS clock is now only requested on Meson8, the only SoC
where it is needed.

The driver now implements the generic PHY HDMI configuration options:
.validate() accepts only 8 bpc and a TMDS character rate covered by
the per-SoC table, .configure() programs the analog settings matching
that rate, and .power_on()/.power_off() handle the reset sequence and
the return to the initial state. The Meson8 behaviour is preserved,
except that the analog settings are now programmed from .configure()
instead of .power_on(), and that the reset sequence uses
read-modify-write updates of the CNTL1 enable bits.

The per-SoC register values and rate thresholds for GXBB and newer are
taken from the existing HDMI TX code in meson_dw_hdmi.c, so that the
PHY handling can be moved out of the display driver.

For DTs that do not provide a "phys" property on the HDMI TX node,
export meson_hdmi_phy_create_legacy() so that the display driver can
still create the PHY itself. It is marked as deprecated and will be
removed together with the fallback in meson_dw_hdmi.c.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/phy/amlogic/phy-meson-hdmi-tx.c | 341 ++++++++++++++++++++++++++------
 include/linux/phy/phy-meson-hdmi-tx.h   |  19 ++
 2 files changed, 305 insertions(+), 55 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
index e4e606ab4eef..158b13e26a55 100644
--- a/drivers/phy/amlogic/phy-meson-hdmi-tx.c
+++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
@@ -1,18 +1,27 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Amlogic Meson HDMI TX PHY driver
- * (Meson8/8b/8m2)
+ * (Meson8/8b/8m2, GXBB / GXL / GXM / G12A)
  *
  * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ * Copyright (C) 2026 Ronald Claveau <linux-kernel-dev@aliel.fr>
+ *
+ * GXBB+ support Based on meson_dw_hdmi.c:
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
  */
 
 #include <linux/bitfield.h>
 #include <linux/bits.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/phy/phy.h>
+#include <linux/phy/phy-hdmi.h>
+#include <linux/phy/phy-meson-hdmi-tx.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 
@@ -22,26 +31,167 @@
  * Magic register values in the driver below are taken from the vendor
  * BSP / kernel.
  */
-#define HHI_HDMI_PHY_CNTL0				0x3a0
-	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL1		GENMASK(31, 16)
-	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL0		GENMASK(15, 0)
-
-#define HHI_HDMI_PHY_CNTL1				0x3a4
-	#define HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE		BIT(1)
-	#define HHI_HDMI_PHY_CNTL1_SOFT_RESET		BIT(0)
+#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
+#define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
+#define  PHY_CNTL1_INIT		0x03900000
+#define  PHY_INVERT		BIT(17)
+#define  PHY_CNTL1_SOFT_RESET	BIT(0)
+#define  PHY_CNTL1_CLOCK_EN	BIT(1)
+#define  PHY_CNTL1_FIFO_EN	BIT(2)	/* GXBB and newer */
+#define  PHY_CNTL1_FIFO_WR_EN	BIT(3)	/* GXBB and newer */
+
+#define HHI_HDMI_PHY_CNTL2	0x3a8 /* 0xea */
+#define HHI_HDMI_PHY_CNTL3	0x3ac /* 0xeb, GXBB and newer */
+#define HHI_HDMI_PHY_CNTL4	0x3b0 /* 0xec */
+#define HHI_HDMI_PHY_CNTL5	0x3b4 /* 0xed, G12A */
+
+/* The code resets the PHY 3 times in a row */
+#define PHY_RESET_COUNT		3
+
+struct meson_hdmi_phy_rate {
+	unsigned int min_rate;	/* TMDS character rate, in Hz */
+	u32 cntl0;
+	u32 cntl3;		/* only used if has_cntl3 */
+	u32 cntl5;		/* only used if has_cntl5 */
+};
 
-#define HHI_HDMI_PHY_CNTL2				0x3a8
+struct meson_hdmi_phy_data {
+	const struct meson_hdmi_phy_rate *rates;
+	unsigned int num_rates;
+	unsigned int max_rate;	/* Hz, TMDS character rate maximum */
+	bool has_tmds_clk;	/* Meson8 only */
+	bool has_cntl3;
+	bool has_cntl5;
+	u32 cntl0_init;
+	u32 cntl1_init;
+	u32 cntl1_en;		/* CNTL1 enable bits (clock, fifo, ...) */
+};
 
 struct meson_hdmi_phy {
-	struct regmap		*hhi;
-	struct clk		*tmds_clk;
+	struct regmap *hhi;
+	struct clk *tmds_clk;	/* optional, Meson8 only */
+	const struct meson_hdmi_phy_data *data;
+};
+
+/* Meson8, Meson8b, Meson8m2 */
+static const struct meson_hdmi_phy_rate meson8_rates[] = {
+	/* 2.97Gbps */
+	{ 297000000, 0x08c31e8b },
+	/* below 2.97Gbps, down to 250Mbps */
+	{ 25000000,  0x08c34d0b },
+};
+
+/* GXBB */
+static const struct meson_hdmi_phy_rate gxbb_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x33353245, 0x2100115b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33634283, 0xb000115b },
+	/* 1.485Gbps, down to 159Mbps */
+	{ 15900000,  0x33632122, 0x2000115b },
+};
+
+/* GXL / GXM */
+static const struct meson_hdmi_phy_rate gxl_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x333d3282, 0x2136315b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33303382, 0x2036315b },
+	/* 1.485Gbps */
+	{ 148500000, 0x33303362, 0x2016315b },
+	/* 742.5Mbps, down to 159Mbps */
+	{ 15900000,  0x33604142, 0x0016315b },
+};
+
+/* G12A */
+static const struct meson_hdmi_phy_rate g12a_rates[] = {
+	/* 5.94Gbps, 3.7125Gbps */
+	{ 371250000, 0x37eb65c4, 0x2ab0ff3b, 0x0000080b },
+	/* 2.97Gbps */
+	{ 297000000, 0x33eb6262, 0x2ab0ff3b, 0x00000003 },
+	/* 1.485Gbps, down to 159Mbps */
+	{ 15900000,  0x33eb4242, 0x2ab0ff3b, 0x00000003 },
+};
+
+static const struct meson_hdmi_phy_data meson8_data = {
+	.rates = meson8_rates,
+	.num_rates = ARRAY_SIZE(meson8_rates),
+	.max_rate = 297000000, /* HDMI 1.4b limited to 4k@30 */
+	.has_tmds_clk = true,
+	.cntl0_init = 0x08418d00,
+	.cntl1_init = 0x0,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN,
+};
+
+static const struct meson_hdmi_phy_data gxbb_data = {
+	.rates = gxbb_rates,
+	.num_rates = ARRAY_SIZE(gxbb_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.cntl0_init = 0x0,
+	.cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
+};
+
+static const struct meson_hdmi_phy_data gxl_data = {
+	.rates = gxl_rates,
+	.num_rates = ARRAY_SIZE(gxl_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.cntl0_init = 0x0,
+	.cntl1_init = PHY_CNTL1_INIT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
+};
+
+static const struct meson_hdmi_phy_data g12a_data = {
+	.rates = g12a_rates,
+	.num_rates = ARRAY_SIZE(g12a_rates),
+	.max_rate  = 600000000, /* HDMI 2.0 */
+	.has_cntl3 = true,
+	.has_cntl5 = true,
+	.cntl0_init = 0x000b4242, /* Bandgap */
+	.cntl1_init = PHY_CNTL1_INIT,
+	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
+		    PHY_CNTL1_FIFO_WR_EN,
 };
 
+static const struct meson_hdmi_phy_rate *
+meson_hdmi_phy_find_rate(const struct meson_hdmi_phy_data *data, u64 rate)
+{
+	unsigned int i;
+
+	if (rate > data->max_rate)
+		return NULL;
+
+	for (i = 0; i < data->num_rates; i++)
+		if (rate >= data->rates[i].min_rate)
+			return &data->rates[i];
+
+	return NULL;
+}
+
+/* Fallback to init mode: CNTL1 first, then CNTL0 (order matters) */
+static void meson_hdmi_phy_set_init_state(struct meson_hdmi_phy *priv)
+{
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, priv->data->cntl1_init);
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, priv->data->cntl0_init);
+}
+
 static int meson_hdmi_phy_init(struct phy *phy)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+	int ret;
 
-	return clk_prepare_enable(priv->tmds_clk);
+	/* No-op if there is no clock (GXBB and newer) */
+	ret = clk_prepare_enable(priv->tmds_clk);
+	if (ret)
+		return ret;
+
+	meson_hdmi_phy_set_init_state(priv);
+
+	return 0;
 }
 
 static int meson_hdmi_phy_exit(struct phy *phy)
@@ -53,33 +203,64 @@ static int meson_hdmi_phy_exit(struct phy *phy)
 	return 0;
 }
 
-static int meson_hdmi_phy_power_on(struct phy *phy)
+static int meson_hdmi_phy_configure(struct phy *phy,
+				    union phy_configure_opts *opts)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
-	unsigned int i;
-	u16 hdmi_ctl0;
+	const struct meson_hdmi_phy_rate *r;
+
+	r = meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate);
+	if (!r)
+		return -EINVAL;
+
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, r->cntl0);
+	if (priv->data->has_cntl3)
+		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, r->cntl3);
+	if (priv->data->has_cntl5)
+		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, r->cntl5);
+
+	/* Disable clock, (and fifo, fifo_wr where present), release reset */
+	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+			   priv->data->cntl1_en | PHY_CNTL1_SOFT_RESET, 0);
 
-	if (clk_get_rate(priv->tmds_clk) >= 2970UL * 1000 * 1000)
-		hdmi_ctl0 = 0x1e8b;
-	else
-		hdmi_ctl0 = 0x4d0b;
+	return 0;
+}
+
+static int meson_hdmi_phy_validate(struct phy *phy, enum phy_mode mode,
+				   int submode, union phy_configure_opts *opts)
+{
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x08c3) |
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, hdmi_ctl0));
+	if (mode != PHY_MODE_HDMI || submode != PHY_HDMI_MODE_TMDS)
+		return -EINVAL;
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, 0x0);
+	if (opts->hdmi.bpc != 8)
+		return -EINVAL;
 
-	/* Reset three times, just like the vendor driver does */
-	for (i = 0; i < 3; i++) {
-		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
-			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE |
-			     HHI_HDMI_PHY_CNTL1_SOFT_RESET);
-		usleep_range(1000, 2000);
+	if (!meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate))
+		return -EINVAL;
+
+	return 0;
+}
 
-		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
-			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE);
-		usleep_range(1000, 2000);
+static int meson_hdmi_phy_power_on(struct phy *phy)
+{
+	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
+	u32 en = priv->data->cntl1_en;
+	u32 mask = en | PHY_CNTL1_SOFT_RESET;
+	int i;
+
+	/* Reset PHY 3 times in a row */
+	for (i = 0; i < PHY_RESET_COUNT; i++) {
+		/* Enable and software reset */
+		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+				   mask, mask);
+		fsleep(2000);
+
+		/* Enable and unreset */
+		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
+				   mask, en);
+		fsleep(2000);
 	}
 
 	return 0;
@@ -89,9 +270,7 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
 {
 	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
 
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
-		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, 0x8d00));
+	meson_hdmi_phy_set_init_state(priv);
 
 	return 0;
 }
@@ -99,41 +278,90 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
 static const struct phy_ops meson_hdmi_phy_ops = {
 	.init		= meson_hdmi_phy_init,
 	.exit		= meson_hdmi_phy_exit,
+	.configure	= meson_hdmi_phy_configure,
+	.validate	= meson_hdmi_phy_validate,
 	.power_on	= meson_hdmi_phy_power_on,
 	.power_off	= meson_hdmi_phy_power_off,
 	.owner		= THIS_MODULE,
 };
 
-static int meson_hdmi_phy_probe(struct platform_device *pdev)
+static struct phy *meson_hdmi_phy_alloc(struct device *dev,
+					struct regmap *hhi,
+					struct clk *tmds_clk,
+					const struct meson_hdmi_phy_data *data)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct meson_hdmi_phy *priv;
-	struct phy_provider *phy_provider;
-	struct resource *res;
 	struct phy *phy;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
-	priv = devm_kzalloc_obj(&pdev->dev, *priv);
+	priv = devm_kzalloc_obj(dev, *priv);
 	if (!priv)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
-	priv->hhi = syscon_node_to_regmap(np->parent);
-	if (IS_ERR(priv->hhi))
-		return PTR_ERR(priv->hhi);
+	priv->hhi = hhi;
+	priv->tmds_clk = tmds_clk;
+	priv->data = data;
 
-	priv->tmds_clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(priv->tmds_clk))
-		return PTR_ERR(priv->tmds_clk);
-
-	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
+	phy = devm_phy_create(dev, NULL, &meson_hdmi_phy_ops);
 	if (IS_ERR(phy))
-		return PTR_ERR(phy);
+		return phy;
 
 	phy_set_drvdata(phy, priv);
 
+	return phy;
+}
+
+/*
+ * DEPRECATED: only for DTs without a "phys" property on the HDMI TX node.
+ * Remove together with the fallback in meson_dw_hdmi.c.
+ */
+struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
+					 struct regmap *hhi,
+					 enum meson_hdmi_phy_soc soc)
+{
+	static const struct meson_hdmi_phy_data *const soc_data[] = {
+		[MESON_HDMI_PHY_GXBB] = &gxbb_data,
+		[MESON_HDMI_PHY_GXL]  = &gxl_data,
+		[MESON_HDMI_PHY_G12A] = &g12a_data,
+	};
+
+	if (soc >= ARRAY_SIZE(soc_data))
+		return ERR_PTR(-EINVAL);
+
+	return meson_hdmi_phy_alloc(dev, hhi, NULL, soc_data[soc]);
+}
+EXPORT_SYMBOL_GPL(meson_hdmi_phy_create_legacy);
+
+static int meson_hdmi_phy_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	const struct meson_hdmi_phy_data *data;
+	struct phy_provider *phy_provider;
+	struct clk *tmds_clk = NULL;
+	struct regmap *hhi;
+	struct phy *phy;
+
+	data = of_device_get_match_data(dev);
+	if (!data)
+		return -EINVAL;
+
+	/* The PHY node is a child of the HHI syscon */
+	hhi = syscon_node_to_regmap(dev->of_node->parent);
+	if (IS_ERR(hhi))
+		return dev_err_probe(dev, PTR_ERR(hhi),
+				     "failed to get HHI regmap\n");
+
+	if (data->has_tmds_clk) {
+		tmds_clk = devm_clk_get(dev, NULL);
+		if (IS_ERR(tmds_clk))
+			return dev_err_probe(dev, PTR_ERR(tmds_clk),
+					     "failed to get TMDS clock\n");
+	}
+
+	phy = meson_hdmi_phy_alloc(dev, hhi, tmds_clk, data);
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
+
 	phy_provider = devm_of_phy_provider_register(&pdev->dev,
 						     of_phy_simple_xlate);
 
@@ -141,7 +369,10 @@ static int meson_hdmi_phy_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id meson_hdmi_phy_of_match[] = {
-	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
+	{ .compatible = "amlogic,meson8-hdmi-tx-phy",     .data = &meson8_data },
+	{ .compatible = "amlogic,meson-gxbb-hdmi-tx-phy", .data = &gxbb_data },
+	{ .compatible = "amlogic,meson-gxl-hdmi-tx-phy",  .data = &gxl_data },
+	{ .compatible = "amlogic,meson-g12a-hdmi-tx-phy", .data = &g12a_data },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
diff --git a/include/linux/phy/phy-meson-hdmi-tx.h b/include/linux/phy/phy-meson-hdmi-tx.h
new file mode 100644
index 000000000000..fe76a5f7efdb
--- /dev/null
+++ b/include/linux/phy/phy-meson-hdmi-tx.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __PHY_MESON_HDMI_TX_H
+#define __PHY_MESON_HDMI_TX_H
+
+struct device;
+struct regmap;
+
+enum meson_hdmi_phy_soc {
+	MESON_HDMI_PHY_GXBB,
+	MESON_HDMI_PHY_GXL,	/* GXL and GXM */
+	MESON_HDMI_PHY_G12A,
+};
+
+/* DEPRECATED: compat for DTs without "phys" on the HDMI TX node */
+struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
+					 struct regmap *hhi,
+					 enum meson_hdmi_phy_soc soc);
+
+#endif /* __PHY_MESON_HDMI_TX_H */

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 06/12] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (4 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 07/12] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY now has its own binding and driver. Describe the link
between the HDMI TX controller and its PHY with a "phys" property
holding a single phandle, and update the example accordingly.

The property is optional so that existing DT, which do not describe
the PHY, keep validating; the driver falls back to creating the PHY
itself in that case.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
index 416fe263ac92..7ece4ea262bd 100644
--- a/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
@@ -108,6 +108,9 @@ properties:
 
   sound-name-prefix: true
 
+  phys:
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -136,6 +139,7 @@ examples:
         power-domains = <&pd_vpu>;
         #address-cells = <1>;
         #size-cells = <0>;
+        phys = <&hdmi_tx_phy>;
 
         /* VPU VENC Input */
         hdmi_tx_venc_port: port@0 {

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 07/12] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (5 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 06/12] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 08/12] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

When a power domain is found already powered on at probe time (typically
the VPU domain left enabled by the bootloader), the driver registers the
genpd in the ON state with GENPD_FLAG_ALWAYS_ON and never calls
meson_ee_pwrc_on(). As a result, the memory power-down bits of the domain
are not touched.

pwrc_ee_is_powered_off() only checks the top-level sleep bit, so a
bootloader that enabled the VPU without waking every memory block
leaves those memories powered down, and nothing in the genpd framework
will wake them since pm_runtime_resume_and_get() is a no-op for an
always-on domain.

This is a preparatory change: a following patch drops the explicit
HHI_MEM_PD_REG0 write from the meson_dw_hdmi driver, which relies on the
power domain to power the HDMITX memory.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/pmdomain/amlogic/meson-ee-pwrc.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
index 338f70d77bf0..b3ae5cd7bea8 100644
--- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
+++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
@@ -392,11 +392,21 @@ static int meson_ee_pwrc_off(struct generic_pm_domain *domain)
 	return 0;
 }
 
+static void meson_ee_pwrc_mem_power_up(struct meson_ee_pwrc_domain *dom)
+{
+	int i;
+
+	for (i = 0; i < dom->desc.mem_pd_count; i++)
+		regmap_update_bits(dom->pwrc->regmap_hhi,
+				   dom->desc.mem_pd[i].reg,
+				   dom->desc.mem_pd[i].mask, 0);
+}
+
 static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
 {
 	struct meson_ee_pwrc_domain *pwrc_domain =
 		container_of(domain, struct meson_ee_pwrc_domain, base);
-	int i, ret;
+	int ret;
 
 	if (pwrc_domain->desc.top_pd)
 		regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
@@ -404,10 +414,7 @@ static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
 				   pwrc_domain->desc.top_pd->sleep_mask, 0);
 	udelay(20);
 
-	for (i = 0 ; i < pwrc_domain->desc.mem_pd_count ; ++i)
-		regmap_update_bits(pwrc_domain->pwrc->regmap_hhi,
-				   pwrc_domain->desc.mem_pd[i].reg,
-				   pwrc_domain->desc.mem_pd[i].mask, 0);
+	meson_ee_pwrc_mem_power_up(pwrc_domain);
 
 	udelay(20);
 
@@ -478,6 +485,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
          * prepare/enable counters won't be in sync.
          */
 	if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
+		meson_ee_pwrc_mem_power_up(dom);
+
 		ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
 		if (ret)
 			return ret;

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 08/12] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (6 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 07/12] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 09/12] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

meson_dw_hdmi_init() programs two HHI registers by hand: the HDMI clock
mux/divider/gate (HHI_HDMI_CLK_CNTL) and the HDMITX memory power-down
bits (HHI_MEM_PD_REG0). Both are already covered by resources described
in the DT:

 - the HDMI clock is selected and rated through assigned-clocks
   (CLKID_HDMI_SEL parented to xtal, CLKID_HDMI at 24 MHz), and gated
   through the "isfr" clock, which the driver already enables at bind
   time;
 - the memory power-down bits are handled by the VPU power domain
   referenced by "power-domains".

Remove the open-coded register writes. Take an explicit runtime PM
reference in probe and release it on removal, so that the domain is
guaranteed to be on for the lifetime of the device.

The driver now relies on runtime PM to power the HDMITX memory, so make
it depend on PM.

Those properties are optional in the binding and were only added to the
in-tree DTs in v6.11, so DTs without them would no longer get the
registers programmed by the kernel. This is not a concern in practice:

 - the DT used by the kernel often comes from U-Boot, which used a DT
   based on Linux v6.2 before v2024.07 and has used the DT synchronized
   with Linux since then, matching the v6.11 DT with the clock changes;
 - U-Boot already sets HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 when
   probing dw_hdmi, since v2019.04, so both registers are already in the
   expected state when Linux boots, even with an older U-Boot and DT.

The risk of regression is therefore very low.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/gpu/drm/meson/Kconfig         |  1 +
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 31 ++++++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 417f79829cf8..6645665f6038 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -17,6 +17,7 @@ config DRM_MESON
 config DRM_MESON_DW_HDMI
 	tristate "HDMI Synopsys Controller support for Amlogic Meson Display"
 	depends on DRM_MESON
+	depends on PM
 	default y if DRM_MESON
 	select DRM_DW_HDMI
 	imply DRM_DW_HDMI_I2S_AUDIO
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index eb33c70f29c3..20a821936b3a 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -12,6 +12,7 @@
 #include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
@@ -102,8 +103,6 @@
 #define HDMITX_DWC_CTRL_REG	0x18
 
 /* HHI Registers */
-#define HHI_MEM_PD_REG0		0x100 /* 0x40 */
-#define HHI_HDMI_CLK_CNTL	0x1cc /* 0x73 */
 #define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
 #define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
 #define  PHY_CNTL1_INIT		0x03900000
@@ -599,12 +598,6 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 {
 	struct meson_drm *priv = meson_dw_hdmi->priv;
 
-	/* Enable clocks */
-	regmap_update_bits(priv->hhi, HHI_HDMI_CLK_CNTL, 0xffff, 0x100);
-
-	/* Bring HDMITX MEM output of power down */
-	regmap_update_bits(priv->hhi, HHI_MEM_PD_REG0, 0xff << 8, 0);
-
 	/* Reset HDMITX APB & TX & PHY */
 	reset_control_reset(meson_dw_hdmi->hdmitx_apb);
 	reset_control_reset(meson_dw_hdmi->hdmitx_ctrl);
@@ -829,9 +822,29 @@ static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
 	return 0;
 }
 
+static void meson_dw_hdmi_pm_put(void *dev)
+{
+	pm_runtime_put_sync(dev);
+}
+
 static int meson_dw_hdmi_probe(struct platform_device *pdev)
 {
-	return component_add(&pdev->dev, &meson_dw_hdmi_ops);
+	struct device *dev = &pdev->dev;
+	int ret;
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return ret;
+
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to power on HDMI TX\n");
+
+	ret = devm_add_action_or_reset(dev, meson_dw_hdmi_pm_put, dev);
+	if (ret)
+		return ret;
+
+	return component_add(dev, &meson_dw_hdmi_ops);
 }
 
 static void meson_dw_hdmi_remove(struct platform_device *pdev)

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 09/12] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (7 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 08/12] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 10/12] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

The HDMI TX PHY registers (HHI_HDMI_PHY_CNTL0..5) were programmed
directly from this driver, with per-SoC tables selected by compatible
string. A dedicated PHY driver now exists, so use it through the
generic PHY API instead:

 - phy_init() replaces the initial CNTL0/CNTL1 programming,
 - phy_configure() replaces meson_hdmi_phy_setup_mode(), the TMDS
   character rate being derived from the (possibly 4:2:0 halved) pixel
   clock, with 8 bpc as before,
 - phy_power_on() replaces the three successive PHY resets,
 - phy_power_off() replaces the fallback to the initial state in
   dw_hdmi_phy_disable().

The "hdmi" PHY is looked up through the "phys" property of the HDMI TX
node. Device trees that do not provide it keep working: in that case
the PHY is created by this driver through
meson_hdmi_phy_create_legacy(), using a per-SoC identifier replacing the
former cntl0_init/cntl1_init fields, and a warning is printed. This
fallback is deprecated and will be removed once all device trees have
been converted.

meson_dw_hdmi_init() can now fail, so propagate its return value from
probe and resume. Select PHY_MESON_HDMI_TX in Kconfig since the driver
now depends on it, including for the legacy path.

Add a device link with hdmi-tx as consumer and vpu as supplier to get
the correct order on suspend/resume.

Move the atomic suspend/resume to the .prepare/.complete callbacks. This
guarantees:

  suspend: power_off (prepare) -> phy_exit (suspend)
  resume : venc_init (resume)  -> phy_init (resume) -> power_on (complete)

The constraints are:

 - phy_exit() must come after phy_power_off(), which is done by the
   atomic disable in drm_mode_config_helper_suspend().
 - phy_init() must come after meson_venc_init(), which writes 0 to
   HHI_HDMI_PHY_CNTL0 and would otherwise clobber the value programmed
   by phy_init() (bandgap on G12A).
 - phy_power_on() must come after phy_init(), otherwise the PHY core
   warns that it was called before phy_init.

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 drivers/gpu/drm/meson/Kconfig         |   1 +
 drivers/gpu/drm/meson/meson_drv.c     |  16 ++-
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 192 +++++++++++++---------------------
 3 files changed, 89 insertions(+), 120 deletions(-)

diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 6645665f6038..a91cf851314a 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -20,6 +20,7 @@ config DRM_MESON_DW_HDMI
 	depends on PM
 	default y if DRM_MESON
 	select DRM_DW_HDMI
+	select PHY_MESON_HDMI_TX
 	imply DRM_DW_HDMI_I2S_AUDIO
 
 config DRM_MESON_DW_MIPI_DSI
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 38bf2811d068..5343323f404a 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -422,7 +422,7 @@ static const struct component_master_ops meson_drv_master_ops = {
 	.unbind	= meson_drv_unbind,
 };
 
-static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
+static int meson_drv_pm_prepare(struct device *dev)
 {
 	struct meson_drm *priv = dev_get_drvdata(dev);
 
@@ -432,6 +432,14 @@ static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
 	return drm_mode_config_helper_suspend(priv->drm);
 }
 
+static void meson_drv_pm_complete(struct device *dev)
+{
+	struct meson_drm *priv = dev_get_drvdata(dev);
+
+	if (priv)
+		drm_mode_config_helper_resume(priv->drm);
+}
+
 static int __maybe_unused meson_drv_pm_resume(struct device *dev)
 {
 	struct meson_drm *priv = dev_get_drvdata(dev);
@@ -446,7 +454,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
 	if (priv->afbcd.ops)
 		priv->afbcd.ops->init(priv);
 
-	return drm_mode_config_helper_resume(priv->drm);
+	return 0;
 }
 
 static void meson_drv_shutdown(struct platform_device *pdev)
@@ -553,7 +561,9 @@ static const struct of_device_id dt_match[] = {
 MODULE_DEVICE_TABLE(of, dt_match);
 
 static const struct dev_pm_ops meson_drv_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(meson_drv_pm_suspend, meson_drv_pm_resume)
+	.prepare = meson_drv_pm_prepare,
+	.complete  = meson_drv_pm_complete,
+	SET_SYSTEM_SLEEP_PM_OPS(NULL, meson_drv_pm_resume)
 };
 
 static struct platform_driver meson_drm_platform_driver = {
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 20a821936b3a..ec21d13775b7 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -11,6 +11,8 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/phy/phy.h>
+#include <linux/phy/phy-meson-hdmi-tx.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
@@ -102,16 +104,6 @@
 #define HDMITX_DWC_DATA_REG	0x14
 #define HDMITX_DWC_CTRL_REG	0x18
 
-/* HHI Registers */
-#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
-#define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
-#define  PHY_CNTL1_INIT		0x03900000
-#define  PHY_INVERT		BIT(17)
-#define HHI_HDMI_PHY_CNTL2	0x3a8 /* 0xea */
-#define HHI_HDMI_PHY_CNTL3	0x3ac /* 0xeb */
-#define HHI_HDMI_PHY_CNTL4	0x3b0 /* 0xec */
-#define HHI_HDMI_PHY_CNTL5	0x3b4 /* 0xed */
-
 static DEFINE_SPINLOCK(reg_lock);
 
 enum meson_venc_source {
@@ -131,8 +123,7 @@ struct meson_dw_hdmi_data {
 				    unsigned int addr);
 	void		(*dwc_write)(struct meson_dw_hdmi *dw_hdmi,
 				     unsigned int addr, unsigned int data);
-	u32 cntl0_init;
-	u32 cntl1_init;
+	enum meson_hdmi_phy_soc phy_soc;	/* legacy PHY only */
 };
 
 struct meson_dw_hdmi {
@@ -147,6 +138,8 @@ struct meson_dw_hdmi {
 	u32 irq_stat;
 	struct dw_hdmi *hdmi;
 	struct drm_bridge *bridge;
+	struct phy *phy;
+	bool legacy_phy;
 };
 
 static inline int dw_hdmi_is_compatible(struct meson_dw_hdmi *dw_hdmi,
@@ -273,87 +266,6 @@ static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi,
 
 /* Bridge */
 
-/* Setup PHY bandwidth modes */
-static void meson_hdmi_phy_setup_mode(struct meson_dw_hdmi *dw_hdmi,
-				      const struct drm_display_mode *mode,
-				      bool mode_is_420)
-{
-	struct meson_drm *priv = dw_hdmi->priv;
-	unsigned int pixel_clock = mode->clock;
-
-	/* For 420, pixel clock is half unlike venc clock */
-	if (mode_is_420) pixel_clock /= 2;
-
-	if (dw_hdmi_is_compatible(dw_hdmi, "amlogic,meson-gxl-dw-hdmi") ||
-	    dw_hdmi_is_compatible(dw_hdmi, "amlogic,meson-gxm-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x333d3282);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2136315b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33303382);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2036315b);
-		} else if (pixel_clock >= 148500) {
-			/* 1.485Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33303362);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2016315b);
-		} else {
-			/* 742.5Mbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33604142);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x0016315b);
-		}
-	} else if (dw_hdmi_is_compatible(dw_hdmi,
-					 "amlogic,meson-gxbb-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33353245);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2100115b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33634283);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0xb000115b);
-		} else {
-			/* 1.485Gbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33632122);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2000115b);
-		}
-	} else if (dw_hdmi_is_compatible(dw_hdmi,
-					 "amlogic,meson-g12a-dw-hdmi")) {
-		if (pixel_clock >= 371250) {
-			/* 5.94Gbps, 3.7125Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x37eb65c4);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x0000080b);
-		} else if (pixel_clock >= 297000) {
-			/* 2.97Gbps */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33eb6262);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x00000003);
-		} else {
-			/* 1.485Gbps, and below */
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0x33eb4242);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, 0x2ab0ff3b);
-			regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, 0x00000003);
-		}
-	}
-}
-
-static inline void meson_dw_hdmi_phy_reset(struct meson_dw_hdmi *dw_hdmi)
-{
-	struct meson_drm *priv = dw_hdmi->priv;
-
-	/* Enable and software reset */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0xf);
-
-	mdelay(2);
-
-	/* Enable and unreset */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0xe);
-
-	mdelay(2);
-}
-
 static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 			    const struct drm_display_info *display,
 			    const struct drm_display_mode *mode)
@@ -364,6 +276,9 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 	unsigned int wr_clk =
 		readl_relaxed(priv->io_base + _REG(VPU_HDMI_SETTING));
 	bool mode_is_420 = false;
+	unsigned int pixel_clock = mode->clock;
+	union phy_configure_opts opts = {};
+	int ret;
 
 	DRM_DEBUG_DRIVER("\"%s\" div%d\n", mode->name,
 			 mode->clock > 340000 ? 40 : 10);
@@ -392,19 +307,22 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
 	dw_hdmi->data->top_write(dw_hdmi, HDMITX_TOP_TMDS_CLK_PTTN_CNTL, 0x2);
 
 	/* Setup PHY parameters */
-	meson_hdmi_phy_setup_mode(dw_hdmi, mode, mode_is_420);
-
-	/* Disable clock, fifo, fifo_wr */
-	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1, 0xf, 0);
+	if (mode_is_420)
+		pixel_clock /= 2;
+	opts.hdmi.tmds_char_rate = (u64)pixel_clock * 1000;
+	opts.hdmi.bpc = 8;
+	ret = phy_configure(dw_hdmi->phy, &opts);
+	if (ret)
+		return ret;
 
 	dw_hdmi_set_high_tmds_clock_ratio(hdmi, display);
 
 	msleep(100);
 
 	/* Reset PHY 3 times in a row */
-	meson_dw_hdmi_phy_reset(dw_hdmi);
-	meson_dw_hdmi_phy_reset(dw_hdmi);
-	meson_dw_hdmi_phy_reset(dw_hdmi);
+	ret = phy_power_on(dw_hdmi->phy);
+	if (ret)
+		return ret;
 
 	/* Temporary Disable VENC video stream */
 	if (priv->venc.hdmi_use_enci)
@@ -443,13 +361,11 @@ static void dw_hdmi_phy_disable(struct dw_hdmi *hdmi,
 				void *data)
 {
 	struct meson_dw_hdmi *dw_hdmi = (struct meson_dw_hdmi *)data;
-	struct meson_drm *priv = dw_hdmi->priv;
 
 	DRM_DEBUG_DRIVER("\n");
 
 	/* Fallback to init mode */
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, dw_hdmi->data->cntl1_init);
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, dw_hdmi->data->cntl0_init);
+	phy_power_off(dw_hdmi->phy);
 }
 
 static enum drm_connector_status dw_hdmi_read_hpd(struct dw_hdmi *hdmi,
@@ -572,8 +488,7 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_gxbb_data = {
 	.top_write = dw_hdmi_top_write,
 	.dwc_read = dw_hdmi_dwc_read,
 	.dwc_write = dw_hdmi_dwc_write,
-	.cntl0_init = 0x0,
-	.cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
+	.phy_soc = MESON_HDMI_PHY_GXBB,
 };
 
 static const struct meson_dw_hdmi_data meson_dw_hdmi_gxl_data = {
@@ -581,8 +496,7 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_gxl_data = {
 	.top_write = dw_hdmi_top_write,
 	.dwc_read = dw_hdmi_dwc_read,
 	.dwc_write = dw_hdmi_dwc_write,
-	.cntl0_init = 0x0,
-	.cntl1_init = PHY_CNTL1_INIT,
+	.phy_soc = MESON_HDMI_PHY_GXL,
 };
 
 static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = {
@@ -590,13 +504,13 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = {
 	.top_write = dw_hdmi_g12a_top_write,
 	.dwc_read = dw_hdmi_g12a_dwc_read,
 	.dwc_write = dw_hdmi_g12a_dwc_write,
-	.cntl0_init = 0x000b4242, /* Bandgap */
-	.cntl1_init = PHY_CNTL1_INIT,
+	.phy_soc = MESON_HDMI_PHY_G12A,
 };
 
-static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
+static int meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 {
 	struct meson_drm *priv = meson_dw_hdmi->priv;
+	int ret;
 
 	/* Reset HDMITX APB & TX & PHY */
 	reset_control_reset(meson_dw_hdmi->hdmitx_apb);
@@ -624,8 +538,9 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_BIST_CNTL, BIT(12));
 
 	/* Setup PHY */
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, meson_dw_hdmi->data->cntl1_init);
-	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, meson_dw_hdmi->data->cntl0_init);
+	ret = phy_init(meson_dw_hdmi->phy);
+	if (ret)
+		return ret;
 
 	/* Enable HDMI-TX Interrupt */
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_INTR_STAT_CLR,
@@ -634,6 +549,7 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_INTR_MASKN,
 				       HDMITX_TOP_INTR_CORE);
 
+	return 0;
 }
 
 static void meson_disable_clk(void *data)
@@ -664,10 +580,11 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	const struct meson_dw_hdmi_data *match;
+	struct dw_hdmi_plat_data *dw_plat_data;
 	struct meson_dw_hdmi *meson_dw_hdmi;
+	struct device_link *link;
 	struct drm_device *drm = data;
 	struct meson_drm *priv = drm->dev_private;
-	struct dw_hdmi_plat_data *dw_plat_data;
 	int irq;
 	int ret;
 
@@ -746,7 +663,26 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
-	meson_dw_hdmi_init(meson_dw_hdmi);
+	meson_dw_hdmi->phy = devm_phy_optional_get(dev, NULL);
+	if (IS_ERR(meson_dw_hdmi->phy))
+		return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
+				     "failed to get HDMI PHY\n");
+
+	if (!meson_dw_hdmi->phy) {
+		/* DEPRECATED: DT without "phys" */
+		dev_warn(dev, "missing \"phys\", using legacy HDMI PHY\n");
+		meson_dw_hdmi->phy = meson_hdmi_phy_create_legacy(dev, priv->hhi,
+						meson_dw_hdmi->data->phy_soc);
+		if (IS_ERR(meson_dw_hdmi->phy))
+			return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
+					     "failed to create legacy HDMI PHY\n");
+
+		meson_dw_hdmi->legacy_phy = true;
+	}
+
+	ret = meson_dw_hdmi_init(meson_dw_hdmi);
+	if (ret)
+		return ret;
 
 	/* Bridge / Connector */
 
@@ -767,14 +703,25 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 	platform_set_drvdata(pdev, meson_dw_hdmi);
 
 	meson_dw_hdmi->hdmi = dw_hdmi_probe(pdev, &meson_dw_hdmi->dw_plat_data);
-	if (IS_ERR(meson_dw_hdmi->hdmi))
-		return PTR_ERR(meson_dw_hdmi->hdmi);
+	if (IS_ERR(meson_dw_hdmi->hdmi)) {
+		ret = PTR_ERR(meson_dw_hdmi->hdmi);
+		goto err_hdmi_probe;
+	}
 
 	meson_dw_hdmi->bridge = of_drm_find_and_get_bridge(pdev->dev.of_node);
 
+	link = device_link_add(dev, master, DL_FLAG_STATELESS);
+	if (!link)
+		dev_warn(dev, "failed to link DRM master (supplier) to HDMI (consumer)\n");
+
 	DRM_DEBUG_DRIVER("HDMI controller initialized\n");
 
 	return 0;
+
+err_hdmi_probe:
+	phy_exit(meson_dw_hdmi->phy);
+
+	return ret;
 }
 
 static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
@@ -784,8 +731,14 @@ static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
 	struct platform_device *pdev = to_platform_device(dev);
 	int irq = platform_get_irq(pdev, 0);
 
+	device_link_remove(dev, master);	/* (consumer, supplier) */
+
 	devm_free_irq(dev, irq, meson_dw_hdmi);
 	dw_hdmi_unbind(meson_dw_hdmi->hdmi);
+
+	phy_exit(meson_dw_hdmi->phy);
+	if (meson_dw_hdmi->legacy_phy)
+		devm_phy_destroy(dev, meson_dw_hdmi->phy);
 	drm_bridge_put(meson_dw_hdmi->bridge);
 }
 
@@ -801,6 +754,8 @@ static int __maybe_unused meson_dw_hdmi_pm_suspend(struct device *dev)
 	if (!meson_dw_hdmi)
 		return 0;
 
+	phy_exit(meson_dw_hdmi->phy);
+
 	/* Reset TOP */
 	meson_dw_hdmi->data->top_write(meson_dw_hdmi,
 				       HDMITX_TOP_SW_RESET, 0);
@@ -811,11 +766,14 @@ static int __maybe_unused meson_dw_hdmi_pm_suspend(struct device *dev)
 static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
 {
 	struct meson_dw_hdmi *meson_dw_hdmi = dev_get_drvdata(dev);
+	int ret;
 
 	if (!meson_dw_hdmi)
 		return 0;
 
-	meson_dw_hdmi_init(meson_dw_hdmi);
+	ret = meson_dw_hdmi_init(meson_dw_hdmi);
+	if (ret)
+		return ret;
 
 	dw_hdmi_resume(meson_dw_hdmi->hdmi);
 

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 10/12] arm64: dts: amlogic: Add HDMI TX PHY node for G12
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (8 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 09/12] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 11/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as a child of the HHI system controller, with
the amlogic,meson-g12a-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 3135566df880..7f9eda4298e9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -210,6 +210,7 @@ hdmi_tx: hdmi-tx@0 {
 					 <&clkc CLKID_HTX_PCLK>,
 					 <&clkc CLKID_VPU_INTR>;
 				clock-names = "isfr", "iahb", "venci";
+				phys = <&hdmi_tx_phy>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				#sound-dai-cells = <0>;
@@ -1683,6 +1684,11 @@ mipi_analog_dphy: phy {
 						#phy-cells = <0>;
 						status = "disabled";
 					};
+
+					hdmi_tx_phy: hdmi-phy {
+						compatible = "amlogic,meson-g12a-hdmi-tx-phy";
+						#phy-cells = <0>;
+					};
 				};
 			};
 

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 11/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (9 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 10/12] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:27 ` [PATCH v5 12/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
  2026-11-27 15:35 ` [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as a child of the HHI system controller, with
the amlogic,meson-gxbb-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 5c2fe9dc4f80..09ad9790ebc2 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -316,6 +316,7 @@ &hdmi_tx {
 		 <&clkc CLKID_GCLK_VENCI_INT0>;
 	clock-names = "isfr", "iahb", "venci";
 	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+	phys = <&hdmi_tx_phy>;
 
 	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
 			  <&clkc CLKID_HDMI>;
@@ -330,6 +331,11 @@ clkc: clock-controller {
 		clocks = <&xtal>;
 		clock-names = "xtal";
 	};
+
+	hdmi_tx_phy: hdmi-phy {
+		compatible = "amlogic,meson-gxbb-hdmi-tx-phy";
+		#phy-cells = <0>;
+	};
 };
 
 &hwrng {

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v5 12/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXL
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (10 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 11/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
@ 2026-11-27 15:27 ` Ronald Claveau via B4 Relay
  2026-11-27 15:35 ` [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
  12 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-11-27 15:27 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, Ronald Claveau, linux-pm

From: Ronald Claveau <linux-kernel-dev@aliel.fr>

Describe the HDMI TX PHY as a child of the HHI system controller, with
the amlogic,meson-gxl-hdmi-tx-phy compatible and reference
it from the HDMI TX node through "phys".

Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index f257fe3860f7..d205eec1cff7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -328,6 +328,7 @@ &hdmi_tx {
 		 <&clkc CLKID_GCLK_VENCI_INT0>;
 	clock-names = "isfr", "iahb", "venci";
 	power-domains = <&pwrc PWRC_GXBB_VPU_ID>;
+	phys = <&hdmi_tx_phy>;
 
 	assigned-clocks = <&clkc CLKID_HDMI_SEL>,
 			  <&clkc CLKID_HDMI>;
@@ -342,6 +343,11 @@ clkc: clock-controller {
 		clocks = <&xtal>;
 		clock-names = "xtal";
 	};
+
+	hdmi_tx_phy: hdmi-phy {
+		compatible = "amlogic,meson-gxl-hdmi-tx-phy";
+		#phy-cells = <0>;
+	};
 };
 
 &hwrng {

-- 
2.56.1



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
  2026-11-27 15:27 ` [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
@ 2026-11-27 15:33   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2026-11-27 15:33 UTC (permalink / raw)
  To: linux-kernel-dev, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, linux-pm

On 11/27/26 16:27, Ronald Claveau via B4 Relay wrote:
> From: Ronald Claveau <linux-kernel-dev@aliel.fr>
> 
> The HDMI TX PHY driver is currently named after the Meson8 family
> (Meson8, Meson8b and Meson8m2), but the same IP block is found, with
> SoC-specific register programming, on the newer GXBB, GXL, GXM and
> G12A SoCs.
> 
> In preparation for adding support for these SoCs, make the driver
> generic:
> 
>   - rename phy-meson8-hdmi-tx.c to phy-meson-hdmi-tx.c
>   - rename the Kconfig symbol PHY_MESON8_HDMI_TX to PHY_MESON_HDMI_TX
>     and update the Makefile accordingly
>   - drop the "(ARCH_MESON && ARM)" dependency in favour of
>     "ARCH_MESON", since the driver is no longer ARM32-only, and
>     select GENERIC_PHY
>   - rename the phy_meson8_hdmi_tx_* symbols to meson_hdmi_phy_*
>   - update the platform driver name, the Kconfig help text and the
>     module description
>   - drop the unused <linux/property.h> include
> 
> No functional change intended: the only supported compatible remains
> "amlogic,meson8-hdmi-tx-phy".
> 
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
> ---
>   drivers/phy/amlogic/Kconfig                        |  9 ++--
>   drivers/phy/amlogic/Makefile                       |  2 +-
>   .../{phy-meson8-hdmi-tx.c => phy-meson-hdmi-tx.c}  | 54 +++++++++++-----------
>   3 files changed, 33 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
> index ce7ba3eb2a8e..294996869e83 100644
> --- a/drivers/phy/amlogic/Kconfig
> +++ b/drivers/phy/amlogic/Kconfig
> @@ -2,14 +2,15 @@
>   #
>   # Phy drivers for Amlogic platforms
>   #
> -config PHY_MESON8_HDMI_TX
> -	tristate "Meson8, Meson8b and Meson8m2 HDMI TX PHY driver"
> -	depends on (ARCH_MESON && ARM) || COMPILE_TEST
> +config PHY_MESON_HDMI_TX
> +	tristate "Meson HDMI TX PHY driver"
> +	depends on ARCH_MESON || COMPILE_TEST
>   	depends on OF
> +	select GENERIC_PHY
>   	select MFD_SYSCON
>   	help
>   	  Enable this to support the HDMI TX PHYs found in Meson8,
> -	  Meson8b and Meson8m2 SoCs.
> +	  Meson8b, Meson8m2, GXBB, GXL, GXM and G12A SoCs.
>   	  If unsure, say N.
>   
>   config PHY_MESON8B_USB2
> diff --git a/drivers/phy/amlogic/Makefile b/drivers/phy/amlogic/Makefile
> index 91e3b9790c03..2611ec8a056d 100644
> --- a/drivers/phy/amlogic/Makefile
> +++ b/drivers/phy/amlogic/Makefile
> @@ -1,5 +1,5 @@
>   # SPDX-License-Identifier: GPL-2.0-only
> -obj-$(CONFIG_PHY_MESON8_HDMI_TX)		+= phy-meson8-hdmi-tx.o
> +obj-$(CONFIG_PHY_MESON_HDMI_TX)			+= phy-meson-hdmi-tx.o
>   obj-$(CONFIG_PHY_MESON8B_USB2)			+= phy-meson8b-usb2.o
>   obj-$(CONFIG_PHY_MESON_GXL_USB2)		+= phy-meson-gxl-usb2.o
>   obj-$(CONFIG_PHY_MESON_G12A_USB2)		+= phy-meson-g12a-usb2.o
> diff --git a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> similarity index 68%
> rename from drivers/phy/amlogic/phy-meson8-hdmi-tx.c
> rename to drivers/phy/amlogic/phy-meson-hdmi-tx.c
> index f6b5df74a58f..e4e606ab4eef 100644
> --- a/drivers/phy/amlogic/phy-meson8-hdmi-tx.c
> +++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> @@ -1,6 +1,7 @@
>   // SPDX-License-Identifier: GPL-2.0+
>   /*
> - * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
> + * Amlogic Meson HDMI TX PHY driver
> + * (Meson8/8b/8m2)
>    *
>    * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>    */
> @@ -13,7 +14,6 @@
>   #include <linux/of.h>
>   #include <linux/phy/phy.h>
>   #include <linux/platform_device.h>
> -#include <linux/property.h>
>   #include <linux/regmap.h>
>   
>   /*
> @@ -32,30 +32,30 @@
>   
>   #define HHI_HDMI_PHY_CNTL2				0x3a8
>   
> -struct phy_meson8_hdmi_tx_priv {
> +struct meson_hdmi_phy {
>   	struct regmap		*hhi;
>   	struct clk		*tmds_clk;
>   };
>   
> -static int phy_meson8_hdmi_tx_init(struct phy *phy)
> +static int meson_hdmi_phy_init(struct phy *phy)
>   {
> -	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   
>   	return clk_prepare_enable(priv->tmds_clk);
>   }
>   
> -static int phy_meson8_hdmi_tx_exit(struct phy *phy)
> +static int meson_hdmi_phy_exit(struct phy *phy)
>   {
> -	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   
>   	clk_disable_unprepare(priv->tmds_clk);
>   
>   	return 0;
>   }
>   
> -static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
> +static int meson_hdmi_phy_power_on(struct phy *phy)
>   {
> -	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   	unsigned int i;
>   	u16 hdmi_ctl0;
>   
> @@ -85,9 +85,9 @@ static int phy_meson8_hdmi_tx_power_on(struct phy *phy)
>   	return 0;
>   }
>   
> -static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
> +static int meson_hdmi_phy_power_off(struct phy *phy)
>   {
> -	struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy);
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   
>   	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
>   		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
> @@ -96,18 +96,18 @@ static int phy_meson8_hdmi_tx_power_off(struct phy *phy)
>   	return 0;
>   }
>   
> -static const struct phy_ops phy_meson8_hdmi_tx_ops = {
> -	.init		= phy_meson8_hdmi_tx_init,
> -	.exit		= phy_meson8_hdmi_tx_exit,
> -	.power_on	= phy_meson8_hdmi_tx_power_on,
> -	.power_off	= phy_meson8_hdmi_tx_power_off,
> +static const struct phy_ops meson_hdmi_phy_ops = {
> +	.init		= meson_hdmi_phy_init,
> +	.exit		= meson_hdmi_phy_exit,
> +	.power_on	= meson_hdmi_phy_power_on,
> +	.power_off	= meson_hdmi_phy_power_off,
>   	.owner		= THIS_MODULE,
>   };
>   
> -static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
> +static int meson_hdmi_phy_probe(struct platform_device *pdev)
>   {
>   	struct device_node *np = pdev->dev.of_node;
> -	struct phy_meson8_hdmi_tx_priv *priv;
> +	struct meson_hdmi_phy *priv;
>   	struct phy_provider *phy_provider;
>   	struct resource *res;
>   	struct phy *phy;
> @@ -128,7 +128,7 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
>   	if (IS_ERR(priv->tmds_clk))
>   		return PTR_ERR(priv->tmds_clk);
>   
> -	phy = devm_phy_create(&pdev->dev, np, &phy_meson8_hdmi_tx_ops);
> +	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
>   	if (IS_ERR(phy))
>   		return PTR_ERR(phy);
>   
> @@ -140,21 +140,21 @@ static int phy_meson8_hdmi_tx_probe(struct platform_device *pdev)
>   	return PTR_ERR_OR_ZERO(phy_provider);
>   }
>   
> -static const struct of_device_id phy_meson8_hdmi_tx_of_match[] = {
> +static const struct of_device_id meson_hdmi_phy_of_match[] = {
>   	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
>   	{ /* sentinel */ }
>   };
> -MODULE_DEVICE_TABLE(of, phy_meson8_hdmi_tx_of_match);
> +MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
>   
> -static struct platform_driver phy_meson8_hdmi_tx_driver = {
> -	.probe	= phy_meson8_hdmi_tx_probe,
> +static struct platform_driver meson_hdmi_phy_driver = {
> +	.probe	= meson_hdmi_phy_probe,
>   	.driver	= {
> -		.name		= "phy-meson8-hdmi-tx",
> -		.of_match_table	= phy_meson8_hdmi_tx_of_match,
> +		.name		= "meson-hdmi-tx-phy",
> +		.of_match_table	= meson_hdmi_phy_of_match,
>   	},
>   };
> -module_platform_driver(phy_meson8_hdmi_tx_driver);
> +module_platform_driver(meson_hdmi_phy_driver);
>   
>   MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");
> -MODULE_DESCRIPTION("Meson8, Meson8b and Meson8m2 HDMI TX PHY driver");
> +MODULE_DESCRIPTION("Amlogic Meson HDMI TX PHY driver");
>   MODULE_LICENSE("GPL v2");
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

LGTM

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
  2026-11-27 15:27 ` [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
@ 2026-11-27 15:34   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2026-11-27 15:34 UTC (permalink / raw)
  To: linux-kernel-dev, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, linux-pm

On 11/27/26 16:27, Ronald Claveau via B4 Relay wrote:
> From: Ronald Claveau <linux-kernel-dev@aliel.fr>
> 
> Extend the Meson8 HDMI TX PHY driver  for the HDMI TX PHY found on
> Amlogic GXBB, GXL, GXM and G12A SoCs. The PHY is controlled through
> the HHI_HDMI_PHY_CNTL0..5 registers of the same HHI system controller,
> but differ in the analog settings, in the CNTL1 enable bits
> (FIFO enable and FIFO write enable on GXBB and newer) and in the
> presence of CNTL3 to CNTL5. The PHY node is a child of the HHI syscon,
> so the regmap is still obtained from the parent syscon.
> 
> To support this, move the Meson8 hardcoded values into per-SoC match
> data (register init values, rate table and maximum TMDS character
> rate). The TMDS clock is now only requested on Meson8, the only SoC
> where it is needed.
> 
> The driver now implements the generic PHY HDMI configuration options:
> .validate() accepts only 8 bpc and a TMDS character rate covered by
> the per-SoC table, .configure() programs the analog settings matching
> that rate, and .power_on()/.power_off() handle the reset sequence and
> the return to the initial state. The Meson8 behaviour is preserved,
> except that the analog settings are now programmed from .configure()
> instead of .power_on(), and that the reset sequence uses
> read-modify-write updates of the CNTL1 enable bits.
> 
> The per-SoC register values and rate thresholds for GXBB and newer are
> taken from the existing HDMI TX code in meson_dw_hdmi.c, so that the
> PHY handling can be moved out of the display driver.
> 
> For DTs that do not provide a "phys" property on the HDMI TX node,
> export meson_hdmi_phy_create_legacy() so that the display driver can
> still create the PHY itself. It is marked as deprecated and will be
> removed together with the fallback in meson_dw_hdmi.c.
> 
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
> ---
>   drivers/phy/amlogic/phy-meson-hdmi-tx.c | 341 ++++++++++++++++++++++++++------
>   include/linux/phy/phy-meson-hdmi-tx.h   |  19 ++
>   2 files changed, 305 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-hdmi-tx.c b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> index e4e606ab4eef..158b13e26a55 100644
> --- a/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> +++ b/drivers/phy/amlogic/phy-meson-hdmi-tx.c
> @@ -1,18 +1,27 @@
>   // SPDX-License-Identifier: GPL-2.0+
>   /*
>    * Amlogic Meson HDMI TX PHY driver
> - * (Meson8/8b/8m2)
> + * (Meson8/8b/8m2, GXBB / GXL / GXM / G12A)
>    *
>    * Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> + * Copyright (C) 2026 Ronald Claveau <linux-kernel-dev@aliel.fr>
> + *
> + * GXBB+ support Based on meson_dw_hdmi.c:
> + * Copyright (C) 2016 BayLibre, SAS
> + * Author: Neil Armstrong <narmstrong@baylibre.com>
> + * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
>    */
>   
>   #include <linux/bitfield.h>
>   #include <linux/bits.h>
>   #include <linux/clk.h>
> +#include <linux/delay.h>
>   #include <linux/mfd/syscon.h>
>   #include <linux/module.h>
>   #include <linux/of.h>
>   #include <linux/phy/phy.h>
> +#include <linux/phy/phy-hdmi.h>
> +#include <linux/phy/phy-meson-hdmi-tx.h>
>   #include <linux/platform_device.h>
>   #include <linux/regmap.h>
>   
> @@ -22,26 +31,167 @@
>    * Magic register values in the driver below are taken from the vendor
>    * BSP / kernel.
>    */
> -#define HHI_HDMI_PHY_CNTL0				0x3a0
> -	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL1		GENMASK(31, 16)
> -	#define HHI_HDMI_PHY_CNTL0_HDMI_CTL0		GENMASK(15, 0)
> -
> -#define HHI_HDMI_PHY_CNTL1				0x3a4
> -	#define HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE		BIT(1)
> -	#define HHI_HDMI_PHY_CNTL1_SOFT_RESET		BIT(0)
> +#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 */
> +#define HHI_HDMI_PHY_CNTL1	0x3a4 /* 0xe9 */
> +#define  PHY_CNTL1_INIT		0x03900000
> +#define  PHY_INVERT		BIT(17)
> +#define  PHY_CNTL1_SOFT_RESET	BIT(0)
> +#define  PHY_CNTL1_CLOCK_EN	BIT(1)
> +#define  PHY_CNTL1_FIFO_EN	BIT(2)	/* GXBB and newer */
> +#define  PHY_CNTL1_FIFO_WR_EN	BIT(3)	/* GXBB and newer */
> +
> +#define HHI_HDMI_PHY_CNTL2	0x3a8 /* 0xea */
> +#define HHI_HDMI_PHY_CNTL3	0x3ac /* 0xeb, GXBB and newer */
> +#define HHI_HDMI_PHY_CNTL4	0x3b0 /* 0xec */
> +#define HHI_HDMI_PHY_CNTL5	0x3b4 /* 0xed, G12A */
> +
> +/* The code resets the PHY 3 times in a row */
> +#define PHY_RESET_COUNT		3
> +
> +struct meson_hdmi_phy_rate {
> +	unsigned int min_rate;	/* TMDS character rate, in Hz */
> +	u32 cntl0;
> +	u32 cntl3;		/* only used if has_cntl3 */
> +	u32 cntl5;		/* only used if has_cntl5 */
> +};
>   
> -#define HHI_HDMI_PHY_CNTL2				0x3a8
> +struct meson_hdmi_phy_data {
> +	const struct meson_hdmi_phy_rate *rates;
> +	unsigned int num_rates;
> +	unsigned int max_rate;	/* Hz, TMDS character rate maximum */
> +	bool has_tmds_clk;	/* Meson8 only */
> +	bool has_cntl3;
> +	bool has_cntl5;
> +	u32 cntl0_init;
> +	u32 cntl1_init;
> +	u32 cntl1_en;		/* CNTL1 enable bits (clock, fifo, ...) */
> +};
>   
>   struct meson_hdmi_phy {
> -	struct regmap		*hhi;
> -	struct clk		*tmds_clk;
> +	struct regmap *hhi;
> +	struct clk *tmds_clk;	/* optional, Meson8 only */
> +	const struct meson_hdmi_phy_data *data;
> +};
> +
> +/* Meson8, Meson8b, Meson8m2 */
> +static const struct meson_hdmi_phy_rate meson8_rates[] = {
> +	/* 2.97Gbps */
> +	{ 297000000, 0x08c31e8b },
> +	/* below 2.97Gbps, down to 250Mbps */
> +	{ 25000000,  0x08c34d0b },
> +};
> +
> +/* GXBB */
> +static const struct meson_hdmi_phy_rate gxbb_rates[] = {
> +	/* 5.94Gbps, 3.7125Gbps */
> +	{ 371250000, 0x33353245, 0x2100115b },
> +	/* 2.97Gbps */
> +	{ 297000000, 0x33634283, 0xb000115b },
> +	/* 1.485Gbps, down to 159Mbps */
> +	{ 15900000,  0x33632122, 0x2000115b },
> +};
> +
> +/* GXL / GXM */
> +static const struct meson_hdmi_phy_rate gxl_rates[] = {
> +	/* 5.94Gbps, 3.7125Gbps */
> +	{ 371250000, 0x333d3282, 0x2136315b },
> +	/* 2.97Gbps */
> +	{ 297000000, 0x33303382, 0x2036315b },
> +	/* 1.485Gbps */
> +	{ 148500000, 0x33303362, 0x2016315b },
> +	/* 742.5Mbps, down to 159Mbps */
> +	{ 15900000,  0x33604142, 0x0016315b },
> +};
> +
> +/* G12A */
> +static const struct meson_hdmi_phy_rate g12a_rates[] = {
> +	/* 5.94Gbps, 3.7125Gbps */
> +	{ 371250000, 0x37eb65c4, 0x2ab0ff3b, 0x0000080b },
> +	/* 2.97Gbps */
> +	{ 297000000, 0x33eb6262, 0x2ab0ff3b, 0x00000003 },
> +	/* 1.485Gbps, down to 159Mbps */
> +	{ 15900000,  0x33eb4242, 0x2ab0ff3b, 0x00000003 },
> +};
> +
> +static const struct meson_hdmi_phy_data meson8_data = {
> +	.rates = meson8_rates,
> +	.num_rates = ARRAY_SIZE(meson8_rates),
> +	.max_rate = 297000000, /* HDMI 1.4b limited to 4k@30 */
> +	.has_tmds_clk = true,
> +	.cntl0_init = 0x08418d00,
> +	.cntl1_init = 0x0,
> +	.cntl1_en = PHY_CNTL1_CLOCK_EN,
> +};
> +
> +static const struct meson_hdmi_phy_data gxbb_data = {
> +	.rates = gxbb_rates,
> +	.num_rates = ARRAY_SIZE(gxbb_rates),
> +	.max_rate  = 600000000, /* HDMI 2.0 */
> +	.has_cntl3 = true,
> +	.cntl0_init = 0x0,
> +	.cntl1_init = PHY_CNTL1_INIT | PHY_INVERT,
> +	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
> +		    PHY_CNTL1_FIFO_WR_EN,
> +};
> +
> +static const struct meson_hdmi_phy_data gxl_data = {
> +	.rates = gxl_rates,
> +	.num_rates = ARRAY_SIZE(gxl_rates),
> +	.max_rate  = 600000000, /* HDMI 2.0 */
> +	.has_cntl3 = true,
> +	.cntl0_init = 0x0,
> +	.cntl1_init = PHY_CNTL1_INIT,
> +	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
> +		    PHY_CNTL1_FIFO_WR_EN,
> +};
> +
> +static const struct meson_hdmi_phy_data g12a_data = {
> +	.rates = g12a_rates,
> +	.num_rates = ARRAY_SIZE(g12a_rates),
> +	.max_rate  = 600000000, /* HDMI 2.0 */
> +	.has_cntl3 = true,
> +	.has_cntl5 = true,
> +	.cntl0_init = 0x000b4242, /* Bandgap */
> +	.cntl1_init = PHY_CNTL1_INIT,
> +	.cntl1_en = PHY_CNTL1_CLOCK_EN | PHY_CNTL1_FIFO_EN |
> +		    PHY_CNTL1_FIFO_WR_EN,
>   };
>   
> +static const struct meson_hdmi_phy_rate *
> +meson_hdmi_phy_find_rate(const struct meson_hdmi_phy_data *data, u64 rate)
> +{
> +	unsigned int i;
> +
> +	if (rate > data->max_rate)
> +		return NULL;
> +
> +	for (i = 0; i < data->num_rates; i++)
> +		if (rate >= data->rates[i].min_rate)
> +			return &data->rates[i];
> +
> +	return NULL;
> +}
> +
> +/* Fallback to init mode: CNTL1 first, then CNTL0 (order matters) */
> +static void meson_hdmi_phy_set_init_state(struct meson_hdmi_phy *priv)
> +{
> +	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, priv->data->cntl1_init);
> +	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, priv->data->cntl0_init);
> +}
> +
>   static int meson_hdmi_phy_init(struct phy *phy)
>   {
>   	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
> +	int ret;
>   
> -	return clk_prepare_enable(priv->tmds_clk);
> +	/* No-op if there is no clock (GXBB and newer) */
> +	ret = clk_prepare_enable(priv->tmds_clk);
> +	if (ret)
> +		return ret;
> +
> +	meson_hdmi_phy_set_init_state(priv);
> +
> +	return 0;
>   }
>   
>   static int meson_hdmi_phy_exit(struct phy *phy)
> @@ -53,33 +203,64 @@ static int meson_hdmi_phy_exit(struct phy *phy)
>   	return 0;
>   }
>   
> -static int meson_hdmi_phy_power_on(struct phy *phy)
> +static int meson_hdmi_phy_configure(struct phy *phy,
> +				    union phy_configure_opts *opts)
>   {
>   	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
> -	unsigned int i;
> -	u16 hdmi_ctl0;
> +	const struct meson_hdmi_phy_rate *r;
> +
> +	r = meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate);
> +	if (!r)
> +		return -EINVAL;
> +
> +	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, r->cntl0);
> +	if (priv->data->has_cntl3)
> +		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL3, r->cntl3);
> +	if (priv->data->has_cntl5)
> +		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL5, r->cntl5);
> +
> +	/* Disable clock, (and fifo, fifo_wr where present), release reset */
> +	regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
> +			   priv->data->cntl1_en | PHY_CNTL1_SOFT_RESET, 0);
>   
> -	if (clk_get_rate(priv->tmds_clk) >= 2970UL * 1000 * 1000)
> -		hdmi_ctl0 = 0x1e8b;
> -	else
> -		hdmi_ctl0 = 0x4d0b;
> +	return 0;
> +}
> +
> +static int meson_hdmi_phy_validate(struct phy *phy, enum phy_mode mode,
> +				   int submode, union phy_configure_opts *opts)
> +{
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   
> -	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
> -		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x08c3) |
> -		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, hdmi_ctl0));
> +	if (mode != PHY_MODE_HDMI || submode != PHY_HDMI_MODE_TMDS)
> +		return -EINVAL;
>   
> -	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, 0x0);
> +	if (opts->hdmi.bpc != 8)
> +		return -EINVAL;
>   
> -	/* Reset three times, just like the vendor driver does */
> -	for (i = 0; i < 3; i++) {
> -		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
> -			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE |
> -			     HHI_HDMI_PHY_CNTL1_SOFT_RESET);
> -		usleep_range(1000, 2000);
> +	if (!meson_hdmi_phy_find_rate(priv->data, opts->hdmi.tmds_char_rate))
> +		return -EINVAL;
> +
> +	return 0;
> +}
>   
> -		regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1,
> -			     HHI_HDMI_PHY_CNTL1_CLOCK_ENABLE);
> -		usleep_range(1000, 2000);
> +static int meson_hdmi_phy_power_on(struct phy *phy)
> +{
> +	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
> +	u32 en = priv->data->cntl1_en;
> +	u32 mask = en | PHY_CNTL1_SOFT_RESET;
> +	int i;
> +
> +	/* Reset PHY 3 times in a row */
> +	for (i = 0; i < PHY_RESET_COUNT; i++) {
> +		/* Enable and software reset */
> +		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
> +				   mask, mask);
> +		fsleep(2000);
> +
> +		/* Enable and unreset */
> +		regmap_update_bits(priv->hhi, HHI_HDMI_PHY_CNTL1,
> +				   mask, en);
> +		fsleep(2000);
>   	}
>   
>   	return 0;
> @@ -89,9 +270,7 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
>   {
>   	struct meson_hdmi_phy *priv = phy_get_drvdata(phy);
>   
> -	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0,
> -		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL1, 0x0841) |
> -		     FIELD_PREP(HHI_HDMI_PHY_CNTL0_HDMI_CTL0, 0x8d00));
> +	meson_hdmi_phy_set_init_state(priv);
>   
>   	return 0;
>   }
> @@ -99,41 +278,90 @@ static int meson_hdmi_phy_power_off(struct phy *phy)
>   static const struct phy_ops meson_hdmi_phy_ops = {
>   	.init		= meson_hdmi_phy_init,
>   	.exit		= meson_hdmi_phy_exit,
> +	.configure	= meson_hdmi_phy_configure,
> +	.validate	= meson_hdmi_phy_validate,
>   	.power_on	= meson_hdmi_phy_power_on,
>   	.power_off	= meson_hdmi_phy_power_off,
>   	.owner		= THIS_MODULE,
>   };
>   
> -static int meson_hdmi_phy_probe(struct platform_device *pdev)
> +static struct phy *meson_hdmi_phy_alloc(struct device *dev,
> +					struct regmap *hhi,
> +					struct clk *tmds_clk,
> +					const struct meson_hdmi_phy_data *data)
>   {
> -	struct device_node *np = pdev->dev.of_node;
>   	struct meson_hdmi_phy *priv;
> -	struct phy_provider *phy_provider;
> -	struct resource *res;
>   	struct phy *phy;
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res)
> -		return -EINVAL;
> -
> -	priv = devm_kzalloc_obj(&pdev->dev, *priv);
> +	priv = devm_kzalloc_obj(dev, *priv);
>   	if (!priv)
> -		return -ENOMEM;
> +		return ERR_PTR(-ENOMEM);
>   
> -	priv->hhi = syscon_node_to_regmap(np->parent);
> -	if (IS_ERR(priv->hhi))
> -		return PTR_ERR(priv->hhi);
> +	priv->hhi = hhi;
> +	priv->tmds_clk = tmds_clk;
> +	priv->data = data;
>   
> -	priv->tmds_clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(priv->tmds_clk))
> -		return PTR_ERR(priv->tmds_clk);
> -
> -	phy = devm_phy_create(&pdev->dev, np, &meson_hdmi_phy_ops);
> +	phy = devm_phy_create(dev, NULL, &meson_hdmi_phy_ops);
>   	if (IS_ERR(phy))
> -		return PTR_ERR(phy);
> +		return phy;
>   
>   	phy_set_drvdata(phy, priv);
>   
> +	return phy;
> +}
> +
> +/*
> + * DEPRECATED: only for DTs without a "phys" property on the HDMI TX node.
> + * Remove together with the fallback in meson_dw_hdmi.c.
> + */
> +struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
> +					 struct regmap *hhi,
> +					 enum meson_hdmi_phy_soc soc)
> +{
> +	static const struct meson_hdmi_phy_data *const soc_data[] = {
> +		[MESON_HDMI_PHY_GXBB] = &gxbb_data,
> +		[MESON_HDMI_PHY_GXL]  = &gxl_data,
> +		[MESON_HDMI_PHY_G12A] = &g12a_data,
> +	};
> +
> +	if (soc >= ARRAY_SIZE(soc_data))
> +		return ERR_PTR(-EINVAL);
> +
> +	return meson_hdmi_phy_alloc(dev, hhi, NULL, soc_data[soc]);
> +}
> +EXPORT_SYMBOL_GPL(meson_hdmi_phy_create_legacy);
> +
> +static int meson_hdmi_phy_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	const struct meson_hdmi_phy_data *data;
> +	struct phy_provider *phy_provider;
> +	struct clk *tmds_clk = NULL;
> +	struct regmap *hhi;
> +	struct phy *phy;
> +
> +	data = of_device_get_match_data(dev);
> +	if (!data)
> +		return -EINVAL;
> +
> +	/* The PHY node is a child of the HHI syscon */
> +	hhi = syscon_node_to_regmap(dev->of_node->parent);
> +	if (IS_ERR(hhi))
> +		return dev_err_probe(dev, PTR_ERR(hhi),
> +				     "failed to get HHI regmap\n");
> +
> +	if (data->has_tmds_clk) {
> +		tmds_clk = devm_clk_get(dev, NULL);
> +		if (IS_ERR(tmds_clk))
> +			return dev_err_probe(dev, PTR_ERR(tmds_clk),
> +					     "failed to get TMDS clock\n");
> +	}
> +
> +	phy = meson_hdmi_phy_alloc(dev, hhi, tmds_clk, data);
> +	if (IS_ERR(phy))
> +		return dev_err_probe(dev, PTR_ERR(phy),
> +				     "failed to create PHY\n");
> +
>   	phy_provider = devm_of_phy_provider_register(&pdev->dev,
>   						     of_phy_simple_xlate);
>   
> @@ -141,7 +369,10 @@ static int meson_hdmi_phy_probe(struct platform_device *pdev)
>   }
>   
>   static const struct of_device_id meson_hdmi_phy_of_match[] = {
> -	{ .compatible = "amlogic,meson8-hdmi-tx-phy" },
> +	{ .compatible = "amlogic,meson8-hdmi-tx-phy",     .data = &meson8_data },
> +	{ .compatible = "amlogic,meson-gxbb-hdmi-tx-phy", .data = &gxbb_data },
> +	{ .compatible = "amlogic,meson-gxl-hdmi-tx-phy",  .data = &gxl_data },
> +	{ .compatible = "amlogic,meson-g12a-hdmi-tx-phy", .data = &g12a_data },
>   	{ /* sentinel */ }
>   };
>   MODULE_DEVICE_TABLE(of, meson_hdmi_phy_of_match);
> diff --git a/include/linux/phy/phy-meson-hdmi-tx.h b/include/linux/phy/phy-meson-hdmi-tx.h
> new file mode 100644
> index 000000000000..fe76a5f7efdb
> --- /dev/null
> +++ b/include/linux/phy/phy-meson-hdmi-tx.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +#ifndef __PHY_MESON_HDMI_TX_H
> +#define __PHY_MESON_HDMI_TX_H
> +
> +struct device;
> +struct regmap;
> +
> +enum meson_hdmi_phy_soc {
> +	MESON_HDMI_PHY_GXBB,
> +	MESON_HDMI_PHY_GXL,	/* GXL and GXM */
> +	MESON_HDMI_PHY_G12A,
> +};
> +
> +/* DEPRECATED: compat for DTs without "phys" on the HDMI TX node */
> +struct phy *meson_hdmi_phy_create_legacy(struct device *dev,
> +					 struct regmap *hhi,
> +					 enum meson_hdmi_phy_soc soc);
> +
> +#endif /* __PHY_MESON_HDMI_TX_H */
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

LGTM

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
  2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
                   ` (11 preceding siblings ...)
  2026-11-27 15:27 ` [PATCH v5 12/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
@ 2026-11-27 15:35 ` Neil Armstrong
  2026-11-27 15:53   ` Ronald Claveau
  12 siblings, 1 reply; 18+ messages in thread
From: Neil Armstrong @ 2026-11-27 15:35 UTC (permalink / raw)
  To: linux-kernel-dev, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Vinod Koul,
	Manivannan Sadhasivam, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Ulf Hansson
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, linux-pm

On 11/27/26 16:27, Ronald Claveau via B4 Relay wrote:
> This series moves the Amlogic Meson HDMI TX PHY handling (covering GXBB,
> GXL, GXM, and G12A SoCs) out of the meson_dw_hdmi DRM driver and into a
> dedicated generic PHY driver.
> 
> Until now, meson_dw_hdmi directly manipulated the HHI system controller
> registers (HHI_HDMI_PHY_CNTL0..5) to configure analog parameters, toggle
> resets, and manage power states, as well as manually ungating HDMI
> clocks and power domains already described in the DT.
> 
> By extracting this logic into a standalone PHY driver under
> drivers/phy/amlogic/:
> - Hardware representation in the DT is cleaner, modeling the HDMI TX PHY
>    as a child node of the HHI syscon referenced via standard "phys"
>    properties.
> - The DRM bridge driver relies on the standard generic PHY API
>    (phy_init, phy_configure, phy_power_on/off, phy_exit) rather than
>    touching syscon registers directly.
> - Legacy DTs lacking the "phys" property remain supported via a
>    temporary fallback helper (meson_hdmi_phy_create_legacy) to preserve
>    backward compatibility to be removed on next phase of component
>    removal.
> 
> Overview of the series:
> - Patches 1-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
>    add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
>    "hdmi-phy" child node under the HHI syscon.
> - Patch 4: Rename the Meson8 HDMI TX PHY driver to be more SoC generic.
> - Patch 5: Add GXBB, GXL, GXM and G12A SoCs to the Meson HDMI TX PHY
>    driver, implementing the HDMI PHY configuration ops, along with the
>    temporary legacy creation helper.
> - Patch 6: Document the optional "phys" and properties in the
>    amlogic,meson-dw-hdmi binding.
> - Patch 7: Make meson-ee-pwrc power up the domain memories when the
>    domain is already on at probe time, as this is a prerequisite for
>    dropping the explicit write from meson_dw_hdmi
> - Patches 8-9: Clean up manual HHI clock/power-domain writes in
>    meson_dw_hdmi (relying on runtime PM instead) and convert the driver
>    to use the generic PHY framework.
> - Patches 10-12: Add the "hdmi-phy" child node and wire up the "phys"
>    phandle for G12, GXBB, and GXL Device Trees.
> 
> Tested on:
> - Khadas VIM1 (GXL)
> - dtbs_check and dt_binding_check run cleanly with no new warnings.
> 
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
> ---
> Changes in v5:
> - Add Patch 4: Rename Meson8 HDMI TX driver to prepare other SoCs
>                 integration. Martin's review.
> - Patch 5: Adapt the GXBB, GXL, GXM and G12A SoCs code to Patch 4.
> - Link to v4: https://patch.msgid.link/20261123-meson-drm-create-hdmitx-phy-v4-0-3fb94f5534ca@aliel.fr
> 
> Changes in v4:
> - Patch 2: Change commit title. Sashiko and Neil review.
> - Patch 4: Change the phy min_rate to 15.9 MHz mathematical limit.
>             Thanks to Sashiko's review.
> - Patch 8: Drop introduced double free with phy_destroy.
>             Add missing device_link_remove()
>             Change the device_link order and use prepare/complete in the
>             VPU drv for drm_mode_config_helper. Sashiko's review.
> - Link to v3: https://patch.msgid.link/20261121-meson-drm-create-hdmitx-phy-v3-0-f8f471788076@aliel.fr
> 
> Changes in v3:
> - Patch 6: reuse meson_ee_pwrc_mem_power_up() in meson_ee_pwrc_on()
>    function.
> - Patch 8: revert the code to v1 and add a device link to solve
>    suspend/resume order in dpm_list.
> - Link to v2: https://patch.msgid.link/20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr
> 
> Changes in v2:
> - Patches 5,9-11: Remove unecessary "phy-names" for uniq phy.
>                    Thanks to Neil's feedback.
> - Add Patch 6: Power up the memories when the domain is already on.
>                 From Sashiko's feedback.
> - Patch 4: Add a 600MHz max_rate and a 25Mhz min_rate check and
>             exclude PHY_HDMI_MODE_FRL for phy_validate. Thx Sashiko.
> - Patch 8: Move phy_init in dw_hdmi_phy_init and phy_exit
>             in dw_hdmi_phy_disable. From Sashiko review.
> - Link to v1: https://patch.msgid.link/20261117-meson-drm-create-hdmitx-phy-v1-0-9e0ac931381c@aliel.fr
> 
> To: Rob Herring <robh@kernel.org>
> To: Krzysztof Kozlowski <krzk+dt@kernel.org>
> To: Conor Dooley <conor+dt@kernel.org>
> To: Neil Armstrong <neil.armstrong@linaro.org>
> To: Kevin Hilman <khilman@baylibre.com>
> To: Jerome Brunet <jbrunet@baylibre.com>
> To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> To: Vinod Koul <vkoul@kernel.org>
> To: Manivannan Sadhasivam <mani@kernel.org>
> To: Ronald Claveau <linux-kernel-dev@aliel.fr>
> To: David Airlie <airlied@gmail.com>
> To: Simona Vetter <simona@ffwll.ch>
> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> To: Maxime Ripard <mripard@kernel.org>
> To: Thomas Zimmermann <tzimmermann@suse.de>
> To: Ulf Hansson <ulfh@kernel.org>
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-amlogic@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-phy@lists.infradead.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-pm@vger.kernel.org
> 
> ---
> Ronald Claveau (12):
>        dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
>        dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY
>        dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node
>        phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
>        phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
>        dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
>        pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains
>        drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
>        drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
>        arm64: dts: amlogic: Add HDMI TX PHY node for G12
>        arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
>        arm64: dts: amlogic: Add HDMI TX PHY node for GXL
> 
>   .../bindings/display/amlogic,meson-dw-hdmi.yaml    |   4 +
>   .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml    |  33 ++
>   .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  |  43 ++-
>   arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi  |   6 +
>   arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   6 +
>   arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |   6 +
>   drivers/gpu/drm/meson/Kconfig                      |   2 +
>   drivers/gpu/drm/meson/meson_drv.c                  |  16 +-
>   drivers/gpu/drm/meson/meson_dw_hdmi.c              | 223 +++++-------
>   drivers/phy/amlogic/Kconfig                        |   9 +-
>   drivers/phy/amlogic/Makefile                       |   2 +-
>   drivers/phy/amlogic/phy-meson-hdmi-tx.c            | 391 +++++++++++++++++++++
>   drivers/phy/amlogic/phy-meson8-hdmi-tx.c           | 160 ---------
>   drivers/pmdomain/amlogic/meson-ee-pwrc.c           |  19 +-
>   include/linux/phy/phy-meson-hdmi-tx.h              |  19 +
>   15 files changed, 627 insertions(+), 312 deletions(-)
> ---
> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
> 
> Best regards,
> --
> Ronald Claveau <linux-kernel-dev@aliel.fr>

We need to get the bindings reviewed first, then PHY drivers can be merged.

Afterwards I'll merge the DRM patch on the next cycle, then finally the DT.

Neil


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
  2026-11-27 15:27 ` [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
@ 2026-11-27 15:37   ` sashiko-bot
  0 siblings, 0 replies; 18+ messages in thread
From: sashiko-bot @ 2026-11-27 15:37 UTC (permalink / raw)
  To: Ronald Claveau
  Cc: devicetree, linux-amlogic, linux-phy, dri-devel, robh, conor+dt,
	neil.armstrong, vkoul, olteanv

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: soc: amlogic: missing Fixes trailers for
  conditional matching fix
--

commit 3a6f82497ac8b3eb518b14c0bffeec3b4447c0f9
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

> dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals
>
> The conditional schemas select on "compatible" with a bare enum. On a
> list such as:
>
>   compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
>
> an enum applied to the whole array only matches single-entry lists, so
> the if: blocks never match as intended and the per-variant constraints
> are not applied reliably.
>
> Wrap the enums in "contains" so that the conditions match on any entry
> of the compatible list.
>
> Doing so exposes the "phy" child node of "amlogic,meson-gx-hhi-sysctrl":
> it was forbidden (phy: false), but some DT legitimately describe an
> "amlogic,g12a-mipi-dphy-analog" PHY node under this system controller,
> which resulted in dtbs_check warnings such as:
>
>   system-controller@0 (amlogic,meson-gx-hhi-sysctrl): False schema does
>   not allow {'compatible': ['amlogic,g12a-mipi-dphy-analog'],
>   '#phy-cells': 0, ...}
>
> Allow the phy child node for amlogic,meson-gx-hhi-sysctrl by referencing
> the amlogic,g12a-mipi-dphy-analog binding instead of rejecting it.
>
> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>

[Severity: Low]
Since this fixes the bare compatible enum conditionals and the
phy: false constraint, should it include:

  Fixes: 4d023beb3998 ("dt-bindings: soc: amlogic: document System Control registers")
  Fixes: 960a4140ade8 ("dt-bindings: soc: amlogic,meson-gx-hhi-sysctrl: Document the System Control registers found on early Meson SoC")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-meson-drm-create-hdmitx-phy-v5-0-88c43eb95468@aliel.fr?part=1

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver
  2026-11-27 15:35 ` [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
@ 2026-11-27 15:53   ` Ronald Claveau
  0 siblings, 0 replies; 18+ messages in thread
From: Ronald Claveau @ 2026-11-27 15:53 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-phy, dri-devel, linux-pm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Vinod Koul, Manivannan Sadhasivam, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Ulf Hansson

On 11/27/26 16:35, Neil Armstrong wrote:
> On 11/27/26 16:27, Ronald Claveau via B4 Relay wrote:
>> This series moves the Amlogic Meson HDMI TX PHY handling (covering GXBB,
>> GXL, GXM, and G12A SoCs) out of the meson_dw_hdmi DRM driver and into a
>> dedicated generic PHY driver.
>>
>> Until now, meson_dw_hdmi directly manipulated the HHI system controller
>> registers (HHI_HDMI_PHY_CNTL0..5) to configure analog parameters, toggle
>> resets, and manage power states, as well as manually ungating HDMI
>> clocks and power domains already described in the DT.
>>
>> By extracting this logic into a standalone PHY driver under
>> drivers/phy/amlogic/:
>> - Hardware representation in the DT is cleaner, modeling the HDMI TX PHY
>>    as a child node of the HHI syscon referenced via standard "phys"
>>    properties.
>> - The DRM bridge driver relies on the standard generic PHY API
>>    (phy_init, phy_configure, phy_power_on/off, phy_exit) rather than
>>    touching syscon registers directly.
>> - Legacy DTs lacking the "phys" property remain supported via a
>>    temporary fallback helper (meson_hdmi_phy_create_legacy) to preserve
>>    backward compatibility to be removed on next phase of component
>>    removal.
>>
>> Overview of the series:
>> - Patches 1-3: Fix compatible matching in meson-gx-hhi-sysctrl bindings,
>>    add the new amlogic,meson-hdmi-tx-phy DT schema, and allow the
>>    "hdmi-phy" child node under the HHI syscon.
>> - Patch 4: Rename the Meson8 HDMI TX PHY driver to be more SoC generic.
>> - Patch 5: Add GXBB, GXL, GXM and G12A SoCs to the Meson HDMI TX PHY
>>    driver, implementing the HDMI PHY configuration ops, along with the
>>    temporary legacy creation helper.
>> - Patch 6: Document the optional "phys" and properties in the
>>    amlogic,meson-dw-hdmi binding.
>> - Patch 7: Make meson-ee-pwrc power up the domain memories when the
>>    domain is already on at probe time, as this is a prerequisite for
>>    dropping the explicit write from meson_dw_hdmi
>> - Patches 8-9: Clean up manual HHI clock/power-domain writes in
>>    meson_dw_hdmi (relying on runtime PM instead) and convert the driver
>>    to use the generic PHY framework.
>> - Patches 10-12: Add the "hdmi-phy" child node and wire up the "phys"
>>    phandle for G12, GXBB, and GXL Device Trees.
>>
>> Tested on:
>> - Khadas VIM1 (GXL)
>> - dtbs_check and dt_binding_check run cleanly with no new warnings.
>>
>> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
>> ---
>> Changes in v5:
>> - Add Patch 4: Rename Meson8 HDMI TX driver to prepare other SoCs
>>                 integration. Martin's review.
>> - Patch 5: Adapt the GXBB, GXL, GXM and G12A SoCs code to Patch 4.
>> - Link to v4: https://patch.msgid.link/20261123-meson-drm-create-
>> hdmitx-phy-v4-0-3fb94f5534ca@aliel.fr
>>
>> Changes in v4:
>> - Patch 2: Change commit title. Sashiko and Neil review.
>> - Patch 4: Change the phy min_rate to 15.9 MHz mathematical limit.
>>             Thanks to Sashiko's review.
>> - Patch 8: Drop introduced double free with phy_destroy.
>>             Add missing device_link_remove()
>>             Change the device_link order and use prepare/complete in the
>>             VPU drv for drm_mode_config_helper. Sashiko's review.
>> - Link to v3: https://patch.msgid.link/20261121-meson-drm-create-
>> hdmitx-phy-v3-0-f8f471788076@aliel.fr
>>
>> Changes in v3:
>> - Patch 6: reuse meson_ee_pwrc_mem_power_up() in meson_ee_pwrc_on()
>>    function.
>> - Patch 8: revert the code to v1 and add a device link to solve
>>    suspend/resume order in dpm_list.
>> - Link to v2: https://patch.msgid.link/20261120-meson-drm-create-
>> hdmitx-phy-v2-0-93d622d9bb07@aliel.fr
>>
>> Changes in v2:
>> - Patches 5,9-11: Remove unecessary "phy-names" for uniq phy.
>>                    Thanks to Neil's feedback.
>> - Add Patch 6: Power up the memories when the domain is already on.
>>                 From Sashiko's feedback.
>> - Patch 4: Add a 600MHz max_rate and a 25Mhz min_rate check and
>>             exclude PHY_HDMI_MODE_FRL for phy_validate. Thx Sashiko.
>> - Patch 8: Move phy_init in dw_hdmi_phy_init and phy_exit
>>             in dw_hdmi_phy_disable. From Sashiko review.
>> - Link to v1: https://patch.msgid.link/20261117-meson-drm-create-
>> hdmitx-phy-v1-0-9e0ac931381c@aliel.fr
>>
>> To: Rob Herring <robh@kernel.org>
>> To: Krzysztof Kozlowski <krzk+dt@kernel.org>
>> To: Conor Dooley <conor+dt@kernel.org>
>> To: Neil Armstrong <neil.armstrong@linaro.org>
>> To: Kevin Hilman <khilman@baylibre.com>
>> To: Jerome Brunet <jbrunet@baylibre.com>
>> To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>> To: Vinod Koul <vkoul@kernel.org>
>> To: Manivannan Sadhasivam <mani@kernel.org>
>> To: Ronald Claveau <linux-kernel-dev@aliel.fr>
>> To: David Airlie <airlied@gmail.com>
>> To: Simona Vetter <simona@ffwll.ch>
>> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> To: Maxime Ripard <mripard@kernel.org>
>> To: Thomas Zimmermann <tzimmermann@suse.de>
>> To: Ulf Hansson <ulfh@kernel.org>
>> Cc: devicetree@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-amlogic@lists.infradead.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: linux-phy@lists.infradead.org
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: linux-pm@vger.kernel.org
>>
>> ---
>> Ronald Claveau (12):
>>        dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible
>> matching in conditionals
>>        dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY
>>        dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy
>> child node
>>        phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic
>>        phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support
>>        dt-bindings: display: amlogic,meson-dw-hdmi: Add phys
>>        pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-
>> enabled domains
>>        drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
>>        drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI
>> TX PHY
>>        arm64: dts: amlogic: Add HDMI TX PHY node for G12
>>        arm64: dts: amlogic: Add HDMI TX PHY node for GXBB
>>        arm64: dts: amlogic: Add HDMI TX PHY node for GXL
>>
>>   .../bindings/display/amlogic,meson-dw-hdmi.yaml    |   4 +
>>   .../bindings/phy/amlogic,meson-hdmi-tx-phy.yaml    |  33 ++
>>   .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  |  43 ++-
>>   arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi  |   6 +
>>   arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   6 +
>>   arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |   6 +
>>   drivers/gpu/drm/meson/Kconfig                      |   2 +
>>   drivers/gpu/drm/meson/meson_drv.c                  |  16 +-
>>   drivers/gpu/drm/meson/meson_dw_hdmi.c              | 223 +++++-------
>>   drivers/phy/amlogic/Kconfig                        |   9 +-
>>   drivers/phy/amlogic/Makefile                       |   2 +-
>>   drivers/phy/amlogic/phy-meson-hdmi-tx.c            | 391 +++++++++++
>> ++++++++++
>>   drivers/phy/amlogic/phy-meson8-hdmi-tx.c           | 160 ---------
>>   drivers/pmdomain/amlogic/meson-ee-pwrc.c           |  19 +-
>>   include/linux/phy/phy-meson-hdmi-tx.h              |  19 +
>>   15 files changed, 627 insertions(+), 312 deletions(-)
>> ---
>> base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
>> change-id: 20261115-meson-drm-create-hdmitx-phy-4ac40a654d09
>>
>> Best regards,
>> -- 
>> Ronald Claveau <linux-kernel-dev@aliel.fr>
> 
> We need to get the bindings reviewed first, then PHY drivers can be merged.
> 
> Afterwards I'll merge the DRM patch on the next cycle, then finally the DT.
> 
> Neil

Thanks for laying out the timeline, that works great for me.

-- 
Best regards,
Ronald

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2026-11-27 15:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 15:27 [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 01/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-11-27 15:37   ` sashiko-bot
2026-11-27 15:27 ` [PATCH v5 02/12] dt-bindings: phy: amlogic: document the Amlogic Meson HDMI TX PHY Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 03/12] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 04/12] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
2026-11-27 15:33   ` Neil Armstrong
2026-11-27 15:27 ` [PATCH v5 05/12] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
2026-11-27 15:34   ` Neil Armstrong
2026-11-27 15:27 ` [PATCH v5 06/12] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 07/12] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 08/12] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 09/12] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 10/12] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 11/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-11-27 15:27 ` [PATCH v5 12/12] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-11-27 15:35 ` [PATCH v5 00/12] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Neil Armstrong
2026-11-27 15:53   ` Ronald Claveau

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