diff mbox series

[4/4] arm64: dts: imx8mp-iota2: Enable the USB Type-C port

Message ID 20240917151001.1289399-5-michal.vokac@ysoft.com (mailing list archive)
State Superseded
Headers show
Series Add support for new IMX8MP based board | expand

Commit Message

Michal Vokáč Sept. 17, 2024, 3:10 p.m. UTC
From: Petr Benes <petr.benes@ysoft.com>

Enable the USB Type-C port with the Diodes PI5USB30213A port controller.
The port supports dual role data but can operate only in source power role
and PD is not supported.

Signed-off-by: Petr Benes <petr.benes@ysoft.com>
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
 .../boot/dts/freescale/imx8mp-iota2-lumpy.dts | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)

Comments

Krzysztof Kozlowski Sept. 18, 2024, 1:17 p.m. UTC | #1
On 17/09/2024 17:10, Michal Vokáč wrote:
> From: Petr Benes <petr.benes@ysoft.com>
> 
> Enable the USB Type-C port with the Diodes PI5USB30213A port controller.
> The port supports dual role data but can operate only in source power role
> and PD is not supported.
> 
> Signed-off-by: Petr Benes <petr.benes@ysoft.com>
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---
>  .../boot/dts/freescale/imx8mp-iota2-lumpy.dts | 96 +++++++++++++++++++
>  1 file changed, 96 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
> index 21d0899cabd5..b15d211e8667 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
> @@ -38,6 +38,17 @@ memory@40000000 {
>  		      <0x1 0x00000000 0 0x80000000>;
>  	};
>  
> +	reg_typec: regulator-typec {
> +		compatible = "regulator-fixed";
> +		enable-active-high;
> +		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_usbc_vbus>;
> +		regulator-max-microvolt = <5000000>;
> +		regulator-min-microvolt = <5000000>;
> +		regulator-name = "typec";
> +	};
> +
>  	reg_usb_host: regulator-usb-host {
>  		compatible = "regulator-fixed";
>  		enable-active-high;
> @@ -218,6 +229,47 @@ &i2c2 {
>  	pinctrl-0 = <&pinctrl_i2c2>;
>  	status = "okay";
>  
> +	tcpc@d {

typec@d

> +		compatible = "diodes,pi5usb30213a";
> +		reg = <0xd>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_typec>;
> +		interrupts-extended = <&gpio1 5 IRQ_TYPE_LEVEL_LOW>;
> +		status = "okay";

Drop



Best regards,
Krzysztof
Michal Vokáč Sept. 19, 2024, 12:52 p.m. UTC | #2
On 18. 09. 24 15:17, Krzysztof Kozlowski wrote:
> On 17/09/2024 17:10, Michal Vokáč wrote:
>> From: Petr Benes <petr.benes@ysoft.com>
>>
>> Enable the USB Type-C port with the Diodes PI5USB30213A port controller.
>> The port supports dual role data but can operate only in source power role
>> and PD is not supported.
>>
>> Signed-off-by: Petr Benes <petr.benes@ysoft.com>
>> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
>> ---
>>   .../boot/dts/freescale/imx8mp-iota2-lumpy.dts | 96 +++++++++++++++++++
>>   1 file changed, 96 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
>> index 21d0899cabd5..b15d211e8667 100644
>> --- a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
>> +++ b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
>> @@ -38,6 +38,17 @@ memory@40000000 {
>>   		      <0x1 0x00000000 0 0x80000000>;
>>   	};
>>   
>> +	reg_typec: regulator-typec {
>> +		compatible = "regulator-fixed";
>> +		enable-active-high;
>> +		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&pinctrl_usbc_vbus>;
>> +		regulator-max-microvolt = <5000000>;
>> +		regulator-min-microvolt = <5000000>;
>> +		regulator-name = "typec";
>> +	};
>> +
>>   	reg_usb_host: regulator-usb-host {
>>   		compatible = "regulator-fixed";
>>   		enable-active-high;
>> @@ -218,6 +229,47 @@ &i2c2 {
>>   	pinctrl-0 = <&pinctrl_i2c2>;
>>   	status = "okay";
>>   
>> +	tcpc@d {
> 
> typec@d
> 
>> +		compatible = "diodes,pi5usb30213a";
>> +		reg = <0xd>;
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&pinctrl_typec>;
>> +		interrupts-extended = <&gpio1 5 IRQ_TYPE_LEVEL_LOW>;
>> +		status = "okay";
> 
> Drop

OK. I will address both comments.

Thank you for the review,
Michal
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
index 21d0899cabd5..b15d211e8667 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-iota2-lumpy.dts
@@ -38,6 +38,17 @@  memory@40000000 {
 		      <0x1 0x00000000 0 0x80000000>;
 	};
 
+	reg_typec: regulator-typec {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_usbc_vbus>;
+		regulator-max-microvolt = <5000000>;
+		regulator-min-microvolt = <5000000>;
+		regulator-name = "typec";
+	};
+
 	reg_usb_host: regulator-usb-host {
 		compatible = "regulator-fixed";
 		enable-active-high;
@@ -218,6 +229,47 @@  &i2c2 {
 	pinctrl-0 = <&pinctrl_i2c2>;
 	status = "okay";
 
+	tcpc@d {
+		compatible = "diodes,pi5usb30213a";
+		reg = <0xd>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_typec>;
+		interrupts-extended = <&gpio1 5 IRQ_TYPE_LEVEL_LOW>;
+		status = "okay";
+
+		connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			vbus-supply = <&reg_typec>;
+			power-role = "source";
+			data-role = "dual";
+			typec-power-opmode = "default";
+			self-powered;
+			pd-disable;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					usb_con_hs: endpoint {
+						remote-endpoint = <&typec_hs>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					usb_con_ss: endpoint {
+						remote-endpoint = <&typec_ss>;
+					};
+				};
+			};
+		};
+	};
+
 	rtc: rtc@68 {
 		compatible = "dallas,ds1341";
 		reg = <0x68>;
@@ -237,6 +289,38 @@  &uart2 {
 	status = "okay";
 };
 
+&usb3_phy0 {
+	status = "okay";
+};
+
+&usb3_0 {
+	status = "okay";
+};
+
+&usb_dwc3_0 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	dr_mode = "otg";
+	usb-role-switch;
+	status = "okay";
+
+	port@0 {
+		reg = <0>;
+
+		typec_hs: endpoint {
+			remote-endpoint = <&usb_con_hs>;
+		};
+	};
+
+	port@1 {
+		reg = <1>;
+
+		typec_ss: endpoint {
+			remote-endpoint = <&usb_con_ss>;
+		};
+	};
+};
+
 &usb3_phy1 {
 	vbus-supply = <&reg_usb_host>;
 	status = "okay";
@@ -356,6 +440,12 @@  MX8MP_IOMUXC_SAI3_MCLK__PWM4_OUT	0x102
 		>;
 	};
 
+	pinctrl_typec: typecgrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_GPIO1_IO05__GPIO1_IO05	0x1c0
+		>;
+	};
+
 	pinctrl_uart2: uart2grp {
 		fsl,pins = <
 			MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX	0x0
@@ -363,6 +453,12 @@  MX8MP_IOMUXC_UART2_TXD__UART2_DCE_TX	0x0
 		>;
 	};
 
+	pinctrl_usbc_vbus: usbcgrp {
+		fsl,pins =
+			<MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12	0x0
+		>;
+	};
+
 	pinctrl_usb_host_vbus: usb1grp {
 		fsl,pins = <
 			MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR	0x0