summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-05-05 16:35:37 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2015-05-08 17:26:52 +0800
commit3d776f415838b3a216fb9ef591bd1589158bc5c8 (patch)
tree151726d69b2fc2da0d614085a4adfe0958a3948b
parent2a09acfb950a98e7e5779230938dc851f3120b8e (diff)
MLK-10823 usb: chipidea: imx: set b_sess_valid as wakeup source for imx7dl5.1.0_2.0.0_7d-alpha
In some situations, we need vbus level which lower than vbus valid as wakeup source, eg, at the OTG certification test, the valid bus level for b device is from 4.0v to 6.0v. Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r--drivers/usb/chipidea/usbmisc_imx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 0dfd9f36c35c..9f8faf8c08cf 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -90,6 +90,14 @@
#define ANADIG_ANA_MISC0_SET 0x154
#define ANADIG_ANA_MISC0_CLK_DELAY(x) ((x >> 26) & 0x7)
+#define MX7D_USBNC_USB_CTRL2 0x4
+#define MX7D_USB_VBUS_WAKEUP_SOURCE_MASK 0x3
+#define MX7D_USB_VBUS_WAKEUP_SOURCE(v) (v << 0)
+#define MX7D_USB_VBUS_WAKEUP_SOURCE_VBUS MX7D_USB_VBUS_WAKEUP_SOURCE(0)
+#define MX7D_USB_VBUS_WAKEUP_SOURCE_AVALID MX7D_USB_VBUS_WAKEUP_SOURCE(1)
+#define MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID MX7D_USB_VBUS_WAKEUP_SOURCE(2)
+#define MX7D_USB_VBUS_WAKEUP_SOURCE_SESS_END MX7D_USB_VBUS_WAKEUP_SOURCE(3)
+
struct usbmisc_ops {
/* It's called once when probe a usb device */
int (*init)(struct imx_usbmisc_data *data);
@@ -496,6 +504,10 @@ static int usbmisc_imx7d_init(struct imx_usbmisc_data *data)
reg = readl(usbmisc->base);
writel(reg | MX6_BM_UNBURST_SETTING, usbmisc->base);
+ reg = readl(usbmisc->base + MX7D_USBNC_USB_CTRL2);
+ reg &= ~MX7D_USB_VBUS_WAKEUP_SOURCE_MASK;
+ writel(reg | MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID,
+ usbmisc->base + MX7D_USBNC_USB_CTRL2);
spin_unlock_irqrestore(&usbmisc->lock, flags);
usbmisc_imx7d_set_wakeup(data, false);