From 03674e9bd8d83674e9b30e62885d184f82c75a5e Mon Sep 17 00:00:00 2001 From: William Wu Date: Mon, 8 Apr 2019 11:26:23 +0800 Subject: [PATCH] usb: dwc3: add rockchip specific glue layer Add rockchip specific glue layer to support USB3 Peripheral mode and Host mode on rockchip platforms (e.g. rk3399). The DesignWare USB3 integrated in rockchip SoCs is a configurable IP Core which can be instantiated as Dual-Role Device (DRD), Host Only (XHCI) and Peripheral Only configurations. We use extcon notifier to manage usb cable detection and mode switch. Enable DWC3 PM runtime auto suspend to allow core enter runtime_suspend if USB cable is dettached. For host mode, it requires to keep whole DWC3 controller in reset state to hold pipe power state in P2 before initializing PHY. And it need to reconfigure USB PHY interface of DWC3 core after deassert DWC3 controller reset. The current driver supports Host only and Peripheral Only well, for now, we will add support for OTG after we have it all stabilized. Change-Id: I821dd19eedec73e6517f0cca184f939a9f313904 Signed-off-by: William Wu --- drivers/usb/dwc3/Kconfig | 8 ++++++++ drivers/usb/dwc3/Makefile | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 518ead12458d..8cabf5867700 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -102,6 +102,14 @@ config USB_DWC3_OF_SIMPLE Currently supports Xilinx and Qualcomm DWC USB3 IP. Say 'Y' or 'M' if you have one such device. +config USB_DWC3_ROCKCHIP + tristate "Rockchip Platforms" + depends on EXTCON && (ARCH_ROCKCHIP || COMPILE_TEST) + depends on OF + default USB_DWC3 + help + Support of USB2/3 functionality in Rockchip + config USB_DWC3_ST tristate "STMicroelectronics Platforms" depends on (ARCH_STI || COMPILE_TEST) && OF diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile index 6e3ef6144e5d..3b987712310b 100644 --- a/drivers/usb/dwc3/Makefile +++ b/drivers/usb/dwc3/Makefile @@ -48,5 +48,6 @@ obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o obj-$(CONFIG_USB_DWC3_HAPS) += dwc3-haps.o obj-$(CONFIG_USB_DWC3_KEYSTONE) += dwc3-keystone.o obj-$(CONFIG_USB_DWC3_OF_SIMPLE) += dwc3-of-simple.o +obj-$(CONFIG_USB_DWC3_ROCKCHIP) += dwc3-rockchip.o obj-$(CONFIG_USB_DWC3_ST) += dwc3-st.o obj-$(CONFIG_USB_DWC3_QCOM) += dwc3-qcom.o