1 Index: linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/mach-pxa/gumstix.c
4 +++ linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
6 #include <asm/mach-types.h>
7 #include <asm/mach/arch.h>
8 #include <asm/mach/irq.h>
9 +#include <asm/arch/ohci.h>
10 #include <asm/arch/udc.h>
11 #include <asm/arch/mmc.h>
12 #include <asm/arch/pxa-regs.h>
13 @@ -178,9 +179,34 @@ static struct platform_device *devices[]
17 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
18 +static int gumstix_ohci_init(struct device *dev)
20 + /* setup Port1 GPIO pin. */
21 + //pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
22 + //pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
24 + // Turn on port 2 in host mode
25 + UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
28 + ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
33 +static struct pxaohci_platform_data gumstix_ohci_platform_data = {
34 + .port_mode = PMM_PERPORT_MODE,
35 + .init = gumstix_ohci_init,
39 static void __init gumstix_init(void)
41 pxa_set_mci_info(&gumstix_mci_platform_data);
42 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
43 + pxa_set_ohci_info(&gumstix_ohci_platform_data);
45 pxa_set_udc_info(&gumstix_udc_info);
46 #if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) | defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) | defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
47 set_pxa_fb_info(&gumstix_fb_info);
48 Index: linux-2.6.21.7/drivers/usb/gadget/ether.c
49 ===================================================================
50 --- linux-2.6.21.7.orig/drivers/usb/gadget/ether.c
51 +++ linux-2.6.21.7/drivers/usb/gadget/ether.c
52 @@ -260,6 +260,8 @@ MODULE_PARM_DESC(host_addr, "Host Ethern
54 #ifdef CONFIG_USB_GADGET_PXA27X
55 #define DEV_CONFIG_CDC
56 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
57 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
60 #ifdef CONFIG_USB_GADGET_S3C2410
61 @@ -482,15 +484,15 @@ eth_config = {
62 #ifdef CONFIG_USB_ETH_RNDIS
63 static struct usb_config_descriptor
65 - .bLength = sizeof rndis_config,
66 + .bLength = sizeof rndis_config,
67 .bDescriptorType = USB_DT_CONFIG,
69 /* compute wTotalLength on the fly */
70 - .bNumInterfaces = 2,
71 + .bNumInterfaces = 2,
72 .bConfigurationValue = DEV_RNDIS_CONFIG_VALUE,
73 - .iConfiguration = STRING_RNDIS,
74 + .iConfiguration = STRING_RNDIS,
75 .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
81 @@ -532,15 +534,15 @@ control_intf = {
82 #ifdef CONFIG_USB_ETH_RNDIS
83 static const struct usb_interface_descriptor
84 rndis_control_intf = {
85 - .bLength = sizeof rndis_control_intf,
86 + .bLength = sizeof rndis_control_intf,
87 .bDescriptorType = USB_DT_INTERFACE,
89 .bInterfaceNumber = 0,
92 .bInterfaceClass = USB_CLASS_COMM,
93 .bInterfaceSubClass = USB_CDC_SUBCLASS_ACM,
94 .bInterfaceProtocol = USB_CDC_ACM_PROTO_VENDOR,
95 - .iInterface = STRING_RNDIS_CONTROL,
96 + .iInterface = STRING_RNDIS_CONTROL,
100 @@ -1342,7 +1344,7 @@ static void rndis_response_complete (str
102 static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
104 - struct eth_dev *dev = ep->driver_data;
105 + struct eth_dev *dev = ep->driver_data;
108 /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
109 @@ -1578,7 +1580,7 @@ done_set_intf:
111 /* return the result */
112 buf = rndis_get_next_response (dev->rndis_config,
116 memcpy (req->buf, buf, value);
117 req->complete = rndis_response_complete;
118 @@ -2064,7 +2066,7 @@ static void eth_req_free (struct usb_ep
120 rndis_control_ack_complete (struct usb_ep *ep, struct usb_request *req)
122 - struct eth_dev *dev = ep->driver_data;
123 + struct eth_dev *dev = ep->driver_data;
125 if (req->status || req->actual != req->length)
127 @@ -2415,7 +2417,27 @@ eth_bind (struct usb_gadget *gadget)
129 /* all we really need is bulk IN/OUT */
130 usb_ep_autoconfig_reset (gadget);
131 +#ifdef CONFIG_USB_GADGET_PXA27X
132 +#ifdef CONFIG_USB_ETH_RNDIS
133 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
134 + DEV_RNDIS_CONFIG_VALUE,
135 + (int)rndis_data_intf.bInterfaceNumber,
136 + (int)rndis_data_intf.bAlternateSetting);
137 +#elif defined(DEV_CONFIG_CDC)
138 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
140 + (int)data_intf.bInterfaceNumber,
141 + (int)data_intf.bAlternateSetting);
142 +#elif defined(DEV_CONFIG_SUBSET)
143 + in_ep = pxa27x_ep_config (gadget, &fs_source_desc,
145 + (int)subset_data_intf.bInterfaceNumber,
146 + (int)subset_data_intf.bAlternateSetting);
148 +#endif //CONFIG_USB_ETH_RNDIS
150 in_ep = usb_ep_autoconfig (gadget, &fs_source_desc);
151 +#endif //CONFIG_USB_GADGET_PXA27X
154 dev_err (&gadget->dev,
155 @@ -2425,7 +2447,26 @@ autoconf_fail:
157 in_ep->driver_data = in_ep; /* claim */
159 +#ifdef CONFIG_USB_GADGET_PXA27X
160 +#ifdef CONFIG_USB_ETH_RNDIS
161 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
162 + DEV_RNDIS_CONFIG_VALUE,
163 + (int)rndis_data_intf.bInterfaceNumber,
164 + (int)rndis_data_intf.bAlternateSetting);
165 +#elif defined(DEV_CONFIG_CDC)
166 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
168 + (int)data_intf.bInterfaceNumber,
169 + (int)data_intf.bAlternateSetting);
170 +#elif defined(DEV_CONFIG_SUBSET)
171 + out_ep = pxa27x_ep_config (gadget, &fs_sink_desc,
173 + (int)subset_data_intf.bInterfaceNumber,
174 + (int)subset_data_intf.bAlternateSetting);
175 +#endif //CONFIG_USB_ETH_RNDIS
177 out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
178 +#endif //CONFIG_USB_GADGET_PXA27X
181 out_ep->driver_data = out_ep; /* claim */
182 @@ -2435,7 +2476,22 @@ autoconf_fail:
183 * Since some hosts expect one, try to allocate one anyway.
186 +#ifdef CONFIG_USB_GADGET_PXA27X
187 +#ifdef CONFIG_USB_ETH_RNDIS
188 + status_ep = pxa27x_ep_config (gadget, &fs_status_desc,
189 + DEV_RNDIS_CONFIG_VALUE,
190 + (int)rndis_control_intf.bInterfaceNumber,
191 + (int)rndis_control_intf.bAlternateSetting);
192 +#elif defined(DEV_CONFIG_CDC)
193 + status_ep = pxa27x_ep_config (gadget, &fs_status_desc,
195 + (int)control_intf.bInterfaceNumber,
196 + (int)control_intf.bAlternateSetting);
198 +#endif //CONFIG_USB_ETH_RNDIS
200 status_ep = usb_ep_autoconfig (gadget, &fs_status_desc);
201 +#endif //CONFIG_USB_GADGET_PXA27X
203 status_ep->driver_data = status_ep; /* claim */
205 @@ -2444,11 +2500,13 @@ autoconf_fail:
208 #ifdef DEV_CONFIG_CDC
209 +#ifndef CONFIG_USB_GADGET_PXA27X
210 /* pxa25x only does CDC subset; often used with RNDIS */
212 control_intf.bNumEndpoints = 0;
213 /* FIXME remove endpoint from descriptor list */
219 Index: linux-2.6.21.7/drivers/usb/gadget/file_storage.c
220 ===================================================================
221 --- linux-2.6.21.7.orig/drivers/usb/gadget/file_storage.c
222 +++ linux-2.6.21.7/drivers/usb/gadget/file_storage.c
223 @@ -280,6 +280,12 @@ MODULE_LICENSE("Dual BSD/GPL");
224 #define DRIVER_PRODUCT_ID 0xa4a5 // Linux-USB File-backed Storage Gadget
228 +#ifdef CONFIG_USB_GADGET_PXA27X
229 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
230 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
234 * This driver assumes self-powered hardware and has no way for users to
235 * trigger remote wakeup. It uses autoconfiguration to select endpoints
236 @@ -3920,20 +3926,32 @@ static int __init fsg_bind(struct usb_ga
238 /* Find all the endpoints we will use */
239 usb_ep_autoconfig_reset(gadget);
240 +#ifdef CONFIG_USB_GADGET_PXA27X
241 + ep = pxa27x_ep_config(gadget, &fs_bulk_in_desc, CONFIG_VALUE, 0, 0);
243 ep = usb_ep_autoconfig(gadget, &fs_bulk_in_desc);
247 ep->driver_data = fsg; // claim the endpoint
250 +#ifdef CONFIG_USB_GADGET_PXA27X
251 + ep = pxa27x_ep_config(gadget, &fs_bulk_out_desc, CONFIG_VALUE, 0, 0);
253 ep = usb_ep_autoconfig(gadget, &fs_bulk_out_desc);
257 ep->driver_data = fsg; // claim the endpoint
260 if (transport_is_cbi()) {
261 +#ifdef CONFIG_USB_GADGET_PXA27X
262 + ep = pxa27x_ep_config(gadget, &fs_intr_in_desc, CONFIG_VALUE, 0, 0);
264 ep = usb_ep_autoconfig(gadget, &fs_intr_in_desc);
268 ep->driver_data = fsg; // claim the endpoint
269 @@ -4063,6 +4081,7 @@ autoconf_fail:
273 + ERROR(fsg, "cleaning up on the way out\n");
274 fsg->state = FSG_STATE_TERMINATED; // The thread is dead
276 close_all_backing_files(fsg);
277 Index: linux-2.6.21.7/drivers/usb/gadget/serial.c
278 ===================================================================
279 --- linux-2.6.21.7.orig/drivers/usb/gadget/serial.c
280 +++ linux-2.6.21.7/drivers/usb/gadget/serial.c
281 @@ -126,6 +126,10 @@ static int debug = 1;
282 #define GS_LOG2_NOTIFY_INTERVAL 5 /* 1 << 5 == 32 msec */
283 #define GS_NOTIFY_MAXPACKET 8
285 +#ifdef CONFIG_USB_GADGET_PXA27X
286 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
287 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
292 @@ -1378,20 +1382,32 @@ static int __init gs_bind(struct usb_gad
294 usb_ep_autoconfig_reset(gadget);
296 +#ifdef CONFIG_USB_GADGET_PXA27X
297 + 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);
299 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_in_desc);
303 EP_IN_NAME = ep->name;
304 ep->driver_data = ep; /* claim the endpoint */
306 +#ifdef CONFIG_USB_GADGET_PXA27X
307 + 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);
309 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_out_desc);
313 EP_OUT_NAME = ep->name;
314 ep->driver_data = ep; /* claim the endpoint */
317 +#ifdef CONFIG_USB_GADGET_PXA27X
318 + ep = pxa27x_ep_config(gadget, &gs_fullspeed_notify_desc, GS_BULK_CONFIG_ID, gs_control_interface_desc.bInterfaceNumber, gs_control_interface_desc.bAlternateSetting);
320 ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc);
323 printk(KERN_ERR "gs_bind: cannot run ACM on %s\n", gadget->name);
325 Index: linux-2.6.21.7/drivers/usb/gadget/zero.c
326 ===================================================================
327 --- linux-2.6.21.7.orig/drivers/usb/gadget/zero.c
328 +++ linux-2.6.21.7/drivers/usb/gadget/zero.c
329 @@ -212,6 +212,11 @@ module_param (loopdefault, bool, S_IRUGO
330 #define STRING_SOURCE_SINK 250
331 #define STRING_LOOPBACK 251
333 +#ifdef CONFIG_USB_GADGET_PXA27X
334 +extern struct usb_ep* pxa27x_ep_config(struct usb_gadget *gadget,
335 + struct usb_endpoint_descriptor *desc,int config,int interface,int alt);
339 * This device advertises two configurations; these numbers work
340 * on a pxa250 as well as more flexible hardware.
341 @@ -1155,7 +1160,11 @@ zero_bind (struct usb_gadget *gadget)
342 * but there may also be important quirks to address.
344 usb_ep_autoconfig_reset (gadget);
345 +#ifdef CONFIG_USB_GADGET_PXA27X
346 + ep = pxa27x_ep_config(gadget, &fs_source_desc, CONFIG_SOURCE_SINK, source_sink_intf.bInterfaceNumber, source_sink_intf.bAlternateSetting);
348 ep = usb_ep_autoconfig (gadget, &fs_source_desc);
352 printk (KERN_ERR "%s: can't autoconfigure on %s\n",
353 @@ -1164,8 +1173,12 @@ autoconf_fail:
355 EP_IN_NAME = ep->name;
356 ep->driver_data = ep; /* claim */
359 +#ifdef CONFIG_USB_GADGET_PXA27X
360 + ep = pxa27x_ep_config(gadget, &fs_sink_desc, CONFIG_SOURCE_SINK, source_sink_intf.bInterfaceNumber, source_sink_intf.bAlternateSetting);
362 ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
366 EP_OUT_NAME = ep->name;