mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO
@ 2026-03-08 23:20 Alexander Koskovich
  2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-08 23:20 UTC (permalink / raw)
  To: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, Alexander Koskovich

The ASUS ROG Phone 3 has two USB-C ports whose VBUS lines are both
wired to the single USBIN input on the PM8150B PMIC. This means the
Type-C port controller cannot distinguish which port is providing
VBUS, causing one port to be unusable when the other has VBUS present
from a charger or PC.

The downstream vendor driver also appears to be touching
TYPE_C_CRUDE_SENSOR_CFG_REG for restoring CC detection after enabling
BYPASS_VSAFE0V but does not appear to be necessary with the upstream
TCPM stack?

Feedback on whether additional register configuration is needed would be
appreciated, but functionally this appears to work as is. After these
changes and configuring the property in DTS I am able to use a flash
drive on the side USB port (pm8150b_typec) while I am connected to a
charger or my PC via the bottom USB port (rt1715).

Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
---
Alexander Koskovich (2):
      dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
      usb: typec: qcom: Add support for shared USBIN VBUS detection

 .../devicetree/bindings/usb/qcom,pmic-typec.yaml   |  6 +++
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 46 +++++++++++++++++++++-
 2 files changed, 50 insertions(+), 2 deletions(-)
---
base-commit: 11439c4635edd669ae435eec308f4ab8a0804808
change-id: 20260308-qcom-typec-shared-vbus-7d37c6b2d155

Best regards,
-- 
Alexander Koskovich <akoskovich@pm.me>



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

* [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
  2026-03-08 23:20 [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Alexander Koskovich
@ 2026-03-08 23:20 ` Alexander Koskovich
  2026-03-11 23:02   ` Bryan O'Donoghue
  2026-03-12  2:34   ` Dmitry Baryshkov
  2026-03-08 23:20 ` [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection Alexander Koskovich
  2026-03-11 14:50 ` [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Bryan O'Donoghue
  2 siblings, 2 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-08 23:20 UTC (permalink / raw)
  To: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, Alexander Koskovich

Add the optional vbus-detect-gpios property for devices where the PMIC's
built-in VBUS detection is unreliable.

Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
---
 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
index 6d3fa2bc9cee..f45bf3e34c03 100644
--- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
@@ -78,6 +78,12 @@ properties:
       - const: msg-rx-discarded
       - const: fr-swap
 
+  vbus-detect-gpios:
+    maxItems: 1
+    description:
+      GPIO used to detect VBUS presence when the PMIC's built-in VBUS
+      detection is unreliable.
+
   vdd-vbus-supply:
     description: VBUS power supply.
 

-- 
2.53.0



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

* [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-08 23:20 [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Alexander Koskovich
  2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
@ 2026-03-08 23:20 ` Alexander Koskovich
  2026-03-11 13:01   ` Konrad Dybcio
  2026-03-11 23:05   ` Bryan O'Donoghue
  2026-03-11 14:50 ` [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Bryan O'Donoghue
  2 siblings, 2 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-08 23:20 UTC (permalink / raw)
  To: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, Alexander Koskovich

On devices with multiple USB-C ports whose VBUS lines are wired to a
single shared USBIN input on the PM8150B PMIC (e.g. ASUS ROG Phone 3), the
Type-C port controller cannot distinguish which port is providing VBUS.

In practice this shows up as being unable to use the affected Type-C port
while the other port is connected to a device providing VBUS such as a PC
or charger.

Add support for an optional vbus-detect-gpios property that allows the
Type-C port controller to read VBUS state from a per-port GPIO instead of
the shared USBIN input. When present, the driver also bypasses VSAFE0V
checks and switches DRP toggling to TRY_SRC to avoid false source
detection caused by VBUS present on USBIN from another port.

Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 46 +++++++++++++++++++++-
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
index 8051eaa46991..c338e26651b0 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
@@ -5,6 +5,7 @@
 
 #include <linux/delay.h>
 #include <linux/err.h>
+#include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mod_devicetable.h>
@@ -176,6 +177,8 @@ struct pmic_typec_port {
 	bool				vbus_enabled;
 	struct mutex			vbus_lock;		/* VBUS state serialization */
 
+	struct gpio_desc		*vbus_detect_gpio;
+
 	int				cc;
 	bool				debouncing_cc;
 	struct delayed_work		cc_debounce_dwork;
@@ -277,7 +280,12 @@ static int qcom_pmic_typec_port_vbus_detect(struct pmic_typec_port *pmic_typec_p
 {
 	struct device *dev = pmic_typec_port->dev;
 	unsigned int misc;
-	int ret;
+	int ret, vbus;
+
+	if (pmic_typec_port->vbus_detect_gpio) {
+		vbus = gpiod_get_value_cansleep(pmic_typec_port->vbus_detect_gpio);
+		return vbus;
+	}
 
 	ret = regmap_read(pmic_typec_port->regmap,
 			  pmic_typec_port->base + TYPEC_MISC_STATUS_REG,
@@ -307,6 +315,13 @@ static int qcom_pmic_typec_port_vbus_toggle(struct pmic_typec_port *pmic_typec_p
 		if (ret)
 			return ret;
 
+		/*
+		 * On devices with multiple ports sharing USBIN, VBUS from another
+		 * port prevents VSAFE0V from being reached.
+		 */
+		if (pmic_typec_port->vbus_detect_gpio)
+			return 0;
+
 		val = TYPEC_SM_VBUS_VSAFE0V;
 	}
 
@@ -589,7 +604,14 @@ static int qcom_pmic_typec_port_start_toggling(struct tcpc_dev *tcpc,
 		mode = EN_SNK_ONLY;
 		break;
 	case TYPEC_PORT_DRP:
-		mode = EN_TRY_SNK;
+		/*
+		 * VBUS from another port makes EN_TRY_SNK falsely detect
+		 * a source. Start as Rp to reliably find sinks.
+		 */
+		if (pmic_typec_port->vbus_detect_gpio)
+			mode = EN_TRY_SRC;
+		else
+			mode = EN_TRY_SNK;
 		break;
 	}
 
@@ -677,6 +699,20 @@ static int qcom_pmic_typec_port_start(struct pmic_typec *tcpm,
 	if (ret)
 		goto done;
 
+	/*
+	 * On devices with multiple USB-C ports sharing USBIN, bypass
+	 * VSAFE0V so SRC attachment can complete despite VBUS being
+	 * present on USBIN from another port.
+	 */
+	if (pmic_typec_port->vbus_detect_gpio) {
+		ret = regmap_update_bits(pmic_typec_port->regmap,
+					 pmic_typec_port->base + TYPEC_EXIT_STATE_CFG_REG,
+					 BYPASS_VSAFE0V_DURING_ROLE_SWAP,
+					 BYPASS_VSAFE0V_DURING_ROLE_SWAP);
+		if (ret)
+			goto done;
+	}
+
 	pmic_typec_port->tcpm_port = tcpm_port;
 
 	for (i = 0; i < pmic_typec_port->nr_irqs; i++)
@@ -724,6 +760,12 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
 	if (IS_ERR(pmic_typec_port->vdd_vbus))
 		return PTR_ERR(pmic_typec_port->vdd_vbus);
 
+	pmic_typec_port->vbus_detect_gpio = devm_gpiod_get_optional(dev, "vbus-detect",
+								 GPIOD_IN);
+	if (IS_ERR(pmic_typec_port->vbus_detect_gpio))
+		return dev_err_probe(dev, PTR_ERR(pmic_typec_port->vbus_detect_gpio),
+				     "failed to get vbus-detect GPIO\n");
+
 	pmic_typec_port->dev = dev;
 	pmic_typec_port->base = base;
 	pmic_typec_port->regmap = regmap;

-- 
2.53.0



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

* Re: [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-08 23:20 ` [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection Alexander Koskovich
@ 2026-03-11 13:01   ` Konrad Dybcio
  2026-03-11 14:39     ` Bryan O'Donoghue
  2026-03-11 16:24     ` Alexander Koskovich
  2026-03-11 23:05   ` Bryan O'Donoghue
  1 sibling, 2 replies; 15+ messages in thread
From: Konrad Dybcio @ 2026-03-11 13:01 UTC (permalink / raw)
  To: Alexander Koskovich, Bryan O'Donoghue, Greg Kroah-Hartman,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 3/9/26 12:20 AM, Alexander Koskovich wrote:
> On devices with multiple USB-C ports whose VBUS lines are wired to a
> single shared USBIN input on the PM8150B PMIC (e.g. ASUS ROG Phone 3), the
> Type-C port controller cannot distinguish which port is providing VBUS.
> 
> In practice this shows up as being unable to use the affected Type-C port
> while the other port is connected to a device providing VBUS such as a PC
> or charger.
> 
> Add support for an optional vbus-detect-gpios property that allows the
> Type-C port controller to read VBUS state from a per-port GPIO instead of
> the shared USBIN input. When present, the driver also bypasses VSAFE0V
> checks and switches DRP toggling to TRY_SRC to avoid false source
> detection caused by VBUS present on USBIN from another port.
> 
> Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
> ---

[...]

> +	if (pmic_typec_port->vbus_detect_gpio) {
> +		vbus = gpiod_get_value_cansleep(pmic_typec_port->vbus_detect_gpio);
> +		return vbus;

"return gpiod_..."

[...]

> +	/*
> +	 * On devices with multiple USB-C ports sharing USBIN, bypass
> +	 * VSAFE0V so SRC attachment can complete despite VBUS being
> +	 * present on USBIN from another port.
> +	 */
> +	if (pmic_typec_port->vbus_detect_gpio) {
> +		ret = regmap_update_bits(pmic_typec_port->regmap,
> +					 pmic_typec_port->base + TYPEC_EXIT_STATE_CFG_REG,
> +					 BYPASS_VSAFE0V_DURING_ROLE_SWAP,
> +					 BYPASS_VSAFE0V_DURING_ROLE_SWAP);

regmap_set_bits()



> +		if (ret)
> +			goto done;
> +	}
> +
>  	pmic_typec_port->tcpm_port = tcpm_port;
>  
>  	for (i = 0; i < pmic_typec_port->nr_irqs; i++)
> @@ -724,6 +760,12 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
>  	if (IS_ERR(pmic_typec_port->vdd_vbus))
>  		return PTR_ERR(pmic_typec_port->vdd_vbus);
>  
> +	pmic_typec_port->vbus_detect_gpio = devm_gpiod_get_optional(dev, "vbus-detect",
> +								 GPIOD_IN);

I thought the intent here was to have 2 GPIOs, one per port - could
you please shed some light on this?

Konrad

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

* Re: [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-11 13:01   ` Konrad Dybcio
@ 2026-03-11 14:39     ` Bryan O'Donoghue
  2026-03-11 16:24     ` Alexander Koskovich
  1 sibling, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-03-11 14:39 UTC (permalink / raw)
  To: Konrad Dybcio, Alexander Koskovich, Greg Kroah-Hartman,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 11/03/2026 13:01, Konrad Dybcio wrote:
>> +	pmic_typec_port->vbus_detect_gpio = devm_gpiod_get_optional(dev, "vbus-detect",
>> +								 GPIOD_IN);
> I thought the intent here was to have 2 GPIOs, one per port - could
> you please shed some light on this?

You should have two instances of the driver. One for each port so one 
GPIO detect in-lieu of VBUS per port.

So for this board we would expect to see

- pmic@2::pm8150b_typec: typec@1500
- pmic@3::pm8150b_typec: typec@1500

and a VBUS GPIO associated with each type-c connector.

---
bod

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

* Re: [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO
  2026-03-08 23:20 [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Alexander Koskovich
  2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
  2026-03-08 23:20 ` [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection Alexander Koskovich
@ 2026-03-11 14:50 ` Bryan O'Donoghue
  2026-03-11 17:37   ` Alexander Koskovich
  2 siblings, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-03-11 14:50 UTC (permalink / raw)
  To: Alexander Koskovich, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 08/03/2026 23:20, Alexander Koskovich wrote:
> The ASUS ROG Phone 3 has two USB-C ports whose VBUS lines are both
> wired to the single USBIN input on the PM8150B PMIC. This means the
> Type-C port controller cannot distinguish which port is providing
> VBUS, causing one port to be unusable when the other has VBUS present
> from a charger or PC.

Hrmm..

If you have a GPIO for VBUS detect then who is sourcing VBUS in host mode ?

There should be a GPIO to switch it on aswell ? And in this case both 
ports will become "hot" at the same time.

How does VBUS work in host mode here ?

---
bod

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

* Re: [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-11 13:01   ` Konrad Dybcio
  2026-03-11 14:39     ` Bryan O'Donoghue
@ 2026-03-11 16:24     ` Alexander Koskovich
  1 sibling, 0 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-11 16:24 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	linux-arm-msm, linux-usb, devicetree, linux-kernel

On Wednesday, March 11th, 2026 at 9:02 AM, Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> wrote:

> 
> I thought the intent here was to have 2 GPIOs, one per port - could
> you please shed some light on this?

For the ROG 3 there is a pm8150b_typec and an rt1715, the pm8150b_typec is the
only one that needs this workaround as the rt1715 has it's own CC detection
mechanism that doesn't get confused by the shared VBUS.

Although there is a GPIO to detect VBUS on the bottom port as well, I just
found that I only needed the one for pm8150b_typec atm. 

> 
> Konrad
> 

Thanks,
Alex

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

* Re: [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO
  2026-03-11 14:50 ` [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Bryan O'Donoghue
@ 2026-03-11 17:37   ` Alexander Koskovich
  2026-03-11 23:00     ` Bryan O'Donoghue
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-11 17:37 UTC (permalink / raw)
  To: Bryan O'Donoghue
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heikki Krogerus, linux-arm-msm, linux-usb,
	devicetree, linux-kernel

On Wednesday, March 11th, 2026 at 10:53 AM, Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote:

> On 08/03/2026 23:20, Alexander Koskovich wrote:
> > The ASUS ROG Phone 3 has two USB-C ports whose VBUS lines are both
> > wired to the single USBIN input on the PM8150B PMIC. This means the
> > Type-C port controller cannot distinguish which port is providing
> > VBUS, causing one port to be unusable when the other has VBUS present
> > from a charger or PC.
> 
> Hrmm..
> 
> If you have a GPIO for VBUS detect then who is sourcing VBUS in host mode ?
> 
> There should be a GPIO to switch it on aswell ? And in this case both
> ports will become "hot" at the same time.

For the side port this is the PM8150B's internal OTG regulator which is gated
onto the connector with an external load switch controlled by GPIO 11
(downstream calls this POGO_OTG_EN).

For the bottom port there's an independent boost converter which is gated by
GPIO 71 (downstream calls this BTM_OTG_EN), and doesn't have anything to do
with the PM8150B OTG output.

For the ROG 3 I've modeled these in DTS as vreg_pm8150b_vbus & vreg_rt1715_vbus,
so they're the vbus-supply for each TCPM.

> 
> How does VBUS work in host mode here ?

When a USB device is plugged into one port CC detection sees the phone as
source, and the OTG GPIO for the port is asserted to enable 5V.

The VBUS detect GPIO won't read as active for this since OTG power takes a
different path than the OVP ICs (2x BQ25968).

> 

Also here's a link to the downstream driver for reference: https://github.com/LineageOS/android_kernel_asus_sm8250/blob/lineage-19.1/drivers/power/supply/qcom/smb5-lib.c

> ---
> bod
> 
>

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

* Re: [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO
  2026-03-11 17:37   ` Alexander Koskovich
@ 2026-03-11 23:00     ` Bryan O'Donoghue
  0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-03-11 23:00 UTC (permalink / raw)
  To: Alexander Koskovich
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heikki Krogerus, linux-arm-msm, linux-usb,
	devicetree, linux-kernel

On 11/03/2026 17:37, Alexander Koskovich wrote:
> For the bottom port there's an independent boost converter

Ahh..

OK for some reason I read your mail and thought that the PM8150b was 
sourcing VBUS for both ports, after realising you had a RT1715 aka 
reading your cover letter again.

So much for my research on how to make that esoteric setup work.

---
bod

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

* Re: [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
  2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
@ 2026-03-11 23:02   ` Bryan O'Donoghue
  2026-03-16 10:15     ` Konrad Dybcio
  2026-03-12  2:34   ` Dmitry Baryshkov
  1 sibling, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-03-11 23:02 UTC (permalink / raw)
  To: Alexander Koskovich, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 08/03/2026 23:20, Alexander Koskovich wrote:
> +  vbus-detect-gpios:

Should this be plural ?

arch/arm64/boot/dts/qcom/apq8096-db820c.dts:		pinctrl-0 = 
<&usb2_vbus_det_gpio>;
arch/arm64/boot/dts/qcom/apq8096-db820c.dts:		pinctrl-0 = 
<&usb3_vbus_det_gpio>;
arch/arm64/boot/dts/qcom/apq8096-db820c.dts:	usb3_vbus_det_gpio: 
pm8996-gpio22-state {
arch/arm64/boot/dts/qcom/apq8096-db820c.dts:	usb2_vbus_det_gpio: 
pmi8996-gpio6-state {

Seems a minor point

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

---
bod

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

* Re: [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-08 23:20 ` [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection Alexander Koskovich
  2026-03-11 13:01   ` Konrad Dybcio
@ 2026-03-11 23:05   ` Bryan O'Donoghue
  2026-03-12  6:18     ` Alexander Koskovich
  1 sibling, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-03-11 23:05 UTC (permalink / raw)
  To: Alexander Koskovich, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 08/03/2026 23:20, Alexander Koskovich wrote:
> +	if (IS_ERR(pmic_typec_port->vbus_detect_gpio))
> +		return dev_err_probe(dev, PTR_ERR(pmic_typec_port->vbus_detect_gpio),
> +				     "failed to get vbus-detect GPIO\n");
> +

I'd prefer if this was bracketed since it is over more than one line.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

---
bod

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

* Re: [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
  2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
  2026-03-11 23:02   ` Bryan O'Donoghue
@ 2026-03-12  2:34   ` Dmitry Baryshkov
  2026-03-12  2:59     ` Alexander Koskovich
  1 sibling, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-03-12  2:34 UTC (permalink / raw)
  To: Alexander Koskovich
  Cc: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	linux-arm-msm, linux-usb, devicetree, linux-kernel

On Sun, Mar 08, 2026 at 11:20:27PM +0000, Alexander Koskovich wrote:
> Add the optional vbus-detect-gpios property for devices where the PMIC's
> built-in VBUS detection is unreliable.
> 
> Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
> ---
>  Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> index 6d3fa2bc9cee..f45bf3e34c03 100644
> --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> @@ -78,6 +78,12 @@ properties:
>        - const: msg-rx-discarded
>        - const: fr-swap
>  
> +  vbus-detect-gpios:
> +    maxItems: 1
> +    description:
> +      GPIO used to detect VBUS presence when the PMIC's built-in VBUS
> +      detection is unreliable.

Can we use vbus-gpios from the usb-connector instead?

> +
>    vdd-vbus-supply:
>      description: VBUS power supply.
>  
> 
> -- 
> 2.53.0
> 
> 

-- 
With best wishes
Dmitry

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

* Re: [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
  2026-03-12  2:34   ` Dmitry Baryshkov
@ 2026-03-12  2:59     ` Alexander Koskovich
  0 siblings, 0 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-12  2:59 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bryan O'Donoghue, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	linux-arm-msm, linux-usb, devicetree, linux-kernel

On Wednesday, March 11th, 2026 at 10:34 PM, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote:

> On Sun, Mar 08, 2026 at 11:20:27PM +0000, Alexander Koskovich wrote:
> > Add the optional vbus-detect-gpios property for devices where the PMIC's
> > built-in VBUS detection is unreliable.
> >
> > Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
> > ---
> >  Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> > index 6d3fa2bc9cee..f45bf3e34c03 100644
> > --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> > +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> > @@ -78,6 +78,12 @@ properties:
> >        - const: msg-rx-discarded
> >        - const: fr-swap
> >
> > +  vbus-detect-gpios:
> > +    maxItems: 1
> > +    description:
> > +      GPIO used to detect VBUS presence when the PMIC's built-in VBUS
> > +      detection is unreliable.
> 
> Can we use vbus-gpios from the usb-connector instead?

Didn't see that! Yes definitely, will update v2 to use that instead.

> 
> > +
> >    vdd-vbus-supply:
> >      description: VBUS power supply.
> >
> >
> > --
> > 2.53.0
> >
> >
> 
> --
> With best wishes
> Dmitry
> 

Thanks,
Alex

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

* Re: [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection
  2026-03-11 23:05   ` Bryan O'Donoghue
@ 2026-03-12  6:18     ` Alexander Koskovich
  0 siblings, 0 replies; 15+ messages in thread
From: Alexander Koskovich @ 2026-03-12  6:18 UTC (permalink / raw)
  To: Bryan O'Donoghue
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heikki Krogerus, linux-arm-msm, linux-usb,
	devicetree, linux-kernel


On Wednesday, March 11th, 2026 at 7:06 PM, Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote:

> On 08/03/2026 23:20, Alexander Koskovich wrote:
> > +	if (IS_ERR(pmic_typec_port->vbus_detect_gpio))
> > +		return dev_err_probe(dev, PTR_ERR(pmic_typec_port->vbus_detect_gpio),
> > +				     "failed to get vbus-detect GPIO\n");
> > +
> 
> I'd prefer if this was bracketed since it is over more than one line.
> 
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

Uploaded v2 but didn't carry your Reviewed-By since there's a fair bit of diff, can you look at v2 and check if all looks good?

> 
> ---
> bod
> 
> 

Thanks,
Alex

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

* Re: [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property
  2026-03-11 23:02   ` Bryan O'Donoghue
@ 2026-03-16 10:15     ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2026-03-16 10:15 UTC (permalink / raw)
  To: Bryan O'Donoghue, Alexander Koskovich, Greg Kroah-Hartman,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus
  Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel

On 3/12/26 12:02 AM, Bryan O'Donoghue wrote:
> On 08/03/2026 23:20, Alexander Koskovich wrote:
>> +  vbus-detect-gpios:
> 
> Should this be plural ?

Yes

e.g.

Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml

Konrad

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

end of thread, other threads:[~2026-03-16 10:15 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-08 23:20 [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Alexander Koskovich
2026-03-08 23:20 ` [PATCH RFC 1/2] dt-bindings: usb: qcom,pmic-typec: Document vbus-detect-gpios property Alexander Koskovich
2026-03-11 23:02   ` Bryan O'Donoghue
2026-03-16 10:15     ` Konrad Dybcio
2026-03-12  2:34   ` Dmitry Baryshkov
2026-03-12  2:59     ` Alexander Koskovich
2026-03-08 23:20 ` [PATCH RFC 2/2] usb: typec: qcom: Add support for shared USBIN VBUS detection Alexander Koskovich
2026-03-11 13:01   ` Konrad Dybcio
2026-03-11 14:39     ` Bryan O'Donoghue
2026-03-11 16:24     ` Alexander Koskovich
2026-03-11 23:05   ` Bryan O'Donoghue
2026-03-12  6:18     ` Alexander Koskovich
2026-03-11 14:50 ` [PATCH RFC 0/2] usb: typec: qcom: Add shared USBIN VBUS detection via GPIO Bryan O'Donoghue
2026-03-11 17:37   ` Alexander Koskovich
2026-03-11 23:00     ` Bryan O'Donoghue

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

all inboxes | Powered by JetHome®