[PATCH 2/3] usb: at91_udc: request and configure vbus pin via gpiolib

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Dec 28 11:46:30 EST 2012


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/usb/gadget/at91_udc.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 8a678f9..3899db2 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1497,6 +1497,13 @@ static int __init at91udc_probe(struct device_d *dev)
 	clk_disable(udc->iclk);
 
 	if (gpio_is_valid(udc->board.vbus_pin)) {
+		retval = gpio_request(udc->board.vbus_pin, "udc_vbus");
+		if (retval < 0) {
+			dev_err(dev, "request vbus pin failed\n");
+			goto fail0a;
+		}
+		gpio_direction_input(udc->board.vbus_pin);
+
 		/*
 		 * Get the initial state of VBUS - we cannot expect
 		 * a pending interrupt.
-- 
1.7.10.4




More information about the barebox mailing list