linux/drivers/usb
William Wu 51216a597d usb: dwc3: core: init current_dr_role in async probe
During dwc3 probe, it init the current_dr_role in drd_work,
and it must make sure that the current_dr_role is initialized
to DWC3_GCTL_PRTCAP_DEVICE or DWC3_GCTL_PRTCAP_HOST if it
support dule role mode before do async probe.

However, the drd_work and dwc3_rockchip_async_probe are handled
asynchronously, if the drd_work is handled prior to async probe,
it may fail to call dwc3_core_exit from dwc3_runtime_suspend in
async probe because of uninitialized current_dr_role. If this case
happens, the USB 2.0/3.0 PHY power on/off operations are unbalanced.

This patch get the extcon state before do runtime suspend in async
probe, and init the current_dr_role according to the extcon state.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I4d1f7683d3ef3c5580f35be52d28821c47f6457f
2021-03-05 19:15:17 +08:00
..
atm
c67x00 USB: c67x00: fix use after free in c67x00_giveback_urb 2020-07-22 09:32:08 +02:00
chipidea Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
class Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
common ANDROID: GKI: Add dual role mode to usb_dr_modes array 2020-04-23 00:35:46 +00:00
core Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
dwc2 Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
dwc3 usb: dwc3: core: init current_dr_role in async probe 2021-03-05 19:15:17 +08:00
early USB: early: Handle AMD's spec-compliant identifiers, too 2020-04-29 16:31:26 +02:00
gadget Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
host Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
image
isp1760
misc Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
mon
mtu3 Merge tag 'ASB-2020-12-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-12-29 16:10:48 +08:00
musb Merge tag 'ASB-2020-09-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-09-24 17:59:50 +08:00
phy
renesas_usbhs
roles
serial Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
storage Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
typec Merge tag 'ASB-2020-12-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-12-29 16:10:48 +08:00
usbip Merge tag 'ASB-2021-02-05_4.19-stable' of https://android.googlesource.com/kernel/common 2021-02-26 15:30:04 +08:00
wusbcore
Kconfig
Makefile
README
usb-skeleton.c

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.