Skip to contentSkip to conversation

mediatek: hdmi: add MT8167 configuration

PATCH In review Neil Armstrong 3 participants 12 messages Apr 19, 2021 – May 13, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v3 cover mediatek: hdmi: add MT8167 configuration

The MT8167 SoC have a hard limit on the maximal supported HDMI TMDS clock, and is not validated and supported for HDMI modes out of HDMI CEA modes.

To achieve this:
- switch the mediatek HDMI bindings to YAML
- add the MT8167 compatible
- add a boolean to discard the non-CEA modes
- add a value to specify mac TMDS supported clock
- add a conf entry for the MT8167 compatible

Changes since v4:
- fixed bindings

Neil Armstrong (5):
dt-bindings: display: mediatek,hdmi: Convert to use graph schema
dt-bindings: mediatek: add mt8167 to hdmi, hdmi-ddc and cec bindings gpu/drm: mediatek: hdmi: add check for CEA modes only gpu/drm: mediatek: hdmi: add optional limit on maximal HDMI mode clock gpu/drm: mediatek: hdmi: add MT8167 configuration

 .../display/mediatek/mediatek,cec.yaml        |  52 +++++++
 .../display/mediatek/mediatek,hdmi-ddc.yaml   |  58 ++++++++
 .../display/mediatek/mediatek,hdmi.txt        | 136 ------------------
 .../display/mediatek/mediatek,hdmi.yaml       | 133 +++++++++++++++++
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |  17 +++
 5 files changed, 260 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v3 1/5 dt-bindings: display: mediatek,hdmi: Convert to use graph schema

Update the mediatek,dpi binding to use the graph schema.

---
 .../display/mediatek/mediatek,cec.yaml        |  51 +++++++
 .../display/mediatek/mediatek,hdmi-ddc.yaml   |  57 ++++++++
 .../display/mediatek/mediatek,hdmi.txt        | 136 ------------------
 .../display/mediatek/mediatek,hdmi.yaml       | 132 +++++++++++++++++
 4 files changed, 240 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml
Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml new file +51 -0
new file mode 100644
index 000000000000..b38d8732d7e0
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/mediatek/mediatek,cec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek HDMI CEC Controller Device Tree Bindings
+
+maintainers:
+  - CK Hu <[email protected]>
+  - Jitao shi <[email protected]>
+
+description: |
+  The HDMI CEC controller handles hotplug detection and CEC communication.
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt7623-cec
+      - mediatek,mt8173-cec
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8173-clk.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    cec: cec@10013000 {
+        compatible = "mediatek,mt8173-cec";
+        reg = <0x10013000 0xbc>;
+        interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_LOW>;
+        clocks = <&infracfg CLK_INFRA_CEC>;
+    };
+
+...
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml new file +57 -0

57 lines not on this page · raw message

Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt deleted +0 -136

136 lines not on this page · raw message

Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml new file +132 -0

132 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 1/5
#2 lore raw

Re: [PATCH v3 1/5] dt-bindings: display: mediatek, hdmi: Convert to use graph schema

Quoted 14 lines · Neil Armstrong

Update the mediatek,dpi binding to use the graph schema.

---
 .../display/mediatek/mediatek,cec.yaml        |  51 +++++++
 .../display/mediatek/mediatek,hdmi-ddc.yaml   |  57 ++++++++
 .../display/mediatek/mediatek,hdmi.txt        | 136 ------------------
 .../display/mediatek/mediatek,hdmi.yaml       | 132 +++++++++++++++++
 4 files changed, 240 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

PATCH v3 2/5 dt-bindings: mediatek: add mt8167 to hdmi, hdmi-ddc and cec bindings

In reply to Neil Armstrong

Add mt8167 SoC compatible to Mediatek hdmi, hdmi-ddc and cec schema bindings.

---
 .../devicetree/bindings/display/mediatek/mediatek,cec.yaml       | 1 +
 .../devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml  | 1 +
 .../devicetree/bindings/display/mediatek/mediatek,hdmi.yaml      | 1 +
 3 files changed, 3 insertions(+)
Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml +1 -0
index b38d8732d7e0..66288b9f0aa6 100644
@@ -17,6 +17,7 @@ properties:
   compatible:
     enum:
       - mediatek,mt7623-cec
+      - mediatek,mt8167-cec
       - mediatek,mt8173-cec
 
   reg:
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml +1 -0
index c8ba94d6908b..b6fcdfb99ab2 100644
@@ -17,6 +17,7 @@ properties:
   compatible:
     enum:
       - mediatek,mt7623-hdmi-ddc
+      - mediatek,mt8167-hdmi-ddc
       - mediatek,mt8173-hdmi-ddc
 
   reg:
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml +1 -0
index 6a144faed682..111967efa999 100644
@@ -19,6 +19,7 @@ properties:
     enum:
       - mediatek,mt2701-hdmi
       - mediatek,mt7623-hdmi
+      - mediatek,mt8167-hdmi
       - mediatek,mt8173-hdmi
 
   reg:
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v3 2/5
#4 lore raw

Re: [PATCH v3 2/5] dt-bindings: mediatek: add mt8167 to hdmi, hdmi-ddc and cec bindings

Quoted 9 lines · Neil Armstrong

Add mt8167 SoC compatible to Mediatek hdmi, hdmi-ddc and cec schema bindings.

---
 .../devicetree/bindings/display/mediatek/mediatek,cec.yaml       | 1 +
 .../devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml  | 1 +
 .../devicetree/bindings/display/mediatek/mediatek,hdmi.yaml      | 1 +
 3 files changed, 3 insertions(+)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

PATCH v3 3/5 gpu/drm: mediatek: hdmi: add check for CEA modes only

In reply to Neil Armstrong

Some SoCs like the MT8167 are not validated and supported for HDMI modes out of HDMI CEA modes, so add a configuration boolean to filter out non-CEA modes.

---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +4 -0
index dea46d66e712..0539262e69d3 100644
@@ -148,6 +148,7 @@ struct hdmi_audio_param {
 
 struct mtk_hdmi_conf {
 	bool tz_disabled;
+	bool cea_modes_only;
 };
 
 struct mtk_hdmi {
@@ -1222,6 +1223,9 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
 			return MODE_BAD;
 	}
 
+	if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
+		return MODE_BAD;
+
 	if (mode->clock < 27000)
 		return MODE_CLOCK_LOW;
 	if (mode->clock > 297000)
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 3/5
#6 lore raw

Re: [PATCH v3 3/5] gpu/drm: mediatek: hdmi: add check for CEA modes only

Hi, Neil:

Neil Armstrong <[email protected]> 於 2021年4月19日 週一 下午3:33寫道:

Quoted 4 lines

Some SoCs like the MT8167 are not validated and supported for HDMI modes out of HDMI CEA modes, so add a configuration boolean to filter out non-CEA modes.

Quoted 30 lines
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +4 -1
index dea46d66e712..0539262e69d3 100644
@@ -148,6 +148,7 @@ struct hdmi_audio_param {
 
 struct mtk_hdmi_conf {
        bool tz_disabled;
+       bool cea_modes_only;
 };
 
 struct mtk_hdmi {
@@ -1222,6 +1223,9 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
                        return MODE_BAD;
        }
 
+       if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
+               return MODE_BAD;
+
        if (mode->clock < 27000)
                return MODE_CLOCK_LOW;
        if (mode->clock > 297000)
--
Quoted 2 lines

2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

PATCH v3 4/5 gpu/drm: mediatek: hdmi: add optional limit on maximal HDMI mode clock

In reply to Neil Armstrong

Some SoCs like the MT8167 have a hard limit on the maximal supported HDMI TMDS clock, so add a configuration value to filter out those modes.

---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +5 -0
index 0539262e69d3..bc50d97f2553 100644
@@ -149,6 +149,7 @@ struct hdmi_audio_param {
 struct mtk_hdmi_conf {
 	bool tz_disabled;
 	bool cea_modes_only;
+	unsigned long max_mode_clock;
 };
 
 struct mtk_hdmi {
@@ -1226,6 +1227,10 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
 	if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
 		return MODE_BAD;
 
+	if (hdmi->conf->max_mode_clock &&
+	    mode->clock > hdmi->conf->max_mode_clock)
+		return MODE_CLOCK_HIGH;
+
 	if (mode->clock < 27000)
 		return MODE_CLOCK_LOW;
 	if (mode->clock > 297000)
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 4/5
#8 lore raw

Re: [PATCH v3 4/5] gpu/drm: mediatek: hdmi: add optional limit on maximal HDMI mode clock

Hi, Neil:

Neil Armstrong <[email protected]> 於 2021年4月19日 週一 下午3:33寫道:

Quoted 3 lines

Some SoCs like the MT8167 have a hard limit on the maximal supported HDMI TMDS clock, so add a configuration value to filter out those modes.

Quoted 31 lines
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +5 -1
index 0539262e69d3..bc50d97f2553 100644
@@ -149,6 +149,7 @@ struct hdmi_audio_param {
 struct mtk_hdmi_conf {
        bool tz_disabled;
        bool cea_modes_only;
+       unsigned long max_mode_clock;
 };
 
 struct mtk_hdmi {
@@ -1226,6 +1227,10 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
        if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
                return MODE_BAD;
 
+       if (hdmi->conf->max_mode_clock &&
+           mode->clock > hdmi->conf->max_mode_clock)
+               return MODE_CLOCK_HIGH;
+
        if (mode->clock < 27000)
                return MODE_CLOCK_LOW;
        if (mode->clock > 297000)
--
Quoted 2 lines

2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

PATCH v3 5/5 gpu/drm: mediatek: hdmi: add MT8167 configuration

In reply to Neil Armstrong

The MT8167 SoC have a hard limit on the maximal supported HDMI TMDS clock, and is not validated and supported for HDMI modes out of HDMI CEA modes, so add a configuration entry linked to the MT8167 compatible.

---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +8 -0
index bc50d97f2553..c1651a83700d 100644
@@ -1787,10 +1787,18 @@ static const struct mtk_hdmi_conf mtk_hdmi_conf_mt2701 = {
 	.tz_disabled = true,
 };
 
+static const struct mtk_hdmi_conf mtk_hdmi_conf_mt8167 = {
+	.max_mode_clock = 148500,
+	.cea_modes_only = true,
+};
+
 static const struct of_device_id mtk_drm_hdmi_of_ids[] = {
 	{ .compatible = "mediatek,mt2701-hdmi",
 	  .data = &mtk_hdmi_conf_mt2701,
 	},
+	{ .compatible = "mediatek,mt8167-hdmi",
+	  .data = &mtk_hdmi_conf_mt8167,
+	},
 	{ .compatible = "mediatek,mt8173-hdmi",
 	},
 	{}
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 5/5
#10 lore raw

Re: [PATCH v3 5/5] gpu/drm: mediatek: hdmi: add MT8167 configuration

Hi, Neil:

Neil Armstrong <[email protected]> 於 2021年4月19日 週一 下午3:33寫道:

Quoted 4 lines

The MT8167 SoC have a hard limit on the maximal supported HDMI TMDS clock, and is not validated and supported for HDMI modes out of HDMI CEA modes, so add a configuration entry linked to the MT8167 compatible.

Quoted 31 lines
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +8 -1
index bc50d97f2553..c1651a83700d 100644
@@ -1787,10 +1787,18 @@ static const struct mtk_hdmi_conf mtk_hdmi_conf_mt2701 = {
        .tz_disabled = true,
 };
 
+static const struct mtk_hdmi_conf mtk_hdmi_conf_mt8167 = {
+       .max_mode_clock = 148500,
+       .cea_modes_only = true,
+};
+
 static const struct of_device_id mtk_drm_hdmi_of_ids[] = {
        { .compatible = "mediatek,mt2701-hdmi",
          .data = &mtk_hdmi_conf_mt2701,
        },
+       { .compatible = "mediatek,mt8167-hdmi",
+         .data = &mtk_hdmi_conf_mt8167,
+       },
        { .compatible = "mediatek,mt8173-hdmi",
        },
        {}
--
Quoted 2 lines

2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#11 lore raw
In reply to Neil Armstrong

Hi, Neil:

Neil Armstrong <[email protected]> 於 2021年4月19日 週一 下午3:33寫道:

Quoted 3 lines

The MT8167 SoC have a hard limit on the maximal supported HDMI TMDS clock, and is not validated and supported for HDMI modes out of HDMI CEA modes.

For this series, applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

Quoted 32 lines

To achieve this:
- switch the mediatek HDMI bindings to YAML
- add the MT8167 compatible
- add a boolean to discard the non-CEA modes
- add a value to specify mac TMDS supported clock
- add a conf entry for the MT8167 compatible

Changes since v4:
- fixed bindings

Neil Armstrong (5):
dt-bindings: display: mediatek,hdmi: Convert to use graph schema
dt-bindings: mediatek: add mt8167 to hdmi, hdmi-ddc and cec bindings gpu/drm: mediatek: hdmi: add check for CEA modes only gpu/drm: mediatek: hdmi: add optional limit on maximal HDMI mode clock gpu/drm: mediatek: hdmi: add MT8167 configuration

 .../display/mediatek/mediatek,cec.yaml        |  52 +++++++
 .../display/mediatek/mediatek,hdmi-ddc.yaml   |  58 ++++++++
 .../display/mediatek/mediatek,hdmi.txt        | 136 ------------------
 .../display/mediatek/mediatek,hdmi.yaml       | 133 +++++++++++++++++
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |  17 +++
 5 files changed, 260 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml

--
2.25.1