aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:28 -0400
commit87fc94d54b639d8c39fc4a11db0e142f84096e13 (patch)
tree00ea5cdb108c93f621110424d8c54ef5dac12960 /drivers/usb/gadget
parent3516c6a8dc0b1153c611c4cf0dc4a51631f052bb (diff)
parent8e706c4d0dab214c625a2df84a0ca69a76bae65d (diff)
Merge branch 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
* 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6: avr32: add hardware handshake support to atmel_serial avr32: add RTS/CTS/CLK pin selection for the USARTs Add RTC support for Merisc boards avr32: at32ap700x: setup DMA for AC97C in the machine code avr32: at32ap700x: setup DMA for ABDAC in the machine code Add Merisc board support avr32: use gpio_is_valid() to check USBA vbus_pin I/O line atmel-usba-udc: use gpio_is_valid() to check vbus_pin I/O line avr32: fix timing LCD parameters for EVKLCD10X boards avr32: use GPIO line PB15 on EVKLCD10x boards for backlight avr32: configure MCI detect and write protect pins for EVKLCD10x boards avr32: set pin mask to alternative 18 bpp for EVKLCD10x boards avr32: add pin mask for 18-bit color on the LCD controller avr32: fix 15-bit LCDC pin mask to use MSB lines
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index c22fab164113..563d57275448 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -319,7 +319,7 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc)
319 319
320static int vbus_is_present(struct usba_udc *udc) 320static int vbus_is_present(struct usba_udc *udc)
321{ 321{
322 if (udc->vbus_pin != -1) 322 if (gpio_is_valid(udc->vbus_pin))
323 return gpio_get_value(udc->vbus_pin); 323 return gpio_get_value(udc->vbus_pin);
324 324
325 /* No Vbus detection: Assume always present */ 325 /* No Vbus detection: Assume always present */
@@ -1821,7 +1821,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
1821 DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name); 1821 DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name);
1822 1822
1823 udc->vbus_prev = 0; 1823 udc->vbus_prev = 0;
1824 if (udc->vbus_pin != -1) 1824 if (gpio_is_valid(udc->vbus_pin))
1825 enable_irq(gpio_to_irq(udc->vbus_pin)); 1825 enable_irq(gpio_to_irq(udc->vbus_pin));
1826 1826
1827 /* If Vbus is present, enable the controller and wait for reset */ 1827 /* If Vbus is present, enable the controller and wait for reset */
@@ -1852,7 +1852,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1852 if (driver != udc->driver || !driver->unbind) 1852 if (driver != udc->driver || !driver->unbind)
1853 return -EINVAL; 1853 return -EINVAL;
1854 1854
1855 if (udc->vbus_pin != -1) 1855 if (gpio_is_valid(udc->vbus_pin))
1856 disable_irq(gpio_to_irq(udc->vbus_pin)); 1856 disable_irq(gpio_to_irq(udc->vbus_pin));
1857 1857
1858 spin_lock_irqsave(&udc->lock, flags); 1858 spin_lock_irqsave(&udc->lock, flags);
@@ -1910,7 +1910,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
1910 udc->pdev = pdev; 1910 udc->pdev = pdev;
1911 udc->pclk = pclk; 1911 udc->pclk = pclk;
1912 udc->hclk = hclk; 1912 udc->hclk = hclk;
1913 udc->vbus_pin = -1; 1913 udc->vbus_pin = -ENODEV;
1914 1914
1915 ret = -ENOMEM; 1915 ret = -ENOMEM;
1916 udc->regs = ioremap(regs->start, regs->end - regs->start + 1); 1916 udc->regs = ioremap(regs->start, regs->end - regs->start + 1);
@@ -1996,7 +1996,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
1996 goto err_device_add; 1996 goto err_device_add;
1997 } 1997 }
1998 1998
1999 if (pdata->vbus_pin >= 0) { 1999 if (gpio_is_valid(pdata->vbus_pin)) {
2000 if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { 2000 if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) {
2001 udc->vbus_pin = pdata->vbus_pin; 2001 udc->vbus_pin = pdata->vbus_pin;
2002 2002
@@ -2005,7 +2005,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
2005 "atmel_usba_udc", udc); 2005 "atmel_usba_udc", udc);
2006 if (ret) { 2006 if (ret) {
2007 gpio_free(udc->vbus_pin); 2007 gpio_free(udc->vbus_pin);
2008 udc->vbus_pin = -1; 2008 udc->vbus_pin = -ENODEV;
2009 dev_warn(&udc->pdev->dev, 2009 dev_warn(&udc->pdev->dev,
2010 "failed to request vbus irq; " 2010 "failed to request vbus irq; "
2011 "assuming always on\n"); 2011 "assuming always on\n");
@@ -2051,7 +2051,7 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
2051 usba_ep_cleanup_debugfs(&usba_ep[i]); 2051 usba_ep_cleanup_debugfs(&usba_ep[i]);
2052 usba_cleanup_debugfs(udc); 2052 usba_cleanup_debugfs(udc);
2053 2053
2054 if (udc->vbus_pin != -1) 2054 if (gpio_is_valid(udc->vbus_pin))
2055 gpio_free(udc->vbus_pin); 2055 gpio_free(udc->vbus_pin);
2056 2056
2057 free_irq(udc->irq, udc); 2057 free_irq(udc->irq, udc);