diff mbox series

[1/5] usb: cdns3: core: quit if it uses role switch class

Message ID 20200901023352.25552-2-peter.chen@nxp.com
State New
Headers show
Series usb: cdns3: misc improvements | expand

Commit Message

Peter Chen Sept. 1, 2020, 2:33 a.m. UTC
If the board uses role switch class for switching the role, it should
not depends on SoC OTG hardware siginal any more, so quit early.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/cdns3/core.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Roger Quadros Nov. 23, 2020, 11:17 a.m. UTC | #1
Peter/Felipe,

On 01/09/2020 05:33, Peter Chen wrote:
> If the board uses role switch class for switching the role, it should

> not depends on SoC OTG hardware siginal any more, so quit early.

> 

> Signed-off-by: Peter Chen <peter.chen@nxp.com>

> ---

>   drivers/usb/cdns3/core.c | 4 ++++

>   1 file changed, 4 insertions(+)

> 

> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c

> index faee5ec5fc20..96c2da4e20c5 100644

> --- a/drivers/usb/cdns3/core.c

> +++ b/drivers/usb/cdns3/core.c

> @@ -280,6 +280,10 @@ int cdns3_hw_role_switch(struct cdns3 *cdns)

>   	enum usb_role real_role, current_role;

>   	int ret = 0;

>   

> +	/* Depends on role switch class */

> +	if (cdns->role_sw)

> +		return 0;

> +


This breaks h/w based role switching for us.

cdsn->role_sw would always be non zero, right, which means h/w based role swithching
will be bypassed for all platforms.

>   	pm_runtime_get_sync(cdns->dev);

>   

>   	current_role = cdns->role;

> 


cheers,
-roger
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index faee5ec5fc20..96c2da4e20c5 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -280,6 +280,10 @@  int cdns3_hw_role_switch(struct cdns3 *cdns)
 	enum usb_role real_role, current_role;
 	int ret = 0;
 
+	/* Depends on role switch class */
+	if (cdns->role_sw)
+		return 0;
+
 	pm_runtime_get_sync(cdns->dev);
 
 	current_role = cdns->role;