usb: dwc3: core: support DRD mode switch with extcon notifier
authorWu Liang feng <wulf@rock-chips.com>
Thu, 14 Jul 2016 02:32:19 +0000 (10:32 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Wed, 3 Aug 2016 08:00:27 +0000 (16:00 +0800)
commit26ecf99bd66fe915083fb69c7c20b9b9b67d38f0
tree3235b5470c448ffceb9a934f77cd93638f83af7d
parent539dcb44cfcf3a8d0cad95b3df76366b81c9b46a
usb: dwc3: core: support DRD mode switch with extcon notifier

This patch register extcon notification for DRD mode.
If extcon cable state is EXTCON_USB, means that an USB
peripheral cable connected, and we need to set DWC3 work
in device mode. If extcon cable state is EXTCON_USB_HOST,
means that an USB host cable connected, and we need to
set DWC3 work in host mode.

And we need to register different notifier block for
EXTCON_USB notifier and EXTCON_USB_HOST notifier,because
if multiple notifiers registered with the same notifier
block, it will cause kernel crash on notification events.

Change-Id: Ia09e5088f738496b87d06b0f4062c144fa781e4e
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c