summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/usbmisc_imx.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-07-28 08:12:11 +0200
committerPeter Chen <peter.chen@nxp.com>2020-07-28 08:12:11 +0200
commitd6f93d21001e4388a25b0b922e02e64bc6004d2f (patch)
tree2e15ef155f5cd2ffadbb958bcb0b2efd8bba9ef3 /drivers/usb/chipidea/usbmisc_imx.c
parentusb: chipidea: add query_available_role interface (diff)
downloadlinux-d6f93d21001e4388a25b0b922e02e64bc6004d2f.tar.xz
linux-d6f93d21001e4388a25b0b922e02e64bc6004d2f.zip
usb: chipidea: imx: get available runtime dr mode for wakeup setting
If runtime dr_mode is not dual-role, it doesn't need to enable ID wakeup interrupt. If runtime dr_mode is host, it doesn't need to enable VBUS wakeup interrupt. With these changes, the user will not get the unexpected wakeup for single role use case. For example, the host-only use case at Micro-AB port, the controller should not be waken up by only plug in Micro-AB cable or the Micro-B cable with host. Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/usbmisc_imx.c')
-rw-r--r--drivers/usb/chipidea/usbmisc_imx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index f136876cb4a3..ae8f0f37e799 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -367,10 +367,10 @@ static u32 usbmisc_wakeup_setting(struct imx_usbmisc_data *data)
{
u32 wakeup_setting = MX6_USB_OTG_WAKEUP_BITS;
- if (data->ext_id)
+ if (data->ext_id || data->available_role != USB_DR_MODE_OTG)
wakeup_setting &= ~MX6_BM_ID_WAKEUP;
- if (data->ext_vbus)
+ if (data->ext_vbus || data->available_role == USB_DR_MODE_HOST)
wakeup_setting &= ~MX6_BM_VBUS_WAKEUP;
return wakeup_setting;