linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
@ 2013-01-31 11:20 Vivek Gautam
  2013-01-31 11:34 ` kishon
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-01-31 11:20 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, linux-omap, linux-samsung-soc, gregkh, balbi, kishon

With device tree support in place for dwc3-core layer,
it gets PHY from "synopsis-dwc3" node.
Some controllers may not have separate memory maps and interrupts
for dwc3 core and platform glue layers. In such case only glue
layer's node will exist.
Moreover, SoCs having multiple dwc3 controllers will have multiple
PHYs, which eventually be added using usb_add_phy_dev(), and not
using usb_add_phy(). So each dwc3 controller won't be able to
get PHYs by simply calling devm_usb_get_phy() also.
In such cases, dwc3 should expect PHYs from its parent's node.
So, adding provision for getting PHY from platform specific
device tree node.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---

Based on 'usb-next'.

 drivers/usb/dwc3/core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9999094..75439c0 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -423,6 +423,11 @@ static int dwc3_probe(struct platform_device *pdev)
 	if (node) {
 		dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0);
 		dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 1);
+	} else if (dev->parent->of_node) {
+		dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev->parent,
+								"usb-phy", 0);
+		dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev->parent,
+								"usb-phy", 1);
 	} else {
 		dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
 		dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
-- 
1.7.6.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-03-04 15:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 11:20 [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node Vivek Gautam
2013-01-31 11:34 ` kishon
2013-01-31 15:23   ` Vivek Gautam
2013-01-31 15:25     ` Felipe Balbi
2013-01-31 15:30       ` Vivek Gautam
2013-01-31 15:38         ` Felipe Balbi
2013-02-01  5:21           ` kishon
2013-02-01  6:22             ` Vivek Gautam
2013-02-01  6:24               ` Vivek Gautam
2013-02-01  8:50                 ` Felipe Balbi
2013-02-01  8:53                   ` Vivek Gautam
2013-02-01  9:43                     ` Felipe Balbi
2013-02-28 14:39           ` Vivek Gautam
2013-03-01  6:41             ` Felipe Balbi
2013-03-04 15:02               ` Felipe Balbi

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).