From: Ran Wang <ran.wang_1@nxp.com>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Felipe Balbi <balbi@kernel.org>
Cc: robh+dt@kernel.org, mark.rutland@arm.com, kishon@ti.com,
catalin.marinas@arm.com, will.deacon@arm.com,
stern@rowland.harvard.edu, pku.leo@gmail.com,
mathias.nyman@intel.com, gregkh@linuxfoundation.org,
suresh.gupta@nxp.com, felipe.balbi@linux.intel.com,
Shawn Guo <shawnguo@kernel.org>,
Sriram Dash <sriram.dash@nxp.com>, Li Yang <leoyang.li@nxp.com>,
Hongtao Jia <hongtao.jia@nxp.com>, Ran Wang <ran.wang_1@nxp.com>
Subject: [PATCH v2 3/3] usb: dwc3: Enable USB 3.0 phy driver
Date: Tue, 7 Nov 2017 15:20:55 +0800 [thread overview]
Message-ID: <20171107072055.26945-3-ran.wang_1@nxp.com> (raw)
In-Reply-To: <20171107072055.26945-1-ran.wang_1@nxp.com>
Adds entry point at dwc3 core init function to enable
USB 3.0 PHY driver.
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
Change in v2:
- New file
drivers/usb/dwc3/core.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 03474d3575ab..a9df03c64a7b 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -746,6 +746,8 @@ static int dwc3_core_init(struct dwc3 *dwc)
{
u32 reg;
int ret;
+ int retval;
+ struct phy *phy;
if (!dwc3_core_is_valid(dwc)) {
dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n");
@@ -770,6 +772,19 @@ static int dwc3_core_init(struct dwc3 *dwc)
if (ret)
goto err0;
+ phy = phy_get(dwc->dev, "usb-phy");
+ if (IS_ERR(phy)) {
+ retval = PTR_ERR(phy);
+ if (retval == -EPROBE_DEFER)
+ dev_dbg(dwc->dev, "usb-phy no found\n");
+ } else {
+ retval = phy_init(phy);
+ if (retval) {
+ phy_put(phy);
+ dev_dbg(dwc->dev, "phy_init() error!\n");
+ }
+ }
+
ret = dwc3_core_soft_reset(dwc);
if (ret)
goto err0;
--
2.14.1
next prev parent reply other threads:[~2017-11-07 7:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 7:20 [PATCH v2 1/3] drivers: usb: phy: Add qoriq usb 3.0 phy driver support Ran Wang
2017-11-07 7:20 ` [PATCH v2 2/3] arm64: dts: ls1043a: Enable USB 3.0 phy driver Ran Wang
2017-11-07 7:20 ` Ran Wang [this message]
2017-11-07 8:24 ` [PATCH v2 3/3] usb: dwc3: " Felipe Balbi
2017-11-10 21:19 ` [PATCH v2 1/3] drivers: usb: phy: Add qoriq usb 3.0 phy driver support Rob Herring
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=20171107072055.26945-3-ran.wang_1@nxp.com \
--to=ran.wang_1@nxp.com \
--cc=balbi@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hongtao.jia@nxp.com \
--cc=kishon@ti.com \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathias.nyman@intel.com \
--cc=pku.leo@gmail.com \
--cc=robh+dt@kernel.org \
--cc=shawnguo@kernel.org \
--cc=sriram.dash@nxp.com \
--cc=stern@rowland.harvard.edu \
--cc=suresh.gupta@nxp.com \
--cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).