1 --- a/arch/arm/mach-pxa/gumstix.c
2 +++ b/arch/arm/mach-pxa/gumstix.c
4 #include <asm/mach-types.h>
5 #include <asm/mach/arch.h>
6 #include <asm/mach/irq.h>
7 +#include <asm/arch/ohci.h>
8 #include <asm/arch/udc.h>
9 #include <asm/arch/mmc.h>
10 #include <asm/arch/pxa-regs.h>
11 @@ -178,9 +179,34 @@ static struct platform_device *devices[]
15 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
16 +static int gumstix_ohci_init(struct device *dev)
18 + /* setup Port1 GPIO pin. */
19 + //pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
20 + //pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
22 + // Turn on port 2 in host mode
23 + UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
26 + ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
31 +static struct pxaohci_platform_data gumstix_ohci_platform_data = {
32 + .port_mode = PMM_PERPORT_MODE,
33 + .init = gumstix_ohci_init,
37 static void __init gumstix_init(void)
39 pxa_set_mci_info(&gumstix_mci_platform_data);
40 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
41 + pxa_set_ohci_info(&gumstix_ohci_platform_data);
43 pxa_set_udc_info(&gumstix_udc_info);
44 #if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) | defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) | defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
45 set_pxa_fb_info(&gumstix_fb_info);
46 --- a/drivers/usb/gadget/ether.c
47 +++ b/drivers/usb/gadget/ether.c
48 @@ -260,6 +260,8 @@ MODULE_PARM_DESC(host_addr, "Host Ethern
50 #ifdef CONFIG_USB_GADGET_PXA27X
51 #define DEV_CONFIG_CDC
52 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
53 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
56 #ifdef CONFIG_USB_GADGET_S3C2410
57 @@ -482,15 +484,15 @@ eth_config = {
58 #ifdef CONFIG_USB_ETH_RNDIS
59 static struct usb_config_descriptor
61 - .bLength = sizeof rndis_config,
62 + .bLength = sizeof rndis_config,
63 .bDescriptorType = USB_DT_CONFIG,
65 /* compute wTotalLength on the fly */
66 - .bNumInterfaces = 2,
67 + .bNumInterfaces = 2,
68 .bConfigurationValue = DEV_RNDIS_CONFIG_VALUE,
69 - .iConfiguration = STRING_RNDIS,
70 + .iConfiguration = STRING_RNDIS,
71 .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
77 @@ -532,15 +534,15 @@ control_intf = {
78 #ifdef CONFIG_USB_ETH_RNDIS
79 static const struct usb_interface_descriptor
80 rndis_control_intf = {
81 - .bLength = sizeof rndis_control_intf,
82 + .bLength = sizeof rndis_control_intf,
83 .bDescriptorType = USB_DT_INTERFACE,
85 .bInterfaceNumber = 0,
88 .bInterfaceClass = USB_CLASS_COMM,
89 .bInterfaceSubClass = USB_CDC_SUBCLASS_ACM,
90 .bInterfaceProtocol = USB_CDC_ACM_PROTO_VENDOR,
91 - .iInterface = STRING_RNDIS_CONTROL,
92 + .iInterface = STRING_RNDIS_CONTROL,
96 @@ -1342,7 +1344,7 @@ static void rndis_response_complete (str
98 static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
100 - struct eth_dev *dev = ep->driver_data;
101 + struct eth_dev *dev = ep->driver_data;
104 /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
105 @@ -1578,7 +1580,7 @@ done_set_intf:
107 /* return the result */
108 buf = rndis_get_next_response (dev->rndis_config,
112 memcpy (req->buf, buf, value);
113 req->complete = rndis_response_complete;
114 @@ -2064,7 +2066,7 @@ static void eth_req_free (struct usb_ep
116 rndis_control_ack_complete (struct usb_ep *ep, struct usb_request *req)
118 - struct eth_dev *dev = ep->driver_data;
119 + struct eth_dev *dev = ep->driver_data;
121 if (req->status || req->actual != req->length)
123 @@ -2415,7 +2417,27 @@ eth_bind (struct usb_gadget *gadget)
125 /* all we really need is bulk IN/OUT */
126 usb_ep_autoconfig_reset (gadget);
127 +#ifdef CONFIG_USB_GADGET_PXA27X
128 +#ifdef CONFIG_USB_ETH_RNDIS
129 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
130 + DEV_RNDIS_CONFIG_VALUE,
131 + (int)rndis_data_intf.bInterfaceNumber,
132 + (int)rndis_data_intf.bAlternateSetting);
133 +#elif defined(DEV_CONFIG_CDC)
134 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
136 + (int)data_intf.bInterfaceNumber,
137 + (int)data_intf.bAlternateSetting);
138 +#elif defined(DEV_CONFIG_SUBSET)
139 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
141 + (int)subset_data_intf.bInterfaceNumber,
142 + (int)subset_data_intf.bAlternateSetting);
144 +#endif //CONFIG_USB_ETH_RNDIS
146 in_ep = usb_ep_autoconfig (gadget, &fs_source_desc);
147 +#endif //CONFIG_USB_GADGET_PXA27X
150 dev_err (&gadget->dev,
151 @@ -2425,7 +2447,26 @@ autoconf_fail:
153 in_ep->driver_data = in_ep; /* claim */
155 +#ifdef CONFIG_USB_GADGET_PXA27X
156 +#ifdef CONFIG_USB_ETH_RNDIS
157 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
158 + DEV_RNDIS_CONFIG_VALUE,
159 + (int)rndis_data_intf.bInterfaceNumber,
160 + (int)rndis_data_intf.bAlternateSetting);
161 +#elif defined(DEV_CONFIG_CDC)
162 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
164 + (int)data_intf.bInterfaceNumber,
165 + (int)data_intf.bAlternateSetting);
166 +#elif defined(DEV_CONFIG_SUBSET)
167 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
169 + (int)subset_data_intf.bInterfaceNumber,
170 + (int)subset_data_intf.bAlternateSetting);
171 +#endif //CONFIG_USB_ETH_RNDIS
173 out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
174 +#endif //CONFIG_USB_GADGET_PXA27X
177 out_ep->driver_data = out_ep; /* claim */
178 @@ -2435,7 +2476,22 @@ autoconf_fail:
179 * Since some hosts expect one, try to allocate one anyway.
182 +#ifdef CONFIG_USB_GADGET_PXA27X
183 +#ifdef CONFIG_USB_ETH_RNDIS
184 + status_ep = pxa27x_ep_config (gadget, &fs_status_desc,
185 + DEV_RNDIS_CONFIG_VALUE,
186 + (int)rndis_control_intf.bInterfaceNumber,
187 + (int)rndis_control_intf.bAlternateSetting);
188 +#elif defined(DEV_CONFIG_CDC)
189 + status_ep = pxa27x_ep_config (gadget, &fs_status_desc,
191 + (int)control_intf.bInterfaceNumber,
192 + (int)control_intf.bAlternateSetting);
194 +#endif //CONFIG_USB_ETH_RNDIS
196 status_ep = usb_ep_autoconfig (gadget, &fs_status_desc);
197 +#endif //CONFIG_USB_GADGET_PXA27X
199 status_ep->driver_data = status_ep; /* claim */
201 @@ -2444,11 +2500,13 @@ autoconf_fail:
204 #ifdef DEV_CONFIG_CDC
205 +#ifndef CONFIG_USB_GADGET_PXA27X
206 /* pxa25x only does CDC subset; often used with RNDIS */
208 control_intf.bNumEndpoints = 0;
209 /* FIXME remove endpoint from descriptor list */
215 --- a/drivers/usb/gadget/file_storage.c
216 +++ b/drivers/usb/gadget/file_storage.c
217 @@ -280,6 +280,12 @@ MODULE_LICENSE("Dual BSD/GPL");
218 #define DRIVER_PRODUCT_ID 0xa4a5 // Linux-USB File-backed Storage Gadget
222 +#ifdef CONFIG_USB_GADGET_PXA27X
223 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
224 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
228 * This driver assumes self-powered hardware and has no way for users to
229 * trigger remote wakeup. It uses autoconfiguration to select endpoints
230 @@ -3920,20 +3926,32 @@ static int __init fsg_bind(struct usb_ga
232 /* Find all the endpoints we will use */
233 usb_ep_autoconfig_reset(gadget);
234 +#ifdef CONFIG_USB_GADGET_PXA27X
235 + ep = pxa27x_ep_config(gadget, &fs_bulk_in_desc, CONFIG_VALUE, 0, 0);
237 ep = usb_ep_autoconfig(gadget, &fs_bulk_in_desc);
241 ep->driver_data = fsg; // claim the endpoint
244 +#ifdef CONFIG_USB_GADGET_PXA27X
245 + ep = pxa27x_ep_config(gadget, &fs_bulk_out_desc, CONFIG_VALUE, 0, 0);
247 ep = usb_ep_autoconfig(gadget, &fs_bulk_out_desc);
251 ep->driver_data = fsg; // claim the endpoint
254 if (transport_is_cbi()) {
255 +#ifdef CONFIG_USB_GADGET_PXA27X
256 + ep = pxa27x_ep_config(gadget, &fs_intr_in_desc, CONFIG_VALUE, 0, 0);
258 ep = usb_ep_autoconfig(gadget, &fs_intr_in_desc);
262 ep->driver_data = fsg; // claim the endpoint
263 @@ -4063,6 +4081,7 @@ autoconf_fail:
267 + ERROR(fsg, "cleaning up on the way out\n");
268 fsg->state = FSG_STATE_TERMINATED; // The thread is dead
270 close_all_backing_files(fsg);
271 --- a/drivers/usb/gadget/serial.c
272 +++ b/drivers/usb/gadget/serial.c
273 @@ -126,6 +126,10 @@ static int debug = 1;
274 #define GS_LOG2_NOTIFY_INTERVAL 5 /* 1 << 5 == 32 msec */
275 #define GS_NOTIFY_MAXPACKET 8
277 +#ifdef CONFIG_USB_GADGET_PXA27X
278 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
279 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
284 @@ -1378,20 +1382,32 @@ static int __init gs_bind(struct usb_gad
286 usb_ep_autoconfig_reset(gadget);
288 +#ifdef CONFIG_USB_GADGET_PXA27X
289 + ep = pxa27x_ep_config(gadget, &gs_fullspeed_in_desc, use_acm ? GS_ACM_CONFIG_ID : GS_BULK_CONFIG_ID, gs_bulk_interface_desc.bInterfaceNumber, gs_bulk_interface_desc.bAlternateSetting);
291 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_in_desc);
295 EP_IN_NAME = ep->name;
296 ep->driver_data = ep; /* claim the endpoint */
298 +#ifdef CONFIG_USB_GADGET_PXA27X
299 + ep = pxa27x_ep_config(gadget, &gs_fullspeed_out_desc, use_acm ? GS_ACM_CONFIG_ID : GS_BULK_CONFIG_ID, gs_bulk_interface_desc.bInterfaceNumber, gs_bulk_interface_desc.bAlternateSetting);
301 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_out_desc);
305 EP_OUT_NAME = ep->name;
306 ep->driver_data = ep; /* claim the endpoint */
309 +#ifdef CONFIG_USB_GADGET_PXA27X
310 + ep = pxa27x_ep_config(gadget, &gs_fullspeed_notify_desc, GS_BULK_CONFIG_ID, gs_control_interface_desc.bInterfaceNumber, gs_control_interface_desc.bAlternateSetting);
312 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc);
315 printk(KERN_ERR "gs_bind: cannot run ACM on %s\n", gadget->name);
317 --- a/drivers/usb/gadget/zero.c
318 +++ b/drivers/usb/gadget/zero.c
319 @@ -212,6 +212,11 @@ module_param (loopdefault, bool, S_IRUGO
320 #define STRING_SOURCE_SINK 250
321 #define STRING_LOOPBACK 251
323 +#ifdef CONFIG_USB_GADGET_PXA27X
324 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
325 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
329 * This device advertises two configurations; these numbers work
330 * on a pxa250 as well as more flexible hardware.
331 @@ -1155,7 +1160,11 @@ zero_bind (struct usb_gadget *gadget)
332 * but there may also be important quirks to address.
334 usb_ep_autoconfig_reset (gadget);
335 +#ifdef CONFIG_USB_GADGET_PXA27X
336 + ep = pxa27x_ep_config(gadget, &fs_source_desc, CONFIG_SOURCE_SINK, source_sink_intf.bInterfaceNumber, source_sink_intf.bAlternateSetting);
338 ep = usb_ep_autoconfig (gadget, &fs_source_desc);
342 printk (KERN_ERR "%s: can't autoconfigure on %s\n",
343 @@ -1164,8 +1173,12 @@ autoconf_fail:
345 EP_IN_NAME = ep->name;
346 ep->driver_data = ep; /* claim */
349 +#ifdef CONFIG_USB_GADGET_PXA27X
350 + ep = pxa27x_ep_config(gadget, &fs_sink_desc, CONFIG_SOURCE_SINK, source_sink_intf.bInterfaceNumber, source_sink_intf.bAlternateSetting);
352 ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
356 EP_OUT_NAME = ep->name;