diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-06-24 10:02:10 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-08-05 02:32:25 -0400 |
commit | 11dd2d9a5e0f80bbfcd36fa42f07e5591c5579cc (patch) | |
tree | ab3807251f71fde8dba90761ad34e0f96ca8372b /arch/arm/mach-pxa/colibri-pxa320.c | |
parent | 320bbb86b3645ff8b13c13849adc90cff6a8918c (diff) |
[ARM] pxa/colibri320: Add UDC support
Add support for PXA UDC.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/colibri-pxa320.c')
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa320.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ae835fad7d10..99e850d84710 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/usb/gpio_vbus.h> | ||
19 | 20 | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/sizes.h> | 22 | #include <asm/sizes.h> |
@@ -28,6 +29,8 @@ | |||
28 | #include <mach/pxafb.h> | 29 | #include <mach/pxafb.h> |
29 | #include <mach/ohci.h> | 30 | #include <mach/ohci.h> |
30 | #include <mach/audio.h> | 31 | #include <mach/audio.h> |
32 | #include <mach/pxa27x-udc.h> | ||
33 | #include <mach/udc.h> | ||
31 | 34 | ||
32 | #include "generic.h" | 35 | #include "generic.h" |
33 | #include "devices.h" | 36 | #include "devices.h" |
@@ -101,6 +104,42 @@ void __init colibri_pxa320_init_ohci(void) | |||
101 | static inline void colibri_pxa320_init_ohci(void) {} | 104 | static inline void colibri_pxa320_init_ohci(void) {} |
102 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | 105 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ |
103 | 106 | ||
107 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) | ||
108 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { | ||
109 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), | ||
110 | .gpio_pullup = -1, | ||
111 | }; | ||
112 | |||
113 | static struct platform_device colibri_pxa320_gpio_vbus = { | ||
114 | .name = "gpio-vbus", | ||
115 | .id = -1, | ||
116 | .dev = { | ||
117 | .platform_data = &colibri_pxa320_gpio_vbus_info, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static void colibri_pxa320_udc_command(int cmd) | ||
122 | { | ||
123 | if (cmd == PXA2XX_UDC_CMD_CONNECT) | ||
124 | UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE; | ||
125 | else if (cmd == PXA2XX_UDC_CMD_DISCONNECT) | ||
126 | UP2OCR = UP2OCR_HXOE; | ||
127 | } | ||
128 | |||
129 | static struct pxa2xx_udc_mach_info colibri_pxa320_udc_info __initdata = { | ||
130 | .udc_command = colibri_pxa320_udc_command, | ||
131 | .gpio_pullup = -1, | ||
132 | }; | ||
133 | |||
134 | static void __init colibri_pxa320_init_udc(void) | ||
135 | { | ||
136 | pxa_set_udc_info(&colibri_pxa320_udc_info); | ||
137 | platform_device_register(&colibri_pxa320_gpio_vbus); | ||
138 | } | ||
139 | #else | ||
140 | static inline void colibri_pxa320_init_udc(void) {} | ||
141 | #endif | ||
142 | |||
104 | static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { | 143 | static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { |
105 | GPIO22_MMC1_CLK, | 144 | GPIO22_MMC1_CLK, |
106 | GPIO23_MMC1_CMD, | 145 | GPIO23_MMC1_CMD, |
@@ -212,6 +251,7 @@ void __init colibri_pxa320_init(void) | |||
212 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), | 251 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), |
213 | mfp_to_gpio(MFP_PIN_GPIO28)); | 252 | mfp_to_gpio(MFP_PIN_GPIO28)); |
214 | colibri_pxa320_init_uart(); | 253 | colibri_pxa320_init_uart(); |
254 | colibri_pxa320_init_udc(); | ||
215 | } | 255 | } |
216 | 256 | ||
217 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | 257 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") |