From: Vignesh R <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/3] ubs: xhci-dwc3: Enable USB3 PHY when available
Date: Wed, 7 Mar 2018 14:50:10 +0530 [thread overview]
Message-ID: <20180307092010.7091-4-vigneshr@ti.com> (raw)
In-Reply-To: <20180307092010.7091-1-vigneshr@ti.com>
DWC3 USB3 controllers will need USB3 PHY to be enabled, in addition to
USB2 PHY, to be functional. Therefore enable USB3 PHY when available.
Signed-off-by: Vignesh R <vigneshr@ti.com>
---
drivers/usb/host/xhci-dwc3.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index e61a04eeb8a8..1022dd551241 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -23,6 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
struct xhci_dwc3_platdata {
struct phy usb_phy;
+ struct phy usb3_phy;
};
void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
@@ -175,6 +176,13 @@ static int xhci_dwc3_probe(struct udevice *dev)
return ret;
}
+ ret = xhci_dwc3_setup_phy(dev, 1, &plat->usb3_phy);
+ if (ret) {
+ pr_err("Failed to setup USB3 PHY for %s\n", dev->name);
+ xhci_dwc3_shutdown_phy(&plat->usb_phy);
+ return ret;
+ }
+
dwc3_reg = (struct dwc3 *)((char *)(hccr) + DWC3_REG_OFFSET);
dwc3_core_init(dwc3_reg);
@@ -198,6 +206,9 @@ static int xhci_dwc3_remove(struct udevice *dev)
if (ret)
pr_err("Can't shutdown USB PHY for %s\n", dev->name);
+ ret = xhci_dwc3_shutdown_phy(&plat->usb3_phy);
+ if (ret)
+ pr_err("Can't shutdown USB3 PHY for %s\n", dev->name);
return xhci_deregister(dev);
}
--
2.16.2
next prev parent reply other threads:[~2018-03-07 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 9:20 [U-Boot] [PATCH v2 0/3] xhci-dwc3: Couple of fixes for USB3 support Vignesh R
2018-03-07 9:20 ` [U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using Vignesh R
2018-03-17 2:19 ` Marek Vasut
2018-03-07 9:20 ` [U-Boot] [PATCH v2 2/3] usb: xhci-dwc3: Refractor PHY operations into separate function Vignesh R
2018-03-08 4:14 ` Bin Meng
2018-03-07 9:20 ` Vignesh R [this message]
2018-03-08 4:14 ` [U-Boot] [PATCH v2 3/3] ubs: xhci-dwc3: Enable USB3 PHY when available Bin Meng
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=20180307092010.7091-4-vigneshr@ti.com \
--to=vigneshr@ti.com \
--cc=u-boot@lists.denx.de \
/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