diff options
author | Michael Trimarchi <michael@amarulasolutions.com> | 2018-03-29 17:52:46 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-29 12:03:01 +0200 |
commit | 26250d540d2baf32e265e9e6df120b9be5962587 (patch) | |
tree | e9cfee823e7304733c6c766253e58c9807134267 /drivers/usb | |
parent | 9618d0934980c4b0d8d4b455ef10ba6b435e52c8 (diff) | |
download | linux-26250d540d2baf32e265e9e6df120b9be5962587.tar.gz linux-26250d540d2baf32e265e9e6df120b9be5962587.tar.bz2 linux-26250d540d2baf32e265e9e6df120b9be5962587.zip |
usb: chipidea: usbmisc: evdo can be set e/o reset
evdo bit can be set or reset. We can not trust evdo bit
status after bootloader stage
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index a52f5a86f177..1f47ef625069 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -151,14 +151,18 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data) if (data->index) return 0; - if (data->evdo) { - spin_lock_irqsave(&usbmisc->lock, flags); - reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET; - val = readl(reg); - writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg); - spin_unlock_irqrestore(&usbmisc->lock, flags); - usleep_range(5000, 10000); /* needed to stabilize voltage */ - } + spin_lock_irqsave(&usbmisc->lock, flags); + reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET; + val = readl(reg); + + if (data->evdo) + val |= MX25_BM_EXTERNAL_VBUS_DIVIDER; + else + val &= ~MX25_BM_EXTERNAL_VBUS_DIVIDER; + + writel(val, reg); + spin_unlock_irqrestore(&usbmisc->lock, flags); + usleep_range(5000, 10000); /* needed to stabilize voltage */ return 0; } |