From: Alexandre Bailon <abailon@baylibre.com>
To: david@lechnology.com, b-liu@ti.com, balbi@kernel.org
Cc: kishon@ti.com, khilman@baylibre.com,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
nsekhar@ti.com, Alexandre Bailon <abailon@baylibre.com>
Subject: [PATCH v4 4/4] usb: musb: da8xx: Set phy in OTG mode by default
Date: Fri, 4 Nov 2016 17:43:38 +0100 [thread overview]
Message-ID: <1478277818-5091-5-git-send-email-abailon@baylibre.com> (raw)
In-Reply-To: <1478277818-5091-1-git-send-email-abailon@baylibre.com>
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
prev parent reply other threads:[~2016-11-04 16:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 16:43 [PATCH v4 0/4] usb: musb: da8xx: Fix few issues Alexandre Bailon
2016-11-04 16:43 ` [PATCH v4 1/4] usb: musb: da8xx: Call earlier clk_prepare_enable() Alexandre Bailon
2016-11-04 16:43 ` [PATCH v4 2/4] phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaround Alexandre Bailon
2016-11-04 16:43 ` [PATCH v4 3/4] usb: musb: Add a quirk flag to skip the phy set mode Alexandre Bailon
2016-11-04 18:51 ` David Lechner
2016-11-04 20:20 ` Sergei Shtylyov
2016-11-04 16:43 ` Alexandre Bailon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478277818-5091-5-git-send-email-abailon@baylibre.com \
--to=abailon@baylibre.com \
--cc=b-liu@ti.com \
--cc=balbi@kernel.org \
--cc=david@lechnology.com \
--cc=khilman@baylibre.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nsekhar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®