Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual
@ 2026-03-23 11:09 Xu Yang
  2026-03-23 11:09 ` [PATCH 2/2] arm64: dts: imx8qxp-mek: " Xu Yang
  2026-03-23 18:16 ` [PATCH 1/2] arm64: dts: imx8qm-mek: " Frank Li
  0 siblings, 2 replies; 4+ messages in thread
From: Xu Yang @ 2026-03-23 11:09 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, Frank.Li, s.hauer, kernel, festevam
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel, jun.li

When attach to PC Type-A port, the USB device controller does not function
at all. Because it is configured as source-only and a Type-A port doesn't
support PD capability, a data role swap is impossible.

Actually, PTN5110THQ is configured for DFP/Source role only at POR, but
after POR it can operate as a DRP. By switching the power-role to dual,
the port can operate as a sink and enter device mode when attached to
Type-A port.

Since the board design uses EN_SRC to control the 5V VBUS path and EN_SNK
to control the 12V VBUS output, to avoid outputting a higher VBUS when in
sink role, we set the operation current limit to 0mA so that SW will not
control EN_SNK at all.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
index dadc136aec6e..8a832a0e105d 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
@@ -611,9 +611,13 @@ ptn5110: tcpc@51 {
 		usb_con1: connector {
 			compatible = "usb-c-connector";
 			label = "USB-C";
-			power-role = "source";
+			power-role = "dual";
 			data-role = "dual";
+			try-power-role = "sink";
 			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			sink-pdos = <PDO_FIXED(5000, 0, PDO_FIXED_USB_COMM)>;
+			op-sink-microwatt = <0>;
+			self-powered;
 
 			ports {
 				#address-cells = <1>;
-- 
2.34.1



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

* [PATCH 2/2] arm64: dts: imx8qxp-mek: switch Type-C connector power-role to dual
  2026-03-23 11:09 [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual Xu Yang
@ 2026-03-23 11:09 ` Xu Yang
  2026-03-23 18:16 ` [PATCH 1/2] arm64: dts: imx8qm-mek: " Frank Li
  1 sibling, 0 replies; 4+ messages in thread
From: Xu Yang @ 2026-03-23 11:09 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, Frank.Li, s.hauer, kernel, festevam
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel, jun.li

When attach to PC Type-A port, the USB device controller does not function
at all. Because it is configured as source-only and a Type-A port doesn't
support PD capability, a data role swap is impossible.

Actually, PTN5110THQ is configured for DFP/Source role only at POR, but
after POR it can operate as a DRP. By switching the power-role to dual,
the port can operate as a sink and enter device mode when attached to
Type-A port.

Since the board design uses EN_SRC to control the 5V VBUS path and EN_SNK
to control the 12V VBUS output, to avoid outputting a higher VBUS when in
sink role, we set the operation current limit to 0mA so that SW will not
control EN_SNK at all.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
index 40a0bc9f4e84..a16a3e0dd7ac 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
@@ -566,9 +566,13 @@ ptn5110: tcpc@50 {
 		usb_con1: connector {
 			compatible = "usb-c-connector";
 			label = "USB-C";
-			power-role = "source";
+			power-role = "dual";
 			data-role = "dual";
+			try-power-role = "sink";
 			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			sink-pdos = <PDO_FIXED(5000, 0, PDO_FIXED_USB_COMM)>;
+			op-sink-microwatt = <0>;
+			self-powered;
 
 			ports {
 				#address-cells = <1>;
-- 
2.34.1



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

* Re: [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual
  2026-03-23 11:09 [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual Xu Yang
  2026-03-23 11:09 ` [PATCH 2/2] arm64: dts: imx8qxp-mek: " Xu Yang
@ 2026-03-23 18:16 ` Frank Li
  2026-03-24  3:15   ` Xu Yang
  1 sibling, 1 reply; 4+ messages in thread
From: Frank Li @ 2026-03-23 18:16 UTC (permalink / raw)
  To: Xu Yang
  Cc: robh, krzk+dt, conor+dt, s.hauer, kernel, festevam, devicetree,
	imx, linux-arm-kernel, linux-kernel, jun.li

On Mon, Mar 23, 2026 at 07:09:22PM +0800, Xu Yang wrote:
> When attach to PC Type-A port, the USB device controller does not function
> at all. Because it is configured as source-only and a Type-A port doesn't
> support PD capability, a data role swap is impossible.
>
> Actually, PTN5110THQ is configured for DFP/Source role only at POR, but
> after POR it can operate as a DRP. By switching the power-role to dual,
> the port can operate as a sink and enter device mode when attached to
> Type-A port.

when first use term DFP/DRP,
	DFP (Downstream Facing Port)  ...

Except well known term, like POR.

>
> Since the board design uses EN_SRC to control the 5V VBUS path and EN_SNK
> to control the 12V VBUS output,

I remember a hardware rework to fix this problem.

> to avoid outputting a higher VBUS when in
> sink role, we set the operation current limit to 0mA so that SW will not
> control EN_SNK at all.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> index dadc136aec6e..8a832a0e105d 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> @@ -611,9 +611,13 @@ ptn5110: tcpc@51 {
>  		usb_con1: connector {
>  			compatible = "usb-c-connector";
>  			label = "USB-C";
> -			power-role = "source";
> +			power-role = "dual";
>  			data-role = "dual";
> +			try-power-role = "sink";
>  			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> +			sink-pdos = <PDO_FIXED(5000, 0, PDO_FIXED_USB_COMM)>;
> +			op-sink-microwatt = <0>;

Need comment here.

Frank
> +			self-powered;
>
>  			ports {
>  				#address-cells = <1>;
> --
> 2.34.1
>


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

* Re: [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual
  2026-03-23 18:16 ` [PATCH 1/2] arm64: dts: imx8qm-mek: " Frank Li
@ 2026-03-24  3:15   ` Xu Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Xu Yang @ 2026-03-24  3:15 UTC (permalink / raw)
  To: Frank Li
  Cc: robh, krzk+dt, conor+dt, s.hauer, kernel, festevam, devicetree,
	imx, linux-arm-kernel, linux-kernel, jun.li

On Mon, Mar 23, 2026 at 02:16:12PM -0400, Frank Li wrote:
> On Mon, Mar 23, 2026 at 07:09:22PM +0800, Xu Yang wrote:
> > When attach to PC Type-A port, the USB device controller does not function
> > at all. Because it is configured as source-only and a Type-A port doesn't
> > support PD capability, a data role swap is impossible.
> >
> > Actually, PTN5110THQ is configured for DFP/Source role only at POR, but
> > after POR it can operate as a DRP. By switching the power-role to dual,
> > the port can operate as a sink and enter device mode when attached to
> > Type-A port.
> 
> when first use term DFP/DRP,
> 	DFP (Downstream Facing Port)  ...
> 
> Except well known term, like POR.

OK.

> 
> >
> > Since the board design uses EN_SRC to control the 5V VBUS path and EN_SNK
> > to control the 12V VBUS output,
> 
> I remember a hardware rework to fix this problem.

Yes, PTN5110THQ is EOL, then PTN5110NHQ is used as a replacement. Since PTN5110NHQ
works as DRP at POR, then this will bring an issue that PTN5110NHQ may work as
a sink when attached to PC then EN_SNK will be enabled and 12V will be output to
PC and this will damage the PC. A hardware rework is done to change PTN5110NHQ to
DFP/Source role at POR to avoid the issue.

The hardware rework and this patch fix different issues.

> 
> > to avoid outputting a higher VBUS when in
> > sink role, we set the operation current limit to 0mA so that SW will not
> > control EN_SNK at all.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > ---
> >  arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> > index dadc136aec6e..8a832a0e105d 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> > +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> > @@ -611,9 +611,13 @@ ptn5110: tcpc@51 {
> >  		usb_con1: connector {
> >  			compatible = "usb-c-connector";
> >  			label = "USB-C";
> > -			power-role = "source";
> > +			power-role = "dual";
> >  			data-role = "dual";
> > +			try-power-role = "sink";
> >  			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> > +			sink-pdos = <PDO_FIXED(5000, 0, PDO_FIXED_USB_COMM)>;
> > +			op-sink-microwatt = <0>;
> 
> Need comment here.

OK.

Thanks,
Xu Yang


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

end of thread, other threads:[~2026-03-24  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 11:09 [PATCH 1/2] arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual Xu Yang
2026-03-23 11:09 ` [PATCH 2/2] arm64: dts: imx8qxp-mek: " Xu Yang
2026-03-23 18:16 ` [PATCH 1/2] arm64: dts: imx8qm-mek: " Frank Li
2026-03-24  3:15   ` Xu Yang

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