Re: [PATCH v6 6/8] MIPS: DTS: CI20: Add DT nodes for HDMI setup

2021-11-15 Thread Paul Cercueil

Hi Nikolaus, Thomas,

Le mer., nov. 10 2021 at 20:43:31 +0100, H. Nikolaus Schaller 
 a écrit :

From: Paul Boddie 

We need to hook up
* HDMI connector
* HDMI power regulator
* JZ4780_CLK_HDMI @ 27 MHz
* DDC pinmux
* HDMI and LCDC endpoint connections

Signed-off-by: Paul Boddie 
Signed-off-by: H. Nikolaus Schaller 
---
 arch/mips/boot/dts/ingenic/ci20.dts | 73 
+++--

 1 file changed, 70 insertions(+), 3 deletions(-)

diff --git a/arch/mips/boot/dts/ingenic/ci20.dts 
b/arch/mips/boot/dts/ingenic/ci20.dts

index a688809beebca..a62557bede565 100644
--- a/arch/mips/boot/dts/ingenic/ci20.dts
+++ b/arch/mips/boot/dts/ingenic/ci20.dts
@@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 {
enable-active-high;
};

+   hdmi_out: connector {
+   compatible = "hdmi-connector";
+   label = "HDMI OUT";
+   type = "a";
+
+   port {
+   hdmi_con: endpoint {
+   remote-endpoint = <_hdmi_out>;
+   };
+   };
+   };
+
ir: ir {
compatible = "gpio-ir-receiver";
gpios = < 3 GPIO_ACTIVE_LOW>;
@@ -102,6 +114,17 @@ otg_power: fixedregulator@2 {
gpio = < 14 GPIO_ACTIVE_LOW>;
enable-active-high;
};
+
+   hdmi_power: fixedregulator@3 {
+   compatible = "regulator-fixed";
+
+   regulator-name = "hdmi_power";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+
+   gpio = < 25 GPIO_ACTIVE_LOW>;


Just use 0 instead of GPIO_ACTIVE_LOW, since the flag is simply ignored 
(I know the other regulators do use it, but I'll clean that up soon).



+   enable-active-high;
+   };
 };

  {
@@ -113,9 +136,9 @@  {
 	 * Use the 32.768 kHz oscillator as the parent of the RTC for a 
higher

 * precision.
 */
-   assigned-clocks = < JZ4780_CLK_OTGPHY>, < JZ4780_CLK_RTC>;
-   assigned-clock-parents = <0>, < JZ4780_CLK_RTCLK>;
-   assigned-clock-rates = <4800>;
+	assigned-clocks = < JZ4780_CLK_OTGPHY>, < JZ4780_CLK_RTC>, 
< JZ4780_CLK_HDMI>;

+   assigned-clock-parents = <0>, < JZ4780_CLK_RTCLK>, <0>;
+   assigned-clock-rates = <4800>, <0>, <2700>;


So drm-misc-next is based on a slightly older version (not v5.16-rc1 
yet), and these lines changed in linux master.


I think it would make sense to merge the DT changes (+ doc) into the 
MIPS tree, and the driver changes into drm-misc-next.


@Thomas: Is that OK for you?

Cheers,
-Paul


 };

  {
@@ -506,6 +529,12 @@ pins_i2c4: i2c4 {
bias-disable;
};

+   pins_hdmi_ddc: hdmi_ddc {
+   function = "hdmi-ddc";
+   groups = "hdmi-ddc";
+   bias-disable;
+   };
+
pins_nemc: nemc {
function = "nemc";
groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", 
"nemc-frd-fwe";
@@ -536,3 +565,41 @@ pins_mmc1: mmc1 {
bias-disable;
};
 };
+
+ {
+   status = "okay";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_hdmi_ddc>;
+
+   hdmi-5v-supply = <_power>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   dw_hdmi_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   dw_hdmi_out: endpoint {
+   remote-endpoint = <_con>;
+   };
+   };
+   };
+};
+
+ {
+   status = "okay";
+
+   port {
+   lcd_out: endpoint {
+   remote-endpoint = <_hdmi_in>;
+   };
+   };
+};
--
2.33.0






[PATCH v6 6/8] MIPS: DTS: CI20: Add DT nodes for HDMI setup

2021-11-10 Thread H. Nikolaus Schaller
From: Paul Boddie 

We need to hook up
* HDMI connector
* HDMI power regulator
* JZ4780_CLK_HDMI @ 27 MHz
* DDC pinmux
* HDMI and LCDC endpoint connections

Signed-off-by: Paul Boddie 
Signed-off-by: H. Nikolaus Schaller 
---
 arch/mips/boot/dts/ingenic/ci20.dts | 73 +++--
 1 file changed, 70 insertions(+), 3 deletions(-)

diff --git a/arch/mips/boot/dts/ingenic/ci20.dts 
b/arch/mips/boot/dts/ingenic/ci20.dts
index a688809beebca..a62557bede565 100644
--- a/arch/mips/boot/dts/ingenic/ci20.dts
+++ b/arch/mips/boot/dts/ingenic/ci20.dts
@@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 {
enable-active-high;
};
 
+   hdmi_out: connector {
+   compatible = "hdmi-connector";
+   label = "HDMI OUT";
+   type = "a";
+
+   port {
+   hdmi_con: endpoint {
+   remote-endpoint = <_hdmi_out>;
+   };
+   };
+   };
+
ir: ir {
compatible = "gpio-ir-receiver";
gpios = < 3 GPIO_ACTIVE_LOW>;
@@ -102,6 +114,17 @@ otg_power: fixedregulator@2 {
gpio = < 14 GPIO_ACTIVE_LOW>;
enable-active-high;
};
+
+   hdmi_power: fixedregulator@3 {
+   compatible = "regulator-fixed";
+
+   regulator-name = "hdmi_power";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+
+   gpio = < 25 GPIO_ACTIVE_LOW>;
+   enable-active-high;
+   };
 };
 
  {
@@ -113,9 +136,9 @@  {
 * Use the 32.768 kHz oscillator as the parent of the RTC for a higher
 * precision.
 */
-   assigned-clocks = < JZ4780_CLK_OTGPHY>, < JZ4780_CLK_RTC>;
-   assigned-clock-parents = <0>, < JZ4780_CLK_RTCLK>;
-   assigned-clock-rates = <4800>;
+   assigned-clocks = < JZ4780_CLK_OTGPHY>, < JZ4780_CLK_RTC>, 
< JZ4780_CLK_HDMI>;
+   assigned-clock-parents = <0>, < JZ4780_CLK_RTCLK>, <0>;
+   assigned-clock-rates = <4800>, <0>, <2700>;
 };
 
  {
@@ -506,6 +529,12 @@ pins_i2c4: i2c4 {
bias-disable;
};
 
+   pins_hdmi_ddc: hdmi_ddc {
+   function = "hdmi-ddc";
+   groups = "hdmi-ddc";
+   bias-disable;
+   };
+
pins_nemc: nemc {
function = "nemc";
groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", 
"nemc-frd-fwe";
@@ -536,3 +565,41 @@ pins_mmc1: mmc1 {
bias-disable;
};
 };
+
+ {
+   status = "okay";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_hdmi_ddc>;
+
+   hdmi-5v-supply = <_power>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   dw_hdmi_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   dw_hdmi_out: endpoint {
+   remote-endpoint = <_con>;
+   };
+   };
+   };
+};
+
+ {
+   status = "okay";
+
+   port {
+   lcd_out: endpoint {
+   remote-endpoint = <_hdmi_in>;
+   };
+   };
+};
-- 
2.33.0