summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorAlexandre Bailon <abailon@baylibre.com>2016-11-21 08:59:31 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-21 17:35:37 +0100
commit7ccf62941a38701ec9a42b4a0fa2868af456e96a (patch)
treef749226b53db354e6a7578b9da0359c5c8ee2abb /drivers/usb/musb
parent09721ba6daa19e75446bac463acf9c28e8ed9acc (diff)
downloadlinux-7ccf62941a38701ec9a42b4a0fa2868af456e96a.tar.bz2
usb: musb: da8xx: Set phy in OTG mode by default
The DA8xx OTG PHY has some issues when it is forced in host or peripheral mode. Actually, most of the time, OTG is the best mode because host or peripheral mode are only required for hardware that miss some circuitry. Init the PHY mode OTG mode by default. Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/da8xx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 373b61786fe0..e89708d839e5 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -343,6 +343,13 @@ static int da8xx_musb_set_mode(struct musb *musb, u8 musb_mode)
struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent);
enum phy_mode phy_mode;
+ /*
+ * The PHY has some issues when it is forced in device or host mode.
+ * Unless the user request another mode, configure the PHY in OTG mode.
+ */
+ if (!musb->is_initialized)
+ return phy_set_mode(glue->phy, PHY_MODE_USB_OTG);
+
switch (musb_mode) {
case MUSB_HOST: /* Force VBUS valid, ID = 0 */
phy_mode = PHY_MODE_USB_HOST;