mbox series

[v2,0/4] usb: dwc3: dual-role support

Message ID 1487250377-13653-1-git-send-email-rogerq@ti.com
Headers show
Series usb: dwc3: dual-role support | expand

Message

Roger Quadros Feb. 16, 2017, 1:06 p.m. UTC
Hi,

We rely on the OTG controller block or Extcon to provide us with
VBUS and ID line status via an interrupt.

This is then used to switch the controller between host, peripheral
and idle roles based on the following table.

    ID  VBUS    dual-role state
    --  ----    ---------------
    0   x       A_HOST - Host controller active
    1   0       B_IDLE - Both Host and Gadget controllers inactive
    1   1       B_PERIPHERAL - Gadget controller active

Series depends on
[1] dwc3 trivial fixes - https://lkml.org/lkml/2017/2/15/204

Changelog:
v2:
- Use extcon device for VBUS/ID events if extcon phandle is present.
- Fix bugs during system suspend/resume.

cheers,
-roger

Roger Quadros (4):
  usb: dwc3: core.h: add some register definitions
  usb: dwc3: omap: don't miss events during suspend/resume
  usb: dwc3: add dual-role support
  usb: dwc3: Workaround for super-speed host on dra7 in dual-role mode

 Documentation/devicetree/bindings/usb/dwc3.txt |   2 +
 drivers/usb/dwc3/core.c                        | 752 ++++++++++++++++++++++++-
 drivers/usb/dwc3/core.h                        | 131 ++++-
 drivers/usb/dwc3/dwc3-omap.c                   |  16 +
 drivers/usb/dwc3/gadget.c                      |  18 +-
 5 files changed, 895 insertions(+), 24 deletions(-)

-- 
2.7.4

Comments

Roger Quadros March 13, 2017, 8:33 a.m. UTC | #1
Felipe,

On 16/02/17 15:06, Roger Quadros wrote:
> Hi,

> 

> We rely on the OTG controller block or Extcon to provide us with

> VBUS and ID line status via an interrupt.

> 

> This is then used to switch the controller between host, peripheral

> and idle roles based on the following table.

> 

>     ID  VBUS    dual-role state

>     --  ----    ---------------

>     0   x       A_HOST - Host controller active

>     1   0       B_IDLE - Both Host and Gadget controllers inactive

>     1   1       B_PERIPHERAL - Gadget controller active

> 

> Series depends on

> [1] dwc3 trivial fixes - https://lkml.org/lkml/2017/2/15/204


Would appreciate any feedback on this series. Thanks.

> 

> Changelog:

> v2:

> - Use extcon device for VBUS/ID events if extcon phandle is present.

> - Fix bugs during system suspend/resume.

> 

> cheers,

> -roger

> 

> Roger Quadros (4):

>   usb: dwc3: core.h: add some register definitions

>   usb: dwc3: omap: don't miss events during suspend/resume

>   usb: dwc3: add dual-role support

>   usb: dwc3: Workaround for super-speed host on dra7 in dual-role mode

> 

>  Documentation/devicetree/bindings/usb/dwc3.txt |   2 +

>  drivers/usb/dwc3/core.c                        | 752 ++++++++++++++++++++++++-

>  drivers/usb/dwc3/core.h                        | 131 ++++-

>  drivers/usb/dwc3/dwc3-omap.c                   |  16 +

>  drivers/usb/dwc3/gadget.c                      |  18 +-

>  5 files changed, 895 insertions(+), 24 deletions(-)

> 


-- 
cheers,
-roger
Felipe Balbi March 28, 2017, 10:27 a.m. UTC | #2
Roger Quadros <rogerq@ti.com> writes:

> Hi,

>

> We rely on the OTG controller block or Extcon to provide us with

> VBUS and ID line status via an interrupt.

>

> This is then used to switch the controller between host, peripheral

> and idle roles based on the following table.

>

>     ID  VBUS    dual-role state

>     --  ----    ---------------

>     0   x       A_HOST - Host controller active

>     1   0       B_IDLE - Both Host and Gadget controllers inactive

>     1   1       B_PERIPHERAL - Gadget controller active

>

> Series depends on

> [1] dwc3 trivial fixes - https://lkml.org/lkml/2017/2/15/204


right, you never sent v2 of that though, did you? :-s -ECONFUSED

-- 
balbi
Roger Quadros March 29, 2017, 9:50 a.m. UTC | #3
Hi,

On 28/03/17 13:27, Felipe Balbi wrote:
> Roger Quadros <rogerq@ti.com> writes:

> 

>> Hi,

>>

>> We rely on the OTG controller block or Extcon to provide us with

>> VBUS and ID line status via an interrupt.

>>

>> This is then used to switch the controller between host, peripheral

>> and idle roles based on the following table.

>>

>>     ID  VBUS    dual-role state

>>     --  ----    ---------------

>>     0   x       A_HOST - Host controller active

>>     1   0       B_IDLE - Both Host and Gadget controllers inactive

>>     1   1       B_PERIPHERAL - Gadget controller active

>>

>> Series depends on

>> [1] dwc3 trivial fixes - https://lkml.org/lkml/2017/2/15/204

> 

> right, you never sent v2 of that though, did you? :-s -ECONFUSED

> 


In that series, the 1st patch is already picked up for v4.11-rc.
I sent a v2 of the second patch but it seems it didn't apply cleanly.
https://lkml.org/lkml/2017/2/16/168

I'll send the last 2 patches again based off v4.11-rc4.

cheers,
-roger