mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] usb: at91_udc: request and configure vbus pin via gpiolib
Date: Fri, 28 Dec 2012 17:46:30 +0100	[thread overview]
Message-ID: <1356713191-9614-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1356713191-9614-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@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


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

  reply	other threads:[~2012-12-28 16:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 16:43 [PATCH 0/3] atmel nand/spi/udc: request gpio Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 16:46 ` [PATCH 1/3] mtd: atmel_nand: request and configure pio via gpiolib Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 16:46   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-12-28 16:46   ` [PATCH 3/3] spi: atmel: request cs pin " Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:07 ` [PATCH 0/3] atmel nand/spi/udc: request gpio Sascha Hauer

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=1356713191-9614-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /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