aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/at91_udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r--drivers/usb/gadget/at91_udc.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index ddb118a7680..8efe0fa9228 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -9,16 +9,6 @@
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
22 */ 12 */
23 13
24#undef VERBOSE_DEBUG 14#undef VERBOSE_DEBUG
@@ -460,7 +450,7 @@ static void nuke(struct at91_ep *ep, int status)
460{ 450{
461 struct at91_request *req; 451 struct at91_request *req;
462 452
463 // terminer chaque requete dans la queue 453 /* terminate any request in the queue */
464 ep->stopped = 1; 454 ep->stopped = 1;
465 if (list_empty(&ep->queue)) 455 if (list_empty(&ep->queue))
466 return; 456 return;
@@ -487,7 +477,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
487 || !desc || ep->desc 477 || !desc || ep->desc
488 || _ep->name == ep0name 478 || _ep->name == ep0name
489 || desc->bDescriptorType != USB_DT_ENDPOINT 479 || desc->bDescriptorType != USB_DT_ENDPOINT
490 || (maxpacket = le16_to_cpu(desc->wMaxPacketSize)) == 0 480 || (maxpacket = usb_endpoint_maxp(desc)) == 0
491 || maxpacket > ep->maxpacket) { 481 || maxpacket > ep->maxpacket) {
492 DBG("bad ep or descriptor\n"); 482 DBG("bad ep or descriptor\n");
493 return -EINVAL; 483 return -EINVAL;
@@ -788,7 +778,7 @@ static const struct usb_ep_ops at91_ep_ops = {
788 .queue = at91_ep_queue, 778 .queue = at91_ep_queue,
789 .dequeue = at91_ep_dequeue, 779 .dequeue = at91_ep_dequeue,
790 .set_halt = at91_ep_set_halt, 780 .set_halt = at91_ep_set_halt,
791 // there's only imprecise fifo status reporting 781 /* there's only imprecise fifo status reporting */
792}; 782};
793 783
794/*-------------------------------------------------------------------------*/ 784/*-------------------------------------------------------------------------*/
@@ -846,7 +836,7 @@ static void udc_reinit(struct at91_udc *udc)
846 ep->fifo_bank = 0; 836 ep->fifo_bank = 0;
847 ep->ep.maxpacket = ep->maxpacket; 837 ep->ep.maxpacket = ep->maxpacket;
848 ep->creg = (void __iomem *) udc->udp_baseaddr + AT91_UDP_CSR(i); 838 ep->creg = (void __iomem *) udc->udp_baseaddr + AT91_UDP_CSR(i);
849 // initialiser une queue par endpoint 839 /* initialize one queue per endpoint */
850 INIT_LIST_HEAD(&ep->queue); 840 INIT_LIST_HEAD(&ep->queue);
851 } 841 }
852} 842}
@@ -952,7 +942,7 @@ static int at91_vbus_session(struct usb_gadget *gadget, int is_active)
952 struct at91_udc *udc = to_udc(gadget); 942 struct at91_udc *udc = to_udc(gadget);
953 unsigned long flags; 943 unsigned long flags;
954 944
955 // VDBG("vbus %s\n", is_active ? "on" : "off"); 945 /* VDBG("vbus %s\n", is_active ? "on" : "off"); */
956 spin_lock_irqsave(&udc->lock, flags); 946 spin_lock_irqsave(&udc->lock, flags);
957 udc->vbus = (is_active != 0); 947 udc->vbus = (is_active != 0);
958 if (udc->driver) 948 if (udc->driver)
@@ -1003,7 +993,7 @@ static const struct usb_gadget_ops at91_udc_ops = {
1003 * VBUS-powered devices may also also want to support bigger 993 * VBUS-powered devices may also also want to support bigger
1004 * power budgets after an appropriate SET_CONFIGURATION. 994 * power budgets after an appropriate SET_CONFIGURATION.
1005 */ 995 */
1006 // .vbus_power = at91_vbus_power, 996 /* .vbus_power = at91_vbus_power, */
1007}; 997};
1008 998
1009/*-------------------------------------------------------------------------*/ 999/*-------------------------------------------------------------------------*/
@@ -1072,7 +1062,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr)
1072 ep->is_in = 0; 1062 ep->is_in = 0;
1073 } 1063 }
1074 } else { 1064 } else {
1075 // REVISIT this happens sometimes under load; why?? 1065 /* REVISIT this happens sometimes under load; why?? */
1076 ERR("SETUP len %d, csr %08x\n", rxcount, csr); 1066 ERR("SETUP len %d, csr %08x\n", rxcount, csr);
1077 status = -EINVAL; 1067 status = -EINVAL;
1078 } 1068 }
@@ -1451,7 +1441,7 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
1451 at91_udp_write(udc, AT91_UDP_IDR, AT91_UDP_RXSUSP); 1441 at91_udp_write(udc, AT91_UDP_IDR, AT91_UDP_RXSUSP);
1452 at91_udp_write(udc, AT91_UDP_IER, AT91_UDP_RXRSM); 1442 at91_udp_write(udc, AT91_UDP_IER, AT91_UDP_RXRSM);
1453 at91_udp_write(udc, AT91_UDP_ICR, AT91_UDP_RXSUSP); 1443 at91_udp_write(udc, AT91_UDP_ICR, AT91_UDP_RXSUSP);
1454 // VDBG("bus suspend\n"); 1444 /* VDBG("bus suspend\n"); */
1455 if (udc->suspended) 1445 if (udc->suspended)
1456 continue; 1446 continue;
1457 udc->suspended = 1; 1447 udc->suspended = 1;
@@ -1473,7 +1463,7 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
1473 at91_udp_write(udc, AT91_UDP_IDR, AT91_UDP_RXRSM); 1463 at91_udp_write(udc, AT91_UDP_IDR, AT91_UDP_RXRSM);
1474 at91_udp_write(udc, AT91_UDP_IER, AT91_UDP_RXSUSP); 1464 at91_udp_write(udc, AT91_UDP_IER, AT91_UDP_RXSUSP);
1475 at91_udp_write(udc, AT91_UDP_ICR, AT91_UDP_RXRSM); 1465 at91_udp_write(udc, AT91_UDP_ICR, AT91_UDP_RXRSM);
1476 // VDBG("bus resume\n"); 1466 /* VDBG("bus resume\n"); */
1477 if (!udc->suspended) 1467 if (!udc->suspended)
1478 continue; 1468 continue;
1479 udc->suspended = 0; 1469 udc->suspended = 0;
@@ -1820,7 +1810,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
1820 /* request UDC and maybe VBUS irqs */ 1810 /* request UDC and maybe VBUS irqs */
1821 udc->udp_irq = platform_get_irq(pdev, 0); 1811 udc->udp_irq = platform_get_irq(pdev, 0);
1822 retval = request_irq(udc->udp_irq, at91_udc_irq, 1812 retval = request_irq(udc->udp_irq, at91_udc_irq,
1823 IRQF_DISABLED, driver_name, udc); 1813 0, driver_name, udc);
1824 if (retval < 0) { 1814 if (retval < 0) {
1825 DBG("request irq %d failed\n", udc->udp_irq); 1815 DBG("request irq %d failed\n", udc->udp_irq);
1826 goto fail1; 1816 goto fail1;
@@ -1848,7 +1838,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
1848 jiffies + VBUS_POLL_TIMEOUT); 1838 jiffies + VBUS_POLL_TIMEOUT);
1849 } else { 1839 } else {
1850 if (request_irq(udc->board.vbus_pin, at91_vbus_irq, 1840 if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
1851 IRQF_DISABLED, driver_name, udc)) { 1841 0, driver_name, udc)) {
1852 DBG("request vbus irq %d failed\n", 1842 DBG("request vbus irq %d failed\n",
1853 udc->board.vbus_pin); 1843 udc->board.vbus_pin);
1854 retval = -EBUSY; 1844 retval = -EBUSY;