aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/atmel_usba_udc.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2009-03-27 11:14:38 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2009-03-27 11:14:38 -0400
commitb92efa9abffc4a634cd2e7a0f81f8aa6310d67c9 (patch)
tree9847508d9b8d4e585f90db4a453bfbc3700c997e /drivers/usb/gadget/atmel_usba_udc.c
parenta16fffdd8eb95ebab7dc22414896fe6493951e0e (diff)
parentbe0ea69674ed95e1e98cb3687a241badc756d228 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into avr32-arch
Diffstat (limited to 'drivers/usb/gadget/atmel_usba_udc.c')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index ee7ebb674416..563d57275448 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1017,7 +1017,7 @@ static struct usb_endpoint_descriptor usba_ep0_desc = {
1017 .bDescriptorType = USB_DT_ENDPOINT, 1017 .bDescriptorType = USB_DT_ENDPOINT,
1018 .bEndpointAddress = 0, 1018 .bEndpointAddress = 0,
1019 .bmAttributes = USB_ENDPOINT_XFER_CONTROL, 1019 .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
1020 .wMaxPacketSize = __constant_cpu_to_le16(64), 1020 .wMaxPacketSize = cpu_to_le16(64),
1021 /* FIXME: I have no idea what to put here */ 1021 /* FIXME: I have no idea what to put here */
1022 .bInterval = 1, 1022 .bInterval = 1,
1023}; 1023};
@@ -1207,21 +1207,21 @@ static int do_test_mode(struct usba_udc *udc)
1207/* Avoid overly long expressions */ 1207/* Avoid overly long expressions */
1208static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq) 1208static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq)
1209{ 1209{
1210 if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP)) 1210 if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP))
1211 return true; 1211 return true;
1212 return false; 1212 return false;
1213} 1213}
1214 1214
1215static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq) 1215static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq)
1216{ 1216{
1217 if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_TEST_MODE)) 1217 if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE))
1218 return true; 1218 return true;
1219 return false; 1219 return false;
1220} 1220}
1221 1221
1222static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq) 1222static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq)
1223{ 1223{
1224 if (crq->wValue == __constant_cpu_to_le16(USB_ENDPOINT_HALT)) 1224 if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT))
1225 return true; 1225 return true;
1226 return false; 1226 return false;
1227} 1227}
@@ -1239,7 +1239,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
1239 status = cpu_to_le16(udc->devstatus); 1239 status = cpu_to_le16(udc->devstatus);
1240 } else if (crq->bRequestType 1240 } else if (crq->bRequestType
1241 == (USB_DIR_IN | USB_RECIP_INTERFACE)) { 1241 == (USB_DIR_IN | USB_RECIP_INTERFACE)) {
1242 status = __constant_cpu_to_le16(0); 1242 status = cpu_to_le16(0);
1243 } else if (crq->bRequestType 1243 } else if (crq->bRequestType
1244 == (USB_DIR_IN | USB_RECIP_ENDPOINT)) { 1244 == (USB_DIR_IN | USB_RECIP_ENDPOINT)) {
1245 struct usba_ep *target; 1245 struct usba_ep *target;
@@ -1250,12 +1250,12 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
1250 1250
1251 status = 0; 1251 status = 0;
1252 if (is_stalled(udc, target)) 1252 if (is_stalled(udc, target))
1253 status |= __constant_cpu_to_le16(1); 1253 status |= cpu_to_le16(1);
1254 } else 1254 } else
1255 goto delegate; 1255 goto delegate;
1256 1256
1257 /* Write directly to the FIFO. No queueing is done. */ 1257 /* Write directly to the FIFO. No queueing is done. */
1258 if (crq->wLength != __constant_cpu_to_le16(sizeof(status))) 1258 if (crq->wLength != cpu_to_le16(sizeof(status)))
1259 goto stall; 1259 goto stall;
1260 ep->state = DATA_STAGE_IN; 1260 ep->state = DATA_STAGE_IN;
1261 __raw_writew(status, ep->fifo); 1261 __raw_writew(status, ep->fifo);
@@ -1274,7 +1274,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
1274 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { 1274 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
1275 struct usba_ep *target; 1275 struct usba_ep *target;
1276 1276
1277 if (crq->wLength != __constant_cpu_to_le16(0) 1277 if (crq->wLength != cpu_to_le16(0)
1278 || !feature_is_ep_halt(crq)) 1278 || !feature_is_ep_halt(crq))
1279 goto stall; 1279 goto stall;
1280 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex)); 1280 target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex));
@@ -1308,7 +1308,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
1308 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) { 1308 } else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
1309 struct usba_ep *target; 1309 struct usba_ep *target;
1310 1310
1311 if (crq->wLength != __constant_cpu_to_le16(0) 1311 if (crq->wLength != cpu_to_le16(0)
1312 || !feature_is_ep_halt(crq)) 1312 || !feature_is_ep_halt(crq))
1313 goto stall; 1313 goto stall;
1314 1314
@@ -1514,7 +1514,7 @@ restart:
1514 */ 1514 */
1515 ep->state = DATA_STAGE_IN; 1515 ep->state = DATA_STAGE_IN;
1516 } else { 1516 } else {
1517 if (crq.crq.wLength != __constant_cpu_to_le16(0)) 1517 if (crq.crq.wLength != cpu_to_le16(0))
1518 ep->state = DATA_STAGE_OUT; 1518 ep->state = DATA_STAGE_OUT;
1519 else 1519 else
1520 ep->state = STATUS_STAGE_IN; 1520 ep->state = STATUS_STAGE_IN;