[PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue

Krishna Kurapati posted 1 patch 2 months, 3 weeks ago
There is a newer version of this series
drivers/usb/dwc3/dwc3-qcom.c | 90 +-----------------------------------
1 file changed, 1 insertion(+), 89 deletions(-)
[PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Krishna Kurapati 2 months, 3 weeks ago
Deprecate usage of extcon functionality from the glue driver. Now
that the glue driver is a flattened implementation, all existing
DTs would eventually move to new bindings. While doing so let them
make use of role-switch/ typec frameworks to provide role data
rather than using extcon.

On upstream, summary of targets/platforms using extcon is as follows:

1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
effect on them.

2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
driver which relies on id/vbus gpios to inform role changes. This can be
transitioned to role switch based driver (usb-conn-gpio) while flattening
those platforms to move away from extcon and rely on role
switching.

3. The one target that uses dwc3 controller and extcon and is not based
on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
This platform uses TI chip to provide extcon. If usb on this platform is
being flattneed, then effort should be put in to define a usb-c-connector
device in DT and make use of role switch functionality in TUSB320L driver.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
Changes in v3:
This change was 4rth patch in [1]. It was suggested to make this as the
first patch of the series. Since this is independent of role switch
patches, sending this out separately. Removed RB Tag of Dmitry since the
patch has been changed.

[1]: https://lore.kernel.org/all/20250610091357.2983085-1-krishna.kurapati@oss.qualcomm.com/

 drivers/usb/dwc3/dwc3-qcom.c | 90 +-----------------------------------
 1 file changed, 1 insertion(+), 89 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index ca7e1c02773a..a7eaefaeec4d 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -11,7 +11,6 @@
 #include <linux/of_clk.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/extcon.h>
 #include <linux/interconnect.h>
 #include <linux/platform_device.h>
 #include <linux/phy/phy.h>
@@ -79,11 +78,6 @@ struct dwc3_qcom {
 	struct dwc3_qcom_port	ports[DWC3_QCOM_MAX_PORTS];
 	u8			num_ports;
 
-	struct extcon_dev	*edev;
-	struct extcon_dev	*host_edev;
-	struct notifier_block	vbus_nb;
-	struct notifier_block	host_nb;
-
 	enum usb_dr_mode	mode;
 	bool			is_suspended;
 	bool			pm_suspended;
@@ -119,8 +113,7 @@ static inline void dwc3_qcom_clrbits(void __iomem *base, u32 offset, u32 val)
 
 /*
  * TODO: Make the in-core role switching code invoke dwc3_qcom_vbus_override_enable(),
- * validate that the in-core extcon support is functional, and drop extcon
- * handling from the glue
+ * validate that the in-core extcon support is functional
  */
 static void dwc3_qcom_vbus_override_enable(struct dwc3_qcom *qcom, bool enable)
 {
@@ -137,80 +130,6 @@ static void dwc3_qcom_vbus_override_enable(struct dwc3_qcom *qcom, bool enable)
 	}
 }
 
-static int dwc3_qcom_vbus_notifier(struct notifier_block *nb,
-				   unsigned long event, void *ptr)
-{
-	struct dwc3_qcom *qcom = container_of(nb, struct dwc3_qcom, vbus_nb);
-
-	/* enable vbus override for device mode */
-	dwc3_qcom_vbus_override_enable(qcom, event);
-	qcom->mode = event ? USB_DR_MODE_PERIPHERAL : USB_DR_MODE_HOST;
-
-	return NOTIFY_DONE;
-}
-
-static int dwc3_qcom_host_notifier(struct notifier_block *nb,
-				   unsigned long event, void *ptr)
-{
-	struct dwc3_qcom *qcom = container_of(nb, struct dwc3_qcom, host_nb);
-
-	/* disable vbus override in host mode */
-	dwc3_qcom_vbus_override_enable(qcom, !event);
-	qcom->mode = event ? USB_DR_MODE_HOST : USB_DR_MODE_PERIPHERAL;
-
-	return NOTIFY_DONE;
-}
-
-static int dwc3_qcom_register_extcon(struct dwc3_qcom *qcom)
-{
-	struct device		*dev = qcom->dev;
-	struct extcon_dev	*host_edev;
-	int			ret;
-
-	if (!of_property_present(dev->of_node, "extcon"))
-		return 0;
-
-	qcom->edev = extcon_get_edev_by_phandle(dev, 0);
-	if (IS_ERR(qcom->edev))
-		return dev_err_probe(dev, PTR_ERR(qcom->edev),
-				     "Failed to get extcon\n");
-
-	qcom->vbus_nb.notifier_call = dwc3_qcom_vbus_notifier;
-
-	qcom->host_edev = extcon_get_edev_by_phandle(dev, 1);
-	if (IS_ERR(qcom->host_edev))
-		qcom->host_edev = NULL;
-
-	ret = devm_extcon_register_notifier(dev, qcom->edev, EXTCON_USB,
-					    &qcom->vbus_nb);
-	if (ret < 0) {
-		dev_err(dev, "VBUS notifier register failed\n");
-		return ret;
-	}
-
-	if (qcom->host_edev)
-		host_edev = qcom->host_edev;
-	else
-		host_edev = qcom->edev;
-
-	qcom->host_nb.notifier_call = dwc3_qcom_host_notifier;
-	ret = devm_extcon_register_notifier(dev, host_edev, EXTCON_USB_HOST,
-					    &qcom->host_nb);
-	if (ret < 0) {
-		dev_err(dev, "Host notifier register failed\n");
-		return ret;
-	}
-
-	/* Update initial VBUS override based on extcon state */
-	if (extcon_get_state(qcom->edev, EXTCON_USB) ||
-	    !extcon_get_state(host_edev, EXTCON_USB_HOST))
-		dwc3_qcom_vbus_notifier(&qcom->vbus_nb, true, qcom->edev);
-	else
-		dwc3_qcom_vbus_notifier(&qcom->vbus_nb, false, qcom->edev);
-
-	return 0;
-}
-
 static int dwc3_qcom_interconnect_enable(struct dwc3_qcom *qcom)
 {
 	int ret;
@@ -737,11 +656,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
 	if (qcom->mode != USB_DR_MODE_HOST)
 		dwc3_qcom_vbus_override_enable(qcom, true);
 
-	/* register extcon to override sw_vbus on Vbus change later */
-	ret = dwc3_qcom_register_extcon(qcom);
-	if (ret)
-		goto interconnect_exit;
-
 	wakeup_source = of_property_read_bool(dev->of_node, "wakeup-source");
 	device_init_wakeup(&pdev->dev, wakeup_source);
 
@@ -749,8 +663,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
 
 	return 0;
 
-interconnect_exit:
-	dwc3_qcom_interconnect_exit(qcom);
 remove_core:
 	dwc3_core_remove(&qcom->dwc);
 clk_disable:
-- 
2.34.1
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Greg Kroah-Hartman 2 months, 3 weeks ago
On Mon, Jul 14, 2025 at 10:17:02AM +0530, Krishna Kurapati wrote:
> Deprecate usage of extcon functionality from the glue driver. Now
> that the glue driver is a flattened implementation, all existing
> DTs would eventually move to new bindings. While doing so let them
> make use of role-switch/ typec frameworks to provide role data
> rather than using extcon.

"Deprecate"?  Looks like you are just deleting all of this code, what is
going to break when this is removed?  Are there any in-kernel users of
it?

> On upstream, summary of targets/platforms using extcon is as follows:
> 
> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
> effect on them.

Ok, so those are fine, but:

> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
> driver which relies on id/vbus gpios to inform role changes. This can be
> transitioned to role switch based driver (usb-conn-gpio) while flattening
> those platforms to move away from extcon and rely on role
> switching.

When is that going to happen?  Where are those patches?

> 3. The one target that uses dwc3 controller and extcon and is not based
> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
> This platform uses TI chip to provide extcon. If usb on this platform is
> being flattneed, then effort should be put in to define a usb-c-connector
> device in DT and make use of role switch functionality in TUSB320L driver.

Again, when is that going to be changed?  We can't break in-kernel users
:(

thanks,

greg k-h
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Dmitry Baryshkov 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 07:47:20PM +0200, Greg Kroah-Hartman wrote:
> On Mon, Jul 14, 2025 at 10:17:02AM +0530, Krishna Kurapati wrote:
> > Deprecate usage of extcon functionality from the glue driver. Now
> > that the glue driver is a flattened implementation, all existing
> > DTs would eventually move to new bindings. While doing so let them
> > make use of role-switch/ typec frameworks to provide role data
> > rather than using extcon.
> 
> "Deprecate"?  Looks like you are just deleting all of this code, what is
> going to break when this is removed?  Are there any in-kernel users of
> it?
> 
> > On upstream, summary of targets/platforms using extcon is as follows:
> > 
> > 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
> > effect on them.
> 
> Ok, so those are fine, but:
> 
> > 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
> > driver which relies on id/vbus gpios to inform role changes. This can be
> > transitioned to role switch based driver (usb-conn-gpio) while flattening
> > those platforms to move away from extcon and rely on role
> > switching.
> 
> When is that going to happen?  Where are those patches?

This should be better explained in the commit message, I agree here.

Krishna, please point out that existing extcon platforms use legacy glue
driver (due to using legacy DT bindings), while this patch touches only
the new ("flattened") DWC3 driver.

> 
> > 3. The one target that uses dwc3 controller and extcon and is not based
> > on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
> > This platform uses TI chip to provide extcon. If usb on this platform is
> > being flattneed, then effort should be put in to define a usb-c-connector
> > device in DT and make use of role switch functionality in TUSB320L driver.
> 
> Again, when is that going to be changed?  We can't break in-kernel users
> :(
> 
> thanks,
> 
> greg k-h

-- 
With best wishes
Dmitry
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Krishna Kurapati 2 months, 3 weeks ago

On 7/15/2025 11:31 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 15, 2025 at 07:47:20PM +0200, Greg Kroah-Hartman wrote:
>> On Mon, Jul 14, 2025 at 10:17:02AM +0530, Krishna Kurapati wrote:
>>> Deprecate usage of extcon functionality from the glue driver. Now
>>> that the glue driver is a flattened implementation, all existing
>>> DTs would eventually move to new bindings. While doing so let them
>>> make use of role-switch/ typec frameworks to provide role data
>>> rather than using extcon.
>>

Hi Greg,

  Thanks for the comments. We wanted the users of these new bindings to 
start using role switch instead of extcon.

>> "Deprecate"?  Looks like you are just deleting all of this code, what is
>> going to break when this is removed?  Are there any in-kernel users of
>> it?

Currently, there are no in-kernel users of this new bindings using extcon.

>>
>>> On upstream, summary of targets/platforms using extcon is as follows:
>>>
>>> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
>>> effect on them.
>>
>> Ok, so those are fine, but:
>>
>>> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
>>> driver which relies on id/vbus gpios to inform role changes. This can be
>>> transitioned to role switch based driver (usb-conn-gpio) while flattening
>>> those platforms to move away from extcon and rely on role
>>> switching.
>>
>> When is that going to happen?  Where are those patches?
> 
> This should be better explained in the commit message, I agree here.
> 
> Krishna, please point out that existing extcon platforms use legacy glue
> driver (due to using legacy DT bindings), while this patch touches only
> the new ("flattened") DWC3 driver.
> 

Sure, will add it to commit message saying that there are no in-kernel 
extcon users of new bindings.

>>
>>> 3. The one target that uses dwc3 controller and extcon and is not based
>>> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
>>> This platform uses TI chip to provide extcon. If usb on this platform is
>>> being flattneed, then effort should be put in to define a usb-c-connector
>>> device in DT and make use of role switch functionality in TUSB320L driver.
>>
>> Again, when is that going to be changed?  We can't break in-kernel users
>> :(
>>

I think if someone is updating the bindings to flattened implementation, 
they need to use Type-C and role switching framework instead of extcon 
since this chip is a Typec port controller one.

Regards,
Krishna,
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Prashanth K 2 months, 3 weeks ago

On 7/14/2025 10:17 AM, Krishna Kurapati wrote:
> Deprecate usage of extcon functionality from the glue driver. Now
> that the glue driver is a flattened implementation, all existing
> DTs would eventually move to new bindings. While doing so let them
> make use of role-switch/ typec frameworks to provide role data
> rather than using extcon.
> 
> On upstream, summary of targets/platforms using extcon is as follows:
> 
> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
> effect on them.
> 
> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
> driver which relies on id/vbus gpios to inform role changes. This can be
> transitioned to role switch based driver (usb-conn-gpio) while flattening
> those platforms to move away from extcon and rely on role
> switching.
> 
> 3. The one target that uses dwc3 controller and extcon and is not based
> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
> This platform uses TI chip to provide extcon. If usb on this platform is
> being flattneed, then effort should be put in to define a usb-c-connector
> device in DT and make use of role switch functionality in TUSB320L driver.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
> Changes in v3:
> This change was 4rth patch in [1]. It was suggested to make this as the
> first patch of the series. Since this is independent of role switch
> patches, sending this out separately. Removed RB Tag of Dmitry since the
> patch has been changed.
> 
> [1]: https://lore.kernel.org/all/20250610091357.2983085-1-krishna.kurapati@oss.qualcomm.com/
> 
>  drivers/usb/dwc3/dwc3-qcom.c | 90 +-----------------------------------
>  1 file changed, 1 insertion(+), 89 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index ca7e1c02773a..a7eaefaeec4d 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -11,7 +11,6 @@
>  #include <linux/of_clk.h>
>  #include <linux/module.h>
>  #include <linux/kernel.h>
> -#include <linux/extcon.h>
>  #include <linux/interconnect.h>
>  #include <linux/platform_device.h>
>  #include <linux/phy/phy.h>
> @@ -79,11 +78,6 @@ struct dwc3_qcom {
>  	struct dwc3_qcom_port	ports[DWC3_QCOM_MAX_PORTS];
>  	u8			num_ports;
>  
> -	struct extcon_dev	*edev;
> -	struct extcon_dev	*host_edev;
> -	struct notifier_block	vbus_nb;
> -	struct notifier_block	host_nb;
> -
>  	enum usb_dr_mode	mode;
>  	bool			is_suspended;
>  	bool			pm_suspended;
> @@ -119,8 +113,7 @@ static inline void dwc3_qcom_clrbits(void __iomem *base, u32 offset, u32 val)
>  
>  /*
>   * TODO: Make the in-core role switching code invoke dwc3_qcom_vbus_override_enable(),
> - * validate that the in-core extcon support is functional, and drop extcon
> - * handling from the glue
> + * validate that the in-core extcon support is functional
>   */
>  static void dwc3_qcom_vbus_override_enable(struct dwc3_qcom *qcom, bool enable)
>  {
> @@ -137,80 +130,6 @@ static void dwc3_qcom_vbus_override_enable(struct dwc3_qcom *qcom, bool enable)
>  	}
>  }
>  
> -static int dwc3_qcom_vbus_notifier(struct notifier_block *nb,
> -				   unsigned long event, void *ptr)
> -{
> -	struct dwc3_qcom *qcom = container_of(nb, struct dwc3_qcom, vbus_nb);
> -
> -	/* enable vbus override for device mode */
> -	dwc3_qcom_vbus_override_enable(qcom, event);
> -	qcom->mode = event ? USB_DR_MODE_PERIPHERAL : USB_DR_MODE_HOST;
> -
> -	return NOTIFY_DONE;
> -}
> -
> -static int dwc3_qcom_host_notifier(struct notifier_block *nb,
> -				   unsigned long event, void *ptr)
> -{
> -	struct dwc3_qcom *qcom = container_of(nb, struct dwc3_qcom, host_nb);
> -
> -	/* disable vbus override in host mode */
> -	dwc3_qcom_vbus_override_enable(qcom, !event);
> -	qcom->mode = event ? USB_DR_MODE_HOST : USB_DR_MODE_PERIPHERAL;
> -
> -	return NOTIFY_DONE;
> -}
> -
> -static int dwc3_qcom_register_extcon(struct dwc3_qcom *qcom)
> -{
> -	struct device		*dev = qcom->dev;
> -	struct extcon_dev	*host_edev;
> -	int			ret;
> -
> -	if (!of_property_present(dev->of_node, "extcon"))
> -		return 0;
> -
> -	qcom->edev = extcon_get_edev_by_phandle(dev, 0);
> -	if (IS_ERR(qcom->edev))
> -		return dev_err_probe(dev, PTR_ERR(qcom->edev),
> -				     "Failed to get extcon\n");
> -
> -	qcom->vbus_nb.notifier_call = dwc3_qcom_vbus_notifier;
> -
> -	qcom->host_edev = extcon_get_edev_by_phandle(dev, 1);
> -	if (IS_ERR(qcom->host_edev))
> -		qcom->host_edev = NULL;
> -
> -	ret = devm_extcon_register_notifier(dev, qcom->edev, EXTCON_USB,
> -					    &qcom->vbus_nb);
> -	if (ret < 0) {
> -		dev_err(dev, "VBUS notifier register failed\n");
> -		return ret;
> -	}
> -
> -	if (qcom->host_edev)
> -		host_edev = qcom->host_edev;
> -	else
> -		host_edev = qcom->edev;
> -
> -	qcom->host_nb.notifier_call = dwc3_qcom_host_notifier;
> -	ret = devm_extcon_register_notifier(dev, host_edev, EXTCON_USB_HOST,
> -					    &qcom->host_nb);
> -	if (ret < 0) {
> -		dev_err(dev, "Host notifier register failed\n");
> -		return ret;
> -	}
> -
> -	/* Update initial VBUS override based on extcon state */
> -	if (extcon_get_state(qcom->edev, EXTCON_USB) ||
> -	    !extcon_get_state(host_edev, EXTCON_USB_HOST))
> -		dwc3_qcom_vbus_notifier(&qcom->vbus_nb, true, qcom->edev);
> -	else
> -		dwc3_qcom_vbus_notifier(&qcom->vbus_nb, false, qcom->edev);
> -
> -	return 0;
> -}
> -
>  static int dwc3_qcom_interconnect_enable(struct dwc3_qcom *qcom)
>  {
>  	int ret;
> @@ -737,11 +656,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  	if (qcom->mode != USB_DR_MODE_HOST)
>  		dwc3_qcom_vbus_override_enable(qcom, true);
>  
> -	/* register extcon to override sw_vbus on Vbus change later */
> -	ret = dwc3_qcom_register_extcon(qcom);
> -	if (ret)
> -		goto interconnect_exit;
> -
>  	wakeup_source = of_property_read_bool(dev->of_node, "wakeup-source");
>  	device_init_wakeup(&pdev->dev, wakeup_source);
>  
> @@ -749,8 +663,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  
>  	return 0;
>  
> -interconnect_exit:
> -	dwc3_qcom_interconnect_exit(qcom);
>  remove_core:
>  	dwc3_core_remove(&qcom->dwc);
>  clk_disable:

Shouldn't we cleanup the Kconfig also? Anyways it's not critical, so it
can be handled in a follow-up patch if preferred.

config USB_DWC3_QCOM
		tristate "Qualcomm Platform"
		depends on ARCH_QCOM || COMPILE_TEST
-		depends on EXTCON || !EXTCON
		depends on OF

Regards,
Prashanth K
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Prashanth K 2 months, 3 weeks ago

On 7/14/2025 8:59 PM, Prashanth K wrote:
> 
> 
> On 7/14/2025 10:17 AM, Krishna Kurapati wrote:
>> Deprecate usage of extcon functionality from the glue driver. Now
>> that the glue driver is a flattened implementation, all existing
>> DTs would eventually move to new bindings. While doing so let them
>> make use of role-switch/ typec frameworks to provide role data
>> rather than using extcon.
>>
>> On upstream, summary of targets/platforms using extcon is as follows:
>>
>> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
>> effect on them.
>>
>> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
>> driver which relies on id/vbus gpios to inform role changes. This can be
>> transitioned to role switch based driver (usb-conn-gpio) while flattening
>> those platforms to move away from extcon and rely on role
>> switching.
>>
>> 3. The one target that uses dwc3 controller and extcon and is not based
>> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
>> This platform uses TI chip to provide extcon. If usb on this platform is
>> being flattneed, then effort should be put in to define a usb-c-connector
>> device in DT and make use of role switch functionality in TUSB320L driver.
>>
>> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
>> ---
>> Changes in v3:
>> This change was 4rth patch in [1]. It was suggested to make this as the
>> first patch of the series. Since this is independent of role switch
>> patches, sending this out separately. Removed RB Tag of Dmitry since the
>> patch has been changed.
>>
>> [1]: https://lore.kernel.org/all/20250610091357.2983085-1-krishna.kurapati@oss.qualcomm.com/
>>
[...]
> 
> Shouldn't we cleanup the Kconfig also? Anyways it's not critical, so it
> can be handled in a follow-up patch if preferred.
> 
> config USB_DWC3_QCOM
> 		tristate "Qualcomm Platform"
> 		depends on ARCH_QCOM || COMPILE_TEST
> -		depends on EXTCON || !EXTCON
> 		depends on OF
> 

Ignore the above comment, both dwc3-qcom and dwc3-qcom-legacy uses same
config. Sorry for the spam!
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Dmitry Baryshkov 2 months, 3 weeks ago
On Mon, Jul 14, 2025 at 10:17:02AM +0530, Krishna Kurapati wrote:
> Deprecate usage of extcon functionality from the glue driver. Now
> that the glue driver is a flattened implementation, all existing
> DTs would eventually move to new bindings. While doing so let them
> make use of role-switch/ typec frameworks to provide role data
> rather than using extcon.
> 
> On upstream, summary of targets/platforms using extcon is as follows:
> 
> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
> effect on them.
> 
> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
> driver which relies on id/vbus gpios to inform role changes. This can be
> transitioned to role switch based driver (usb-conn-gpio) while flattening
> those platforms to move away from extcon and rely on role
> switching.
> 
> 3. The one target that uses dwc3 controller and extcon and is not based
> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
> This platform uses TI chip to provide extcon. If usb on this platform is
> being flattneed, then effort should be put in to define a usb-c-connector
> device in DT and make use of role switch functionality in TUSB320L driver.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
> Changes in v3:
> This change was 4rth patch in [1]. It was suggested to make this as the
> first patch of the series. Since this is independent of role switch
> patches, sending this out separately. Removed RB Tag of Dmitry since the
> patch has been changed.
> 
> [1]: https://lore.kernel.org/all/20250610091357.2983085-1-krishna.kurapati@oss.qualcomm.com/
> 
>  drivers/usb/dwc3/dwc3-qcom.c | 90 +-----------------------------------
>  1 file changed, 1 insertion(+), 89 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry
Re: [PATCH v3] usb: dwc3: qcom: Remove extcon functionality from glue
Posted by Konrad Dybcio 2 months, 3 weeks ago
On 7/14/25 6:47 AM, Krishna Kurapati wrote:
> Deprecate usage of extcon functionality from the glue driver. Now
> that the glue driver is a flattened implementation, all existing
> DTs would eventually move to new bindings. While doing so let them
> make use of role-switch/ typec frameworks to provide role data
> rather than using extcon.
> 
> On upstream, summary of targets/platforms using extcon is as follows:
> 
> 1. MSM8916 and MSM8939 use Chipidea controller, hence the changes have no
> effect on them.
> 
> 2. Of the other extcon users, most of them use "linux,extcon-usb-gpio"
> driver which relies on id/vbus gpios to inform role changes. This can be
> transitioned to role switch based driver (usb-conn-gpio) while flattening
> those platforms to move away from extcon and rely on role
> switching.
> 
> 3. The one target that uses dwc3 controller and extcon and is not based
> on reading gpios is "arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi".
> This platform uses TI chip to provide extcon. If usb on this platform is
> being flattneed, then effort should be put in to define a usb-c-connector
> device in DT and make use of role switch functionality in TUSB320L driver.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad