lkml.org 
[lkml]   [2016]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 4/4] usb: musb: da8xx: Set phy in OTG mode by default
Date
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>
---
drivers/usb/musb/da8xx.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 6749aa1..e6f41232 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -401,6 +401,12 @@ static int da8xx_musb_init(struct musb *musb)
goto err_phy_power_on;
}

+ ret = phy_set_mode(glue->phy, PHY_MODE_USB_OTG);
+ if (ret) {
+ dev_err(glue->dev, "Failed to set the phy mode.\n");
+ goto err_phy_set_mode;
+ }
+
msleep(5);

/* NOTE: IRQs are in mixed mode, not bypass to pure MUSB */
@@ -410,6 +416,8 @@ static int da8xx_musb_init(struct musb *musb)
musb->isr = da8xx_musb_interrupt;
return 0;

+err_phy_set_mode:
+ phy_power_off(glue->phy);
err_phy_power_on:
phy_exit(glue->phy);
fail:
@@ -433,7 +441,7 @@ static int da8xx_musb_exit(struct musb *musb)
}

static const struct musb_platform_ops da8xx_ops = {
- .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP,
+ .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP | MUSB_SKIP_SET_MODE,
.init = da8xx_musb_init,
.exit = da8xx_musb_exit,

--
2.7.3
\
 
 \ /
  Last update: 2016-11-04 17:45    [W:0.060 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site