mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: chipidea: Add DT vbus-supply parsing
@ 2014-07-28 20:23 Markus Pargmann
  2014-07-28 20:23 ` [PATCH 2/2] usb: imx-usb-misc: Use reasonable defaults to setup the ports Markus Pargmann
  2014-07-28 20:45 ` [PATCH 1/2] usb: chipidea: Add DT vbus-supply parsing Sebastian Hesselbarth
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Pargmann @ 2014-07-28 20:23 UTC (permalink / raw)
  To: barebox

Add some code to parse and enable vbus supply when probing.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 drivers/usb/imx/chipidea-imx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 9b6829b8f59f..a4cf4a1a5f3d 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -15,6 +15,7 @@
 #include <common.h>
 #include <init.h>
 #include <io.h>
+#include <linux/err.h>
 #include <of.h>
 #include <errno.h>
 #include <driver.h>
@@ -23,6 +24,7 @@
 #include <usb/chipidea-imx.h>
 #include <usb/ulpi.h>
 #include <usb/fsl_usb2.h>
+#include <regulator.h>
 
 #define MXC_EHCI_PORTSC_MASK ((0xf << 28) | (1 << 25))
 
@@ -187,6 +189,16 @@ static int imx_chipidea_probe(struct device_d *dev)
 		ret = -ENODEV;
 	}
 
+	if (ci->mode == IMX_USB_MODE_HOST) {
+		struct regulator *vbus = regulator_get(dev, "vbus");
+		if (!IS_ERR(vbus)) {
+			regulator_enable(vbus);
+		} else {
+			dev_err(dev, "Failed to get vbus regulator %ld\n", PTR_ERR(vbus));
+			ret = PTR_ERR(vbus);
+		}
+	}
+
 	return ret;
 };
 
-- 
2.0.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2014-07-28 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 20:23 [PATCH 1/2] usb: chipidea: Add DT vbus-supply parsing Markus Pargmann
2014-07-28 20:23 ` [PATCH 2/2] usb: imx-usb-misc: Use reasonable defaults to setup the ports Markus Pargmann
2014-07-28 20:45 ` [PATCH 1/2] usb: chipidea: Add DT vbus-supply parsing Sebastian Hesselbarth
2014-07-28 20:54   ` Markus Pargmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox