From: Kishon Vijay Abraham I <kishon@ti.com>
To: <bcousson@baylibre.com>, <balbi@ti.com>,
<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-usb@vger.kernel.org>, <george.cherian@ti.com>,
<heikki.krogerus@linux.intel.com>, <rogerq@ti.com>
Cc: <rob.herring@calxeda.com>, <pawel.moll@arm.com>,
<mark.rutland@arm.com>, <swarren@wwwdotorg.org>,
<ijc+devicetree@hellion.org.uk>, <rob@landley.net>,
<tony@atomide.com>, <linux@arm.linux.org.uk>, <kishon@ti.com>,
<gregkh@linuxfoundation.org>, <grant.likely@linaro.org>,
<s.nawrocki@samsung.com>, <galak@codeaurora.org>
Subject: [PATCH v5 1/6] usb: dwc3: core: support optional PHYs
Date: Mon, 3 Mar 2014 17:08:10 +0530 [thread overview]
Message-ID: <1393846695-14644-2-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1393846695-14644-1-git-send-email-kishon@ti.com>
Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3
should be programmed), do not return from probe if the USB PHY library
returns -ENODEV as that indicates the platform does not have a
programmable PHY.
While this can be considered as a temporary fix, a long term solution
would be to add 'nop' PHY for platforms that does not have programmable
PHY.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
---
drivers/usb/dwc3/core.c | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7d0cb34..225a4d6 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -529,32 +529,26 @@ static int dwc3_probe(struct platform_device *pdev)
if (IS_ERR(dwc->usb2_phy)) {
ret = PTR_ERR(dwc->usb2_phy);
-
- /*
- * if -ENXIO is returned, it means PHY layer wasn't
- * enabled, so it makes no sense to return -EPROBE_DEFER
- * in that case, since no PHY driver will ever probe.
- */
- if (ret == -ENXIO)
+ if (ret == -ENXIO || ret == -ENODEV) {
+ dwc->usb2_phy = NULL;
+ } else if (ret == -EPROBE_DEFER) {
return ret;
-
- dev_err(dev, "no usb2 phy configured\n");
- return -EPROBE_DEFER;
+ } else {
+ dev_err(dev, "no usb2 phy configured\n");
+ return ret;
+ }
}
if (IS_ERR(dwc->usb3_phy)) {
ret = PTR_ERR(dwc->usb3_phy);
-
- /*
- * if -ENXIO is returned, it means PHY layer wasn't
- * enabled, so it makes no sense to return -EPROBE_DEFER
- * in that case, since no PHY driver will ever probe.
- */
- if (ret == -ENXIO)
+ if (ret == -ENXIO || ret == -ENODEV) {
+ dwc->usb3_phy = NULL;
+ } else if (ret == -EPROBE_DEFER) {
return ret;
-
- dev_err(dev, "no usb3 phy configured\n");
- return -EPROBE_DEFER;
+ } else {
+ dev_err(dev, "no usb3 phy configured\n");
+ return ret;
+ }
}
dwc->xhci_resources[0].start = res->start;
--
1.7.9.5
next prev parent reply other threads:[~2014-03-03 11:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 11:38 [PATCH v5 0/6] Make dwc3 use Generic PHY Framework Kishon Vijay Abraham I
2014-03-03 11:38 ` Kishon Vijay Abraham I [this message]
2014-03-03 11:38 ` [PATCH v5 2/6] usb: dwc3: adapt dwc3 core to " Kishon Vijay Abraham I
2014-03-05 14:43 ` Roger Quadros
2014-03-05 14:47 ` Kishon Vijay Abraham I
2014-03-05 15:24 ` Roger Quadros
2014-03-03 11:38 ` [PATCH v5 3/6] drivers: phy: usb3/pipe3: Adapt pipe3 driver to " Kishon Vijay Abraham I
2014-03-06 9:30 ` Kishon Vijay Abraham I
2014-03-03 11:38 ` [PATCH v5 4/6] usb: phy: omap-usb2: remove *set_suspend* callback from omap-usb2 Kishon Vijay Abraham I
2014-03-03 11:38 ` [PATCH v5 5/6] phy: omap-usb2: move omap_usb.h from linux/usb/ to linux/phy/ Kishon Vijay Abraham I
2014-03-03 11:38 ` [PATCH v5 6/6] arm/dts: added dt properties to adapt to the new phy framwork Kishon Vijay Abraham I
2014-03-05 12:42 ` Kishon Vijay Abraham I
2014-03-05 19:40 ` Tony Lindgren
2014-03-03 12:21 ` [PATCH v5 0/6] Make dwc3 use Generic PHY Framework Roger Quadros
2014-03-03 12:36 ` Kishon Vijay Abraham I
2014-03-03 16:40 ` Felipe Balbi
2014-03-04 13:31 ` Kishon Vijay Abraham I
2014-03-07 16:48 ` [PATCH v6] phy: omap-usb2: move omap_usb.h from linux/usb/ to linux/phy/ Kishon Vijay Abraham I
2014-03-07 16:50 ` Felipe Balbi
2014-03-07 17:39 ` Kishon Vijay Abraham I
2014-03-07 17:40 ` Felipe Balbi
2014-03-07 17:46 ` Kishon Vijay Abraham I
2014-03-07 18:08 ` Felipe Balbi
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=1393846695-14644-2-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=balbi@ti.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=george.cherian@ti.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=rogerq@ti.com \
--cc=s.nawrocki@samsung.com \
--cc=swarren@wwwdotorg.org \
--cc=tony@atomide.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
Powered by JetHome