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 <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2018-10-19 10:46:27 +08:00
committed by Tao Huang
parent e283ecf388
commit 2ba314cca6

View File

@@ -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);