Re: [PATCH 2/2] arm64: dts: imx8mp-ultra-mach-sbc: fix CBTU02043 USB Type-C orientation switch

[email protected]
Newsgroups dev.linux.lists.imx,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The GPIO hog for the CBTU02043 XSD pin incorrectly drives the physical pin HIGH, placing the switch into shutdown mode instead of keeping it enabled.
--

--- Patch [2]: [PATCH 2/2] arm64: dts: imx8mp-ultra-mach-sbc: fix CBTU02043 USB Type-C orientation switch ---
commit 9b2cdf94fea52f7b5503f6d6e284f01ff2cf262b
Author: Peng Fan <[email protected]>

arm64: dts: imx8mp-ultra-mach-sbc: fix CBTU02043 USB Type-C orientation switch

This commit drops the gpio-sbu-mux node, replacing it with an
orientation-gpios property in the ptn5110 TCPC node. It also adds a gpio-hog
to keep the CBTU02043 switch's XSD (shutdown) pin held low, ensuring the
device remains enabled.

> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-ultra-mach-sbc.dts b/arch/arm64/boot/dts/freescale/imx8mp-ultra-mach-sbc.dts
> index 3e6f9c88cc200..7e0550647751e 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-ultra-mach-sbc.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-ultra-mach-sbc.dts

[ ... ]

> @@ -217,6 +202,15 @@ &gpio2 {
>  		"", "", "", "", "#SD2_CD", "", "", "",
>  		"", "", "", "", "#USB-C_EN", "", "", "",
>  		"", "", "", "", "", "", "", "";
> +
> +	cbtu02043-xsd-hog {
> +		gpio-hog;
> +		gpios = <20 GPIO_ACTIVE_LOW>;
> +		output-low;

[Severity: High]
Will this configuration inadvertently drive the XSD pin HIGH, placing the
switch into shutdown mode?

The commit message notes that the CBTU02043 XSD pin is active-low (LOW for
normal operation, HIGH for shutdown).

However, the gpio-hog node specifies both gpios = <20 GPIO_ACTIVE_LOW> and
output-low. The output-low property in the device tree binding requests a
logical 0 (inactive state). The GPIO subsystem evaluates this against the
GPIO_ACTIVE_LOW flag and inverts the logical 0 into a physical 1 (HIGH).

Could this be resolved by either using output-high (to request a logical 1 /
physical LOW) or by changing the polarity to GPIO_ACTIVE_HIGH while retaining
output-low, to ensure the physical pin is correctly driven LOW?

> +		line-name = "CBTU02043_XSD";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_cbtu02043_xsd>;
> +	};
>  };

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.