[PATCH] arm64: dts: qcom: msm8939-asus-z00t: add USB-OTG pin

Erikas Bitovtas posted 1 patch 3 weeks, 5 days ago
arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
[PATCH] arm64: dts: qcom: msm8939-asus-z00t: add USB-OTG pin
Posted by Erikas Bitovtas 3 weeks, 5 days ago
This device uses an ID pin set to active high to detect USB-OTG devices.
Add support for it on extcon-usb-gpio.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
This device uses an ID pin to identify USB-OTG devices. In this commit
we add support for USB-OTG gpio over pinctrl in extcon-usb-gpio.

For USB to work in host mode, a vbus-supply is also needed. On this
device, vbus is supplied by Summit Microelectronics SMB358 charging IC,
for which there is a driver in mainline. Unfortunately, it cannot be
added to this device tree at the moment, because charging detection does
not work correctly - device begins to charge only upon probing the
charger driver module. For now, we add just the pin - USB-OTG will
require an adapter with an external power supply.
---
 arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
index ea90b00a2c8a..6c19044c24bc 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
@@ -127,7 +127,7 @@ reg_sd_vmmc: regulator-sdcard-vmmc {
 	usb_id: usb-id {
 		compatible = "linux,extcon-usb-gpio";
 		id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
-		pinctrl-0 = <&usb_id_default>;
+		pinctrl-0 = <&usb_id_default>, <&usb_id_switch_default>;
 		pinctrl-names = "default";
 	};
 };
@@ -330,4 +330,11 @@ mag_reset_default: mag-reset-default-state {
 		drive-strength = <2>;
 		bias-disable;
 	};
+
+	usb_id_switch_default: usb-id-switch-default-state {
+		pins = "gpio121";
+		function = "gpio";
+		drive-strength = <2>;
+		output-high;
+	};
 };

---
base-commit: b0501426597b91ad69359c312e32fefe4cd8ec67
change-id: 20260312-z00t-otg-pin-41e102d92c4d

Best regards,
-- 
Erikas Bitovtas <xerikasxx@gmail.com>
Re: [PATCH] arm64: dts: qcom: msm8939-asus-z00t: add USB-OTG pin
Posted by Konrad Dybcio 3 weeks, 4 days ago
On 3/12/26 2:12 PM, Erikas Bitovtas wrote:
> This device uses an ID pin set to active high to detect USB-OTG devices.
> Add support for it on extcon-usb-gpio.
> 
> Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
> ---
> This device uses an ID pin to identify USB-OTG devices. In this commit
> we add support for USB-OTG gpio over pinctrl in extcon-usb-gpio.
> 
> For USB to work in host mode, a vbus-supply is also needed. On this
> device, vbus is supplied by Summit Microelectronics SMB358 charging IC,
> for which there is a driver in mainline. Unfortunately, it cannot be
> added to this device tree at the moment, because charging detection does
> not work correctly - device begins to charge only upon probing the
> charger driver module. For now, we add just the pin - USB-OTG will
> require an adapter with an external power supply.
> ---
>  arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
> index ea90b00a2c8a..6c19044c24bc 100644
> --- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
> @@ -127,7 +127,7 @@ reg_sd_vmmc: regulator-sdcard-vmmc {
>  	usb_id: usb-id {
>  		compatible = "linux,extcon-usb-gpio";
>  		id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
> -		pinctrl-0 = <&usb_id_default>;
> +		pinctrl-0 = <&usb_id_default>, <&usb_id_switch_default>;

If GPIO_121 is the ID (OTG) pin, then what is the other "ID" pin?

It's further confusing that you configure it as output. Could you
please try and rephrase its description?

FWIW it may be beneficial to turn to the "gpio-usb-b-connector" binding

Konrad