diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2008-04-28 02:00:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 13:03:31 -0400 |
commit | fd05e720099e8eeddb378305d1a41c1445344b91 (patch) | |
tree | d617918be290b47b35822bc3cf21c8f01dde5dd2 /drivers/usb/gadget | |
parent | 01d7b369887b6feb7c9ce2b20988fafe3f70841c (diff) |
drivers/usb annotations and fixes
* endianness annotations
* endianness fixes
* missing get_unaligned/put_unaligned
It's pretty much all over the place, changes to different files are independent.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Serial-parts-Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/amd5536udc.c | 20 | ||||
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/m66592-udc.h | 2 |
4 files changed, 16 insertions, 15 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index fc6f3483be44..ce337cb5d137 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c | |||
@@ -328,6 +328,7 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
328 | u32 tmp; | 328 | u32 tmp; |
329 | unsigned long iflags; | 329 | unsigned long iflags; |
330 | u8 udc_csr_epix; | 330 | u8 udc_csr_epix; |
331 | unsigned maxpacket; | ||
331 | 332 | ||
332 | if (!usbep | 333 | if (!usbep |
333 | || usbep->name == ep0_string | 334 | || usbep->name == ep0_string |
@@ -354,9 +355,10 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
354 | writel(tmp, &dev->ep[ep->num].regs->ctl); | 355 | writel(tmp, &dev->ep[ep->num].regs->ctl); |
355 | 356 | ||
356 | /* set max packet size */ | 357 | /* set max packet size */ |
358 | maxpacket = le16_to_cpu(desc->wMaxPacketSize); | ||
357 | tmp = readl(&dev->ep[ep->num].regs->bufout_maxpkt); | 359 | tmp = readl(&dev->ep[ep->num].regs->bufout_maxpkt); |
358 | tmp = AMD_ADDBITS(tmp, desc->wMaxPacketSize, UDC_EP_MAX_PKT_SIZE); | 360 | tmp = AMD_ADDBITS(tmp, maxpacket, UDC_EP_MAX_PKT_SIZE); |
359 | ep->ep.maxpacket = desc->wMaxPacketSize; | 361 | ep->ep.maxpacket = maxpacket; |
360 | writel(tmp, &dev->ep[ep->num].regs->bufout_maxpkt); | 362 | writel(tmp, &dev->ep[ep->num].regs->bufout_maxpkt); |
361 | 363 | ||
362 | /* IN ep */ | 364 | /* IN ep */ |
@@ -370,8 +372,8 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
370 | /* double buffering: fifo size = 2 x max packet size */ | 372 | /* double buffering: fifo size = 2 x max packet size */ |
371 | tmp = AMD_ADDBITS( | 373 | tmp = AMD_ADDBITS( |
372 | tmp, | 374 | tmp, |
373 | desc->wMaxPacketSize * UDC_EPIN_BUFF_SIZE_MULT | 375 | maxpacket * UDC_EPIN_BUFF_SIZE_MULT |
374 | / UDC_DWORD_BYTES, | 376 | / UDC_DWORD_BYTES, |
375 | UDC_EPIN_BUFF_SIZE); | 377 | UDC_EPIN_BUFF_SIZE); |
376 | writel(tmp, &dev->ep[ep->num].regs->bufin_framenum); | 378 | writel(tmp, &dev->ep[ep->num].regs->bufin_framenum); |
377 | 379 | ||
@@ -390,7 +392,7 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
390 | 392 | ||
391 | /* set max packet size UDC CSR */ | 393 | /* set max packet size UDC CSR */ |
392 | tmp = readl(&dev->csr->ne[ep->num - UDC_CSR_EP_OUT_IX_OFS]); | 394 | tmp = readl(&dev->csr->ne[ep->num - UDC_CSR_EP_OUT_IX_OFS]); |
393 | tmp = AMD_ADDBITS(tmp, desc->wMaxPacketSize, | 395 | tmp = AMD_ADDBITS(tmp, maxpacket, |
394 | UDC_CSR_NE_MAX_PKT); | 396 | UDC_CSR_NE_MAX_PKT); |
395 | writel(tmp, &dev->csr->ne[ep->num - UDC_CSR_EP_OUT_IX_OFS]); | 397 | writel(tmp, &dev->csr->ne[ep->num - UDC_CSR_EP_OUT_IX_OFS]); |
396 | 398 | ||
@@ -407,7 +409,7 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc) | |||
407 | /* set ep values */ | 409 | /* set ep values */ |
408 | tmp = readl(&dev->csr->ne[udc_csr_epix]); | 410 | tmp = readl(&dev->csr->ne[udc_csr_epix]); |
409 | /* max packet */ | 411 | /* max packet */ |
410 | tmp = AMD_ADDBITS(tmp, desc->wMaxPacketSize, UDC_CSR_NE_MAX_PKT); | 412 | tmp = AMD_ADDBITS(tmp, maxpacket, UDC_CSR_NE_MAX_PKT); |
411 | /* ep number */ | 413 | /* ep number */ |
412 | tmp = AMD_ADDBITS(tmp, desc->bEndpointAddress, UDC_CSR_NE_NUM); | 414 | tmp = AMD_ADDBITS(tmp, desc->bEndpointAddress, UDC_CSR_NE_NUM); |
413 | /* ep direction */ | 415 | /* ep direction */ |
@@ -2832,7 +2834,7 @@ __acquires(dev->lock) | |||
2832 | /* make usb request for gadget driver */ | 2834 | /* make usb request for gadget driver */ |
2833 | memset(&setup_data, 0 , sizeof(union udc_setup_data)); | 2835 | memset(&setup_data, 0 , sizeof(union udc_setup_data)); |
2834 | setup_data.request.bRequest = USB_REQ_SET_CONFIGURATION; | 2836 | setup_data.request.bRequest = USB_REQ_SET_CONFIGURATION; |
2835 | setup_data.request.wValue = dev->cur_config; | 2837 | setup_data.request.wValue = cpu_to_le16(dev->cur_config); |
2836 | 2838 | ||
2837 | /* programm the NE registers */ | 2839 | /* programm the NE registers */ |
2838 | for (i = 0; i < UDC_EP_NUM; i++) { | 2840 | for (i = 0; i < UDC_EP_NUM; i++) { |
@@ -2881,8 +2883,8 @@ __acquires(dev->lock) | |||
2881 | memset(&setup_data, 0 , sizeof(union udc_setup_data)); | 2883 | memset(&setup_data, 0 , sizeof(union udc_setup_data)); |
2882 | setup_data.request.bRequest = USB_REQ_SET_INTERFACE; | 2884 | setup_data.request.bRequest = USB_REQ_SET_INTERFACE; |
2883 | setup_data.request.bRequestType = USB_RECIP_INTERFACE; | 2885 | setup_data.request.bRequestType = USB_RECIP_INTERFACE; |
2884 | setup_data.request.wValue = dev->cur_alt; | 2886 | setup_data.request.wValue = cpu_to_le16(dev->cur_alt); |
2885 | setup_data.request.wIndex = dev->cur_intf; | 2887 | setup_data.request.wIndex = cpu_to_le16(dev->cur_intf); |
2886 | 2888 | ||
2887 | DBG(dev, "SET_INTERFACE interrupt: alt=%d intf=%d\n", | 2889 | DBG(dev, "SET_INTERFACE interrupt: alt=%d intf=%d\n", |
2888 | dev->cur_alt, dev->cur_intf); | 2890 | dev->cur_alt, dev->cur_intf); |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 66293105d136..42036192a03c 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -1555,8 +1555,7 @@ hub_descriptor (struct usb_hub_descriptor *desc) | |||
1555 | memset (desc, 0, sizeof *desc); | 1555 | memset (desc, 0, sizeof *desc); |
1556 | desc->bDescriptorType = 0x29; | 1556 | desc->bDescriptorType = 0x29; |
1557 | desc->bDescLength = 9; | 1557 | desc->bDescLength = 9; |
1558 | desc->wHubCharacteristics = (__force __u16) | 1558 | desc->wHubCharacteristics = cpu_to_le16(0x0001); |
1559 | (__constant_cpu_to_le16 (0x0001)); | ||
1560 | desc->bNbrPorts = 1; | 1559 | desc->bNbrPorts = 1; |
1561 | desc->bitmap [0] = 0xff; | 1560 | desc->bitmap [0] = 0xff; |
1562 | desc->bitmap [1] = 0xff; | 1561 | desc->bitmap [1] = 0xff; |
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index ff3a8513e64d..7f4d4828e3aa 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -229,7 +229,7 @@ static const struct usb_ac_header_descriptor_1 ac_header_desc = { | |||
229 | .bDescriptorType = USB_DT_CS_INTERFACE, | 229 | .bDescriptorType = USB_DT_CS_INTERFACE, |
230 | .bDescriptorSubtype = USB_MS_HEADER, | 230 | .bDescriptorSubtype = USB_MS_HEADER, |
231 | .bcdADC = __constant_cpu_to_le16(0x0100), | 231 | .bcdADC = __constant_cpu_to_le16(0x0100), |
232 | .wTotalLength = USB_DT_AC_HEADER_SIZE(1), | 232 | .wTotalLength = __constant_cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)), |
233 | .bInCollection = 1, | 233 | .bInCollection = 1, |
234 | .baInterfaceNr = { | 234 | .baInterfaceNr = { |
235 | [0] = GMIDI_MS_INTERFACE, | 235 | [0] = GMIDI_MS_INTERFACE, |
@@ -253,9 +253,9 @@ static const struct usb_ms_header_descriptor ms_header_desc = { | |||
253 | .bDescriptorType = USB_DT_CS_INTERFACE, | 253 | .bDescriptorType = USB_DT_CS_INTERFACE, |
254 | .bDescriptorSubtype = USB_MS_HEADER, | 254 | .bDescriptorSubtype = USB_MS_HEADER, |
255 | .bcdMSC = __constant_cpu_to_le16(0x0100), | 255 | .bcdMSC = __constant_cpu_to_le16(0x0100), |
256 | .wTotalLength = USB_DT_MS_HEADER_SIZE | 256 | .wTotalLength = __constant_cpu_to_le16(USB_DT_MS_HEADER_SIZE |
257 | + 2*USB_DT_MIDI_IN_SIZE | 257 | + 2*USB_DT_MIDI_IN_SIZE |
258 | + 2*USB_DT_MIDI_OUT_SIZE(1), | 258 | + 2*USB_DT_MIDI_OUT_SIZE(1)), |
259 | }; | 259 | }; |
260 | 260 | ||
261 | #define JACK_IN_EMB 1 | 261 | #define JACK_IN_EMB 1 |
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h index be0a4c1f80a2..f118f00f1466 100644 --- a/drivers/usb/gadget/m66592-udc.h +++ b/drivers/usb/gadget/m66592-udc.h | |||
@@ -485,7 +485,7 @@ struct m66592 { | |||
485 | struct m66592_ep *epaddr2ep[16]; | 485 | struct m66592_ep *epaddr2ep[16]; |
486 | 486 | ||
487 | struct usb_request *ep0_req; /* for internal request */ | 487 | struct usb_request *ep0_req; /* for internal request */ |
488 | u16 ep0_data; /* for internal request */ | 488 | __le16 ep0_data; /* for internal request */ |
489 | u16 old_vbus; | 489 | u16 old_vbus; |
490 | 490 | ||
491 | struct timer_list timer; | 491 | struct timer_list timer; |