aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
commit8065248069097dddf9945acfb2081025e9618c16 (patch)
treeeddf3fb0372ba0f65c01382d386942ea8d18932d /drivers/usb/gadget
parente66a8ddff72e85605f2212a0ebc666c7e9116641 (diff)
parentb4838d12e1f3cb48c2489a0b08733b5dbf848297 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/Kconfig2
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/at91_udc.c41
-rw-r--r--drivers/usb/gadget/dummy_hcd.c1
-rw-r--r--drivers/usb/gadget/f_phonet.c2
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c1
-rw-r--r--drivers/usb/gadget/goku_udc.c1
-rw-r--r--drivers/usb/gadget/langwell_udc.c1
-rw-r--r--drivers/usb/gadget/mv_udc_core.c1
-rw-r--r--drivers/usb/gadget/net2272.c1
-rw-r--r--drivers/usb/gadget/net2280.c1
-rw-r--r--drivers/usb/gadget/omap_udc.c1
-rw-r--r--drivers/usb/gadget/printer.c1
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c1
-rw-r--r--drivers/usb/gadget/rndis.c1
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c1
16 files changed, 40 insertions, 18 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 26c0b75f152e..2633f7595116 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -137,7 +137,7 @@ choice
137 137
138config USB_AT91 138config USB_AT91
139 tristate "Atmel AT91 USB Device Port" 139 tristate "Atmel AT91 USB Device Port"
140 depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91SAM9G45 140 depends on ARCH_AT91
141 help 141 help
142 Many Atmel AT91 processors (such as the AT91RM2000) have a 142 Many Atmel AT91 processors (such as the AT91RM2000) have a
143 full speed USB Device Port with support for five configurable 143 full speed USB Device Port with support for five configurable
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 2204a4c68d85..77779271f487 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -54,7 +54,6 @@
54#include <linux/prefetch.h> 54#include <linux/prefetch.h>
55 55
56#include <asm/byteorder.h> 56#include <asm/byteorder.h>
57#include <asm/system.h>
58#include <asm/unaligned.h> 57#include <asm/unaligned.h>
59 58
60/* gadget stack */ 59/* gadget stack */
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 2db5f68f7960..0c935d7c65bd 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -29,12 +29,13 @@
29#include <linux/clk.h> 29#include <linux/clk.h>
30#include <linux/usb/ch9.h> 30#include <linux/usb/ch9.h>
31#include <linux/usb/gadget.h> 31#include <linux/usb/gadget.h>
32#include <linux/of.h>
33#include <linux/of_gpio.h>
32 34
33#include <asm/byteorder.h> 35#include <asm/byteorder.h>
34#include <mach/hardware.h> 36#include <mach/hardware.h>
35#include <asm/io.h> 37#include <asm/io.h>
36#include <asm/irq.h> 38#include <asm/irq.h>
37#include <asm/system.h>
38#include <asm/gpio.h> 39#include <asm/gpio.h>
39 40
40#include <mach/board.h> 41#include <mach/board.h>
@@ -1707,7 +1708,27 @@ static void at91udc_shutdown(struct platform_device *dev)
1707 spin_unlock_irqrestore(&udc->lock, flags); 1708 spin_unlock_irqrestore(&udc->lock, flags);
1708} 1709}
1709 1710
1710static int __init at91udc_probe(struct platform_device *pdev) 1711static void __devinit at91udc_of_init(struct at91_udc *udc,
1712 struct device_node *np)
1713{
1714 struct at91_udc_data *board = &udc->board;
1715 u32 val;
1716 enum of_gpio_flags flags;
1717
1718 if (of_property_read_u32(np, "atmel,vbus-polled", &val) == 0)
1719 board->vbus_polled = 1;
1720
1721 board->vbus_pin = of_get_named_gpio_flags(np, "atmel,vbus-gpio", 0,
1722 &flags);
1723 board->vbus_active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0;
1724
1725 board->pullup_pin = of_get_named_gpio_flags(np, "atmel,pullup-gpio", 0,
1726 &flags);
1727
1728 board->pullup_active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0;
1729}
1730
1731static int __devinit at91udc_probe(struct platform_device *pdev)
1711{ 1732{
1712 struct device *dev = &pdev->dev; 1733 struct device *dev = &pdev->dev;
1713 struct at91_udc *udc; 1734 struct at91_udc *udc;
@@ -1742,7 +1763,11 @@ static int __init at91udc_probe(struct platform_device *pdev)
1742 /* init software state */ 1763 /* init software state */
1743 udc = &controller; 1764 udc = &controller;
1744 udc->gadget.dev.parent = dev; 1765 udc->gadget.dev.parent = dev;
1745 udc->board = *(struct at91_udc_data *) dev->platform_data; 1766 if (pdev->dev.of_node)
1767 at91udc_of_init(udc, pdev->dev.of_node);
1768 else
1769 memcpy(&udc->board, dev->platform_data,
1770 sizeof(struct at91_udc_data));
1746 udc->pdev = pdev; 1771 udc->pdev = pdev;
1747 udc->enabled = 0; 1772 udc->enabled = 0;
1748 spin_lock_init(&udc->lock); 1773 spin_lock_init(&udc->lock);
@@ -1971,6 +1996,15 @@ static int at91udc_resume(struct platform_device *pdev)
1971#define at91udc_resume NULL 1996#define at91udc_resume NULL
1972#endif 1997#endif
1973 1998
1999#if defined(CONFIG_OF)
2000static const struct of_device_id at91_udc_dt_ids[] = {
2001 { .compatible = "atmel,at91rm9200-udc" },
2002 { /* sentinel */ }
2003};
2004
2005MODULE_DEVICE_TABLE(of, at91_udc_dt_ids);
2006#endif
2007
1974static struct platform_driver at91_udc_driver = { 2008static struct platform_driver at91_udc_driver = {
1975 .remove = __exit_p(at91udc_remove), 2009 .remove = __exit_p(at91udc_remove),
1976 .shutdown = at91udc_shutdown, 2010 .shutdown = at91udc_shutdown,
@@ -1979,6 +2013,7 @@ static struct platform_driver at91_udc_driver = {
1979 .driver = { 2013 .driver = {
1980 .name = (char *) driver_name, 2014 .name = (char *) driver_name,
1981 .owner = THIS_MODULE, 2015 .owner = THIS_MODULE,
2016 .of_match_table = of_match_ptr(at91_udc_dt_ids),
1982 }, 2017 },
1983}; 2018};
1984 2019
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index e1cd56c5e2a8..a6dfd2164166 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -44,7 +44,6 @@
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <linux/io.h> 45#include <linux/io.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/system.h>
48#include <asm/unaligned.h> 47#include <asm/unaligned.h>
49 48
50#define DRIVER_DESC "USB Host+Gadget Emulator" 49#define DRIVER_DESC "USB Host+Gadget Emulator"
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index 85a5cebe96b3..965a6293206a 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -345,7 +345,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
345 } 345 }
346 346
347 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 347 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
348 skb->len <= 1, req->actual, req->actual); 348 skb->len <= 1, req->actual, PAGE_SIZE);
349 page = NULL; 349 page = NULL;
350 350
351 if (req->actual < req->length) { /* Last fragment */ 351 if (req->actual < req->length) { /* Last fragment */
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index b30e21fdbb1b..5f94e79cd6b9 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -43,7 +43,6 @@
43 43
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <asm/io.h> 45#include <asm/io.h>
46#include <asm/system.h>
47#include <asm/unaligned.h> 46#include <asm/unaligned.h>
48#include <asm/dma.h> 47#include <asm/dma.h>
49 48
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index e1dfd32dc805..e151d6b87dee 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -43,7 +43,6 @@
43#include <asm/byteorder.h> 43#include <asm/byteorder.h>
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/system.h>
47#include <asm/unaligned.h> 46#include <asm/unaligned.h>
48 47
49 48
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index edd52d963f14..f9cedd52cf20 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -32,7 +32,6 @@
32#include <linux/pm.h> 32#include <linux/pm.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/irq.h> 34#include <linux/irq.h>
35#include <asm/system.h>
36#include <asm/unaligned.h> 35#include <asm/unaligned.h>
37 36
38#include "langwell_udc.h" 37#include "langwell_udc.h"
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 19bbe80c2f8c..a73cf406e2a4 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -34,7 +34,6 @@
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/platform_data/mv_usb.h> 36#include <linux/platform_data/mv_usb.h>
37#include <asm/system.h>
38#include <asm/unaligned.h> 37#include <asm/unaligned.h>
39 38
40#include "mv_udc.h" 39#include "mv_udc.h"
diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index 01ae56f47174..43ac7482fa91 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -42,7 +42,6 @@
42#include <linux/usb/gadget.h> 42#include <linux/usb/gadget.h>
43 43
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <asm/system.h>
46#include <asm/unaligned.h> 45#include <asm/unaligned.h>
47 46
48#include "net2272.h" 47#include "net2272.h"
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index a5ccabc37f30..ac335af154ba 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -59,7 +59,6 @@
59#include <asm/byteorder.h> 59#include <asm/byteorder.h>
60#include <asm/io.h> 60#include <asm/io.h>
61#include <asm/irq.h> 61#include <asm/irq.h>
62#include <asm/system.h>
63#include <asm/unaligned.h> 62#include <asm/unaligned.h>
64 63
65 64
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index b44830df593e..3b4b6dd0f95a 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -40,7 +40,6 @@
40#include <asm/byteorder.h> 40#include <asm/byteorder.h>
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/system.h>
44#include <asm/unaligned.h> 43#include <asm/unaligned.h>
45#include <asm/mach-types.h> 44#include <asm/mach-types.h>
46 45
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index d83134b0f78a..4e4dc1f5f388 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -34,7 +34,6 @@
34#include <asm/byteorder.h> 34#include <asm/byteorder.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/irq.h> 36#include <linux/irq.h>
37#include <asm/system.h>
38#include <linux/uaccess.h> 37#include <linux/uaccess.h>
39#include <asm/unaligned.h> 38#include <asm/unaligned.h>
40 39
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 1b33634f2736..41ed69c96d8c 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -41,7 +41,6 @@
41#include <asm/byteorder.h> 41#include <asm/byteorder.h>
42#include <asm/dma.h> 42#include <asm/dma.h>
43#include <asm/gpio.h> 43#include <asm/gpio.h>
44#include <asm/system.h>
45#include <asm/mach-types.h> 44#include <asm/mach-types.h>
46#include <asm/unaligned.h> 45#include <asm/unaligned.h>
47 46
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index d3cdffea9c8a..73a934a170d1 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -34,7 +34,6 @@
34 34
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/byteorder.h> 36#include <asm/byteorder.h>
37#include <asm/system.h>
38#include <asm/unaligned.h> 37#include <asm/unaligned.h>
39 38
40 39
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index ab9c65e2c1d5..195524cde6c3 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -37,7 +37,6 @@
37#include <asm/byteorder.h> 37#include <asm/byteorder.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/system.h>
41#include <asm/unaligned.h> 40#include <asm/unaligned.h>
42#include <mach/irqs.h> 41#include <mach/irqs.h>
43 42