From 2e5f4dd444ae1a553ad79ba59c5e94ef5dc6150f Mon Sep 17 00:00:00 2001 From: Qi Duan Date: Fri, 1 Sep 2017 14:52:16 +0800 Subject: [PATCH] USB: don't set softdisconnect when suspend PD#148350: USB: don't set softdisconnect when suspend. [1/1] Change-Id: I037d951f23c6d5c606af64f8c1b5550246256d79 Signed-off-by: Qi Duan --- drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c index 812c5df..b6dab6a 100644 --- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c +++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c @@ -895,16 +895,20 @@ static void usb_early_suspend(struct early_suspend *h) dwc_otg_device = (dwc_otg_device_t *)h->param; is_mount = get_pcd_ums_state(dwc_otg_device->pcd); DWC_DEBUG("DWC_OTG: going early suspend! is_mount=%d\n", is_mount); + if (dwc_otg_device->core_if->controller_type == 0) { if (dwc_otg_is_device_mode(dwc_otg_device->core_if) && !is_mount) DWC_MODIFY_REG32(&dwc_otg_device->core_if->dev_if->dev_global_regs->dctl, 0, 2); + } } static void usb_early_resume(struct early_suspend *h) { dwc_otg_device_t *dwc_otg_device; DWC_DEBUG("DWC_OTG: going early resume\n"); dwc_otg_device = (dwc_otg_device_t *)h->param; + if (dwc_otg_device->core_if->controller_type == 0) { if (dwc_otg_is_device_mode(dwc_otg_device->core_if)) DWC_MODIFY_REG32(&dwc_otg_device->core_if->dev_if->dev_global_regs->dctl, 2, 0); + } } #endif static const struct of_device_id dwc_otg_dt_match[] = { -- 2.7.4