From 2ba314cca660ebc12644c2763527c0ecc8474bca Mon Sep 17 00:00:00 2001 From: William Wu Date: Fri, 19 Oct 2018 10:46:27 +0800 Subject: [PATCH] usb: dwc3: rockchip: fix usb reenumerated upon pm resume On rk3399 platforms, Type-c1 can be simplified to Type-A port and support USB 3.0 Host only mode. It has a problem that the dwc3_rockchip_resume() will reset the controller upon pm resume, and this may cause usb device(e.g. usb 4G modem) to be reenumerated. This patch sets the flag of connected to true and avoid to do the reset operation upon pm resume. Change-Id: I57f92d0277a19ce1c7b881fe2da6470fd3a70b73 Signed-off-by: William Wu --- drivers/usb/dwc3/dwc3-rockchip.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index db482d37df56..3d3b5774b9bb 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -836,6 +836,15 @@ static int dwc3_rockchip_probe(struct platform_device *pdev) (extcon_get_cable_state_(rockchip->edev, EXTCON_USB_HOST) > 0)) schedule_work(&rockchip->otg_work); + } else { + /* + * DWC3 work as Host only mode or Peripheral + * only mode, set connected flag to true, it + * can avoid to reset the DWC3 controller when + * resume from PM suspend which may cause the + * usb device to be reenumerated. + */ + rockchip->connected = true; } dwc3_rockchip_debugfs_init(rockchip);