[PATCH 3/6] amba: pl011: add support for regulator

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Jan 12 22:33:07 PST 2015


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/serial/amba-pl011.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index fc7723e..4c4067d 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -28,6 +28,7 @@
 #include <init.h>
 #include <malloc.h>
 #include <io.h>
+#include <regulator.h>
 #include <linux/amba/serial.h>
 #include <linux/clk.h>
 #include <linux/err.h>
@@ -181,6 +182,16 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 {
 	struct amba_uart_port *uart;
 	struct console_device *cdev;
+	struct regulator *r;
+
+	r = regulator_get(&dev->dev, NULL);
+	if (r) {
+		int ret;
+
+		ret = regulator_enable(r);
+		if (ret)
+			return ret;
+	}
 
 	uart = xzalloc(sizeof(struct amba_uart_port));
 	uart->clk = clk_get(&dev->dev, NULL);
-- 
2.1.3




More information about the barebox mailing list