Commit 5b84dd67cfd8c07c4adff935310224a03d0c4d01
Committed by
Marek Vasut
1 parent
b974308105
Exists in
master
and in
54 other branches
usb: replace wait_ms() with mdelay()
Common code has a mdelay() func, so use that instead of the usb-specific wait_ms() func. This also fixes the build errors: ohci-hcd.c: In function 'submit_common_msg': /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1519:9: sorry, unimplemented: called from here /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1816:10: sorry, unimplemented: called from here /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1827:10: sorry, unimplemented: called from here /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1844:10: sorry, unimplemented: called from here /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1563:11: sorry, unimplemented: called from here /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available ohci-hcd.c:1583:9: sorry, unimplemented: called from here make[1]: *** [ohci-hcd.o] Error 1 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Marek Vasut <marex@denx.de>
Showing 18 changed files with 93 additions and 110 deletions Side-by-side Diff
- arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
- arch/arm/cpu/pxa/usb.c
- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
- arch/powerpc/cpu/mpc5xxx/usb_ohci.c
- arch/powerpc/cpu/ppc4xx/usb_ohci.c
- arch/sparc/cpu/leon3/usb_uhci.c
- board/efikamx/efikamx-usb.c
- board/mcc200/auto_update.c
- board/mpl/common/usb_uhci.c
- board/renesas/sh7785lcr/selfcheck.c
- common/usb.c
- common/usb_hub.c
- common/usb_storage.c
- drivers/usb/host/ehci-hcd.c
- drivers/usb/host/isp116x-hcd.c
- drivers/usb/host/ohci-hcd.c
- drivers/usb/host/r8a66597-hcd.c
- include/usb.h
arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
... | ... | @@ -1057,7 +1057,7 @@ |
1057 | 1057 | pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", |
1058 | 1058 | usb_pipein(pipe)); |
1059 | 1059 | #else |
1060 | - wait_ms(1); | |
1060 | + mdelay(1); | |
1061 | 1061 | #endif |
1062 | 1062 | if (usb_pipeint(pipe)) { |
1063 | 1063 | info("Root-Hub submit IRQ: NOT implemented"); |
... | ... | @@ -1260,7 +1260,7 @@ |
1260 | 1260 | #ifdef DEBUG |
1261 | 1261 | ohci_dump_roothub(&gohci, 1); |
1262 | 1262 | #else |
1263 | - wait_ms(1); | |
1263 | + mdelay(1); | |
1264 | 1264 | #endif |
1265 | 1265 | |
1266 | 1266 | len = min_t(int, len, leni); |
... | ... | @@ -1275,7 +1275,7 @@ |
1275 | 1275 | pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", |
1276 | 1276 | 0 /*usb_pipein(pipe) */); |
1277 | 1277 | #else |
1278 | - wait_ms(1); | |
1278 | + mdelay(1); | |
1279 | 1279 | #endif |
1280 | 1280 | |
1281 | 1281 | return stat; |
... | ... | @@ -1302,7 +1302,7 @@ |
1302 | 1302 | pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", |
1303 | 1303 | usb_pipein(pipe)); |
1304 | 1304 | #else |
1305 | - wait_ms(1); | |
1305 | + mdelay(1); | |
1306 | 1306 | #endif |
1307 | 1307 | if (!maxsize) { |
1308 | 1308 | err("submit_common_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1316,7 +1316,7 @@ |
1316 | 1316 | return -1; |
1317 | 1317 | } |
1318 | 1318 | |
1319 | - wait_ms(10); | |
1319 | + mdelay(10); | |
1320 | 1320 | /* ohci_dump_status(&gohci); */ |
1321 | 1321 | |
1322 | 1322 | /* allow more time for a BULK device to react - some are slow */ |
... | ... | @@ -1351,7 +1351,7 @@ |
1351 | 1351 | } |
1352 | 1352 | |
1353 | 1353 | if (--timeout) { |
1354 | - wait_ms(1); | |
1354 | + mdelay(1); | |
1355 | 1355 | if (!urb_finished) |
1356 | 1356 | dbg("\%"); |
1357 | 1357 | |
... | ... | @@ -1396,7 +1396,7 @@ |
1396 | 1396 | pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", |
1397 | 1397 | usb_pipein(pipe)); |
1398 | 1398 | #else |
1399 | - wait_ms(1); | |
1399 | + mdelay(1); | |
1400 | 1400 | #endif |
1401 | 1401 | |
1402 | 1402 | /* free TDs in urb_priv */ |
... | ... | @@ -1423,7 +1423,7 @@ |
1423 | 1423 | pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", |
1424 | 1424 | usb_pipein(pipe)); |
1425 | 1425 | #else |
1426 | - wait_ms(1); | |
1426 | + mdelay(1); | |
1427 | 1427 | #endif |
1428 | 1428 | if (!maxsize) { |
1429 | 1429 | err("submit_control_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1463,7 +1463,7 @@ |
1463 | 1463 | writel(OHCI_OCR, &ohci->regs->cmdstatus); |
1464 | 1464 | info("USB HC TakeOver from SMM"); |
1465 | 1465 | while (readl(&ohci->regs->control) & OHCI_CTRL_IR) { |
1466 | - wait_ms(10); | |
1466 | + mdelay(10); | |
1467 | 1467 | if (--smm_timeout == 0) { |
1468 | 1468 | err("USB HC TakeOver failed!"); |
1469 | 1469 | return -1; |
... | ... | @@ -1600,7 +1600,7 @@ |
1600 | 1600 | #ifdef DEBUG |
1601 | 1601 | ohci_dump(ohci, 1); |
1602 | 1602 | #else |
1603 | - wait_ms(1); | |
1603 | + mdelay(1); | |
1604 | 1604 | #endif |
1605 | 1605 | /* FIXME: be optimistic, hope that bug won't repeat often. */ |
1606 | 1606 | /* Make some non-interrupt context restart the controller. */ |
... | ... | @@ -1611,7 +1611,7 @@ |
1611 | 1611 | } |
1612 | 1612 | |
1613 | 1613 | if (ints & OHCI_INTR_WDH) { |
1614 | - wait_ms(1); | |
1614 | + mdelay(1); | |
1615 | 1615 | |
1616 | 1616 | writel(OHCI_INTR_WDH, ®s->intrdisable); |
1617 | 1617 | stat = dl_done_list(&gohci, dl_reverse_done_list(&gohci)); |
... | ... | @@ -1627,7 +1627,7 @@ |
1627 | 1627 | /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ |
1628 | 1628 | if (ints & OHCI_INTR_SF) { |
1629 | 1629 | unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1; |
1630 | - wait_ms(1); | |
1630 | + mdelay(1); | |
1631 | 1631 | writel(OHCI_INTR_SF, ®s->intrdisable); |
1632 | 1632 | if (ohci->ed_rm_list[frame] != NULL) |
1633 | 1633 | writel(OHCI_INTR_SF, ®s->intrenable); |
... | ... | @@ -1718,7 +1718,7 @@ |
1718 | 1718 | /* FIXME this is a second HC reset; why?? */ |
1719 | 1719 | gohci.hc_control = OHCI_USB_RESET; |
1720 | 1720 | writel(gohci.hc_control, &gohci.regs->control); |
1721 | - wait_ms(10); | |
1721 | + mdelay(10); | |
1722 | 1722 | |
1723 | 1723 | if (hc_start(&gohci) < 0) { |
1724 | 1724 | err("can't start usb-%s", gohci.slot_name); |
... | ... | @@ -1730,7 +1730,7 @@ |
1730 | 1730 | #ifdef DEBUG |
1731 | 1731 | ohci_dump(&gohci, 1); |
1732 | 1732 | #else |
1733 | - wait_ms(1); | |
1733 | + mdelay(1); | |
1734 | 1734 | #endif |
1735 | 1735 | ohci_inited = 1; |
1736 | 1736 | urb_finished = 1; |
arch/arm/cpu/pxa/usb.c
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
... | ... | @@ -1012,7 +1012,7 @@ |
1012 | 1012 | urb_priv.actual_length = 0; |
1013 | 1013 | pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe)); |
1014 | 1014 | #else |
1015 | - wait_ms(1); | |
1015 | + mdelay(1); | |
1016 | 1016 | #endif |
1017 | 1017 | if (usb_pipeint(pipe)) { |
1018 | 1018 | info("Root-Hub submit IRQ: NOT implemented"); |
... | ... | @@ -1189,7 +1189,7 @@ |
1189 | 1189 | #ifdef DEBUG |
1190 | 1190 | ohci_dump_roothub (&gohci, 1); |
1191 | 1191 | #else |
1192 | - wait_ms(1); | |
1192 | + mdelay(1); | |
1193 | 1193 | #endif |
1194 | 1194 | |
1195 | 1195 | len = min_t(int, len, leni); |
... | ... | @@ -1203,7 +1203,7 @@ |
1203 | 1203 | urb_priv.actual_length = transfer_len; |
1204 | 1204 | pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/); |
1205 | 1205 | #else |
1206 | - wait_ms(1); | |
1206 | + mdelay(1); | |
1207 | 1207 | #endif |
1208 | 1208 | |
1209 | 1209 | return stat; |
... | ... | @@ -1230,7 +1230,7 @@ |
1230 | 1230 | urb_priv.actual_length = 0; |
1231 | 1231 | pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe)); |
1232 | 1232 | #else |
1233 | - wait_ms(1); | |
1233 | + mdelay(1); | |
1234 | 1234 | #endif |
1235 | 1235 | if (!maxsize) { |
1236 | 1236 | err("submit_common_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1243,7 +1243,7 @@ |
1243 | 1243 | return -1; |
1244 | 1244 | } |
1245 | 1245 | |
1246 | - wait_ms(10); | |
1246 | + mdelay(10); | |
1247 | 1247 | /* ohci_dump_status(&gohci); */ |
1248 | 1248 | |
1249 | 1249 | /* allow more time for a BULK device to react - some are slow */ |
... | ... | @@ -1267,7 +1267,7 @@ |
1267 | 1267 | break; |
1268 | 1268 | } |
1269 | 1269 | if (--timeout) { |
1270 | - udelay(250); /* wait_ms(1); */ | |
1270 | + udelay(250); /* mdelay(1); */ | |
1271 | 1271 | } else { |
1272 | 1272 | err("CTL:TIMEOUT "); |
1273 | 1273 | stat = USB_ST_CRC_ERR; |
... | ... | @@ -1302,7 +1302,7 @@ |
1302 | 1302 | #ifdef DEBUG |
1303 | 1303 | pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe)); |
1304 | 1304 | #else |
1305 | - wait_ms(1); | |
1305 | + mdelay(1); | |
1306 | 1306 | #endif |
1307 | 1307 | |
1308 | 1308 | /* free TDs in urb_priv */ |
... | ... | @@ -1328,7 +1328,7 @@ |
1328 | 1328 | urb_priv.actual_length = 0; |
1329 | 1329 | pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe)); |
1330 | 1330 | #else |
1331 | - wait_ms(1); | |
1331 | + mdelay(1); | |
1332 | 1332 | #endif |
1333 | 1333 | if (!maxsize) { |
1334 | 1334 | err("submit_control_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1367,7 +1367,7 @@ |
1367 | 1367 | writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ |
1368 | 1368 | info("USB HC TakeOver from SMM"); |
1369 | 1369 | while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { |
1370 | - wait_ms (10); | |
1370 | + mdelay (10); | |
1371 | 1371 | if (--smm_timeout == 0) { |
1372 | 1372 | err("USB HC TakeOver failed!"); |
1373 | 1373 | return -1; |
... | ... | @@ -1490,7 +1490,7 @@ |
1490 | 1490 | #ifdef DEBUG |
1491 | 1491 | ohci_dump (ohci, 1); |
1492 | 1492 | #else |
1493 | - wait_ms(1); | |
1493 | + mdelay(1); | |
1494 | 1494 | #endif |
1495 | 1495 | /* FIXME: be optimistic, hope that bug won't repeat often. */ |
1496 | 1496 | /* Make some non-interrupt context restart the controller. */ |
... | ... | @@ -1501,7 +1501,7 @@ |
1501 | 1501 | } |
1502 | 1502 | |
1503 | 1503 | if (ints & OHCI_INTR_WDH) { |
1504 | - wait_ms(1); | |
1504 | + mdelay(1); | |
1505 | 1505 | writel (OHCI_INTR_WDH, ®s->intrdisable); |
1506 | 1506 | stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci)); |
1507 | 1507 | writel (OHCI_INTR_WDH, ®s->intrenable); |
... | ... | @@ -1516,7 +1516,7 @@ |
1516 | 1516 | /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ |
1517 | 1517 | if (ints & OHCI_INTR_SF) { |
1518 | 1518 | unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1; |
1519 | - wait_ms(1); | |
1519 | + mdelay(1); | |
1520 | 1520 | writel (OHCI_INTR_SF, ®s->intrdisable); |
1521 | 1521 | if (ohci->ed_rm_list[frame] != NULL) |
1522 | 1522 | writel (OHCI_INTR_SF, ®s->intrenable); |
... | ... | @@ -1686,7 +1686,7 @@ |
1686 | 1686 | |
1687 | 1687 | /* FIXME this is a second HC reset; why?? */ |
1688 | 1688 | writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control); |
1689 | - wait_ms (10); | |
1689 | + mdelay (10); | |
1690 | 1690 | |
1691 | 1691 | if (hc_start (&gohci) < 0) |
1692 | 1692 | goto errout; |
... | ... | @@ -1694,7 +1694,7 @@ |
1694 | 1694 | #ifdef DEBUG |
1695 | 1695 | ohci_dump (&gohci, 1); |
1696 | 1696 | #else |
1697 | - wait_ms(1); | |
1697 | + mdelay(1); | |
1698 | 1698 | #endif |
1699 | 1699 | ohci_inited = 1; |
1700 | 1700 | return 0; |
arch/powerpc/cpu/mpc5xxx/usb_ohci.c
... | ... | @@ -1269,7 +1269,7 @@ |
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | if (--timeout) { |
1272 | - wait_ms(1); | |
1272 | + mdelay(1); | |
1273 | 1273 | if (!urb_finished) |
1274 | 1274 | dbg("\%"); |
1275 | 1275 | |
... | ... | @@ -1372,7 +1372,7 @@ |
1372 | 1372 | writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ |
1373 | 1373 | info("USB HC TakeOver from SMM"); |
1374 | 1374 | while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { |
1375 | - wait_ms (10); | |
1375 | + mdelay (10); | |
1376 | 1376 | if (--smm_timeout == 0) { |
1377 | 1377 | err("USB HC TakeOver failed!"); |
1378 | 1378 | return -1; |
... | ... | @@ -1529,7 +1529,7 @@ |
1529 | 1529 | /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ |
1530 | 1530 | if (ints & OHCI_INTR_SF) { |
1531 | 1531 | unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1; |
1532 | - wait_ms(1); | |
1532 | + mdelay(1); | |
1533 | 1533 | writel (OHCI_INTR_SF, ®s->intrdisable); |
1534 | 1534 | if (ohci->ed_rm_list[frame] != NULL) |
1535 | 1535 | writel (OHCI_INTR_SF, ®s->intrenable); |
arch/powerpc/cpu/ppc4xx/usb_ohci.c
... | ... | @@ -1274,7 +1274,7 @@ |
1274 | 1274 | } |
1275 | 1275 | |
1276 | 1276 | if (--timeout) { |
1277 | - wait_ms(1); | |
1277 | + mdelay(1); | |
1278 | 1278 | if (!urb_finished) |
1279 | 1279 | dbg("\%"); |
1280 | 1280 | |
... | ... | @@ -1377,7 +1377,7 @@ |
1377 | 1377 | writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ |
1378 | 1378 | info("USB HC TakeOver from SMM"); |
1379 | 1379 | while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { |
1380 | - wait_ms (10); | |
1380 | + mdelay (10); | |
1381 | 1381 | if (--smm_timeout == 0) { |
1382 | 1382 | err("USB HC TakeOver failed!"); |
1383 | 1383 | return -1; |
... | ... | @@ -1534,7 +1534,7 @@ |
1534 | 1534 | /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ |
1535 | 1535 | if (ints & OHCI_INTR_SF) { |
1536 | 1536 | unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1; |
1537 | - wait_ms(1); | |
1537 | + mdelay(1); | |
1538 | 1538 | writel (OHCI_INTR_SF, ®s->intrdisable); |
1539 | 1539 | if (ohci->ed_rm_list[frame] != NULL) |
1540 | 1540 | writel (OHCI_INTR_SF, ®s->intrenable); |
arch/sparc/cpu/leon3/usb_uhci.c
... | ... | @@ -515,9 +515,9 @@ |
515 | 515 | out16r(usb_base_addr + USBCMD, USBCMD_GRESET | USBCMD_RS); |
516 | 516 | /* Turn off all interrupts */ |
517 | 517 | out16r(usb_base_addr + USBINTR, 0); |
518 | - wait_ms(50); | |
518 | + mdelay(50); | |
519 | 519 | out16r(usb_base_addr + USBCMD, 0); |
520 | - wait_ms(10); | |
520 | + mdelay(10); | |
521 | 521 | } |
522 | 522 | |
523 | 523 | void start_hc(void) |
... | ... | @@ -1044,7 +1044,7 @@ |
1044 | 1044 | status = (status & 0xfff5) | USBPORTSC_PR; |
1045 | 1045 | out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), |
1046 | 1046 | status); |
1047 | - wait_ms(10); | |
1047 | + mdelay(10); | |
1048 | 1048 | status = (status & 0xfff5) & ~USBPORTSC_PR; |
1049 | 1049 | out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), |
1050 | 1050 | status); |
... | ... | @@ -1052,7 +1052,7 @@ |
1052 | 1052 | status = (status & 0xfff5) | USBPORTSC_PE; |
1053 | 1053 | out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), |
1054 | 1054 | status); |
1055 | - wait_ms(10); | |
1055 | + mdelay(10); | |
1056 | 1056 | status = (status & 0xfff5) | 0xa; |
1057 | 1057 | out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), |
1058 | 1058 | status); |
board/efikamx/efikamx-usb.c
board/mcc200/auto_update.c
... | ... | @@ -284,7 +284,7 @@ |
284 | 284 | */ |
285 | 285 | debug ("flash_sect_erase(%lx, %lx);\n", start, end); |
286 | 286 | flash_sect_erase(start, end); |
287 | - wait_ms(100); | |
287 | + mdelay(100); | |
288 | 288 | #ifdef CONFIG_PROGRESSBAR |
289 | 289 | show_progress(end - start, totsize); |
290 | 290 | #endif |
... | ... | @@ -352,7 +352,7 @@ |
352 | 352 | * Read keypad status |
353 | 353 | */ |
354 | 354 | i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status1, 2); |
355 | - wait_ms(500); | |
355 | + mdelay(500); | |
356 | 356 | i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status2, 2); |
357 | 357 | |
358 | 358 | /* |
board/mpl/common/usb_uhci.c
... | ... | @@ -435,9 +435,9 @@ |
435 | 435 | out16r( usb_base_addr + USBCMD,USBCMD_GRESET | USBCMD_RS); |
436 | 436 | /* Turn off all interrupts */ |
437 | 437 | out16r(usb_base_addr + USBINTR,0); |
438 | - wait_ms(50); | |
438 | + mdelay(50); | |
439 | 439 | out16r( usb_base_addr + USBCMD,0); |
440 | - wait_ms(10); | |
440 | + mdelay(10); | |
441 | 441 | } |
442 | 442 | |
443 | 443 | void start_hc(void) |
444 | 444 | |
... | ... | @@ -926,13 +926,13 @@ |
926 | 926 | status = in16r(usb_base_addr+USBPORTSC1+2*(wIndex-1)); |
927 | 927 | status = (status & 0xfff5) | USBPORTSC_PR; |
928 | 928 | out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); |
929 | - wait_ms(10); | |
929 | + mdelay(10); | |
930 | 930 | status = (status & 0xfff5) & ~USBPORTSC_PR; |
931 | 931 | out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); |
932 | 932 | udelay(10); |
933 | 933 | status = (status & 0xfff5) | USBPORTSC_PE; |
934 | 934 | out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); |
935 | - wait_ms(10); | |
935 | + mdelay(10); | |
936 | 936 | status = (status & 0xfff5) | 0xa; |
937 | 937 | out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); |
938 | 938 | len=0; |
board/renesas/sh7785lcr/selfcheck.c
... | ... | @@ -33,12 +33,6 @@ |
33 | 33 | |
34 | 34 | #define SM107_DEVICEID (0x13e00060 + NOCACHE_OFFSET) |
35 | 35 | |
36 | -static void wait_ms(unsigned long time) | |
37 | -{ | |
38 | - while (time--) | |
39 | - udelay(1000); | |
40 | -} | |
41 | - | |
42 | 36 | static void test_pld(void) |
43 | 37 | { |
44 | 38 | printf("PLD version = %04x\n", readb(PLD_VERSR)); |
45 | 39 | |
... | ... | @@ -53,10 +47,10 @@ |
53 | 47 | { |
54 | 48 | printf("turn on LEDs 3, 5, 7, 9\n"); |
55 | 49 | writeb(0x55, PLD_LEDCR); |
56 | - wait_ms(2000); | |
50 | + mdelay(2000); | |
57 | 51 | printf("turn on LEDs 4, 6, 8, 10\n"); |
58 | 52 | writeb(0xaa, PLD_LEDCR); |
59 | - wait_ms(2000); | |
53 | + mdelay(2000); | |
60 | 54 | writeb(0x00, PLD_LEDCR); |
61 | 55 | } |
62 | 56 |
common/usb.c
... | ... | @@ -81,16 +81,6 @@ |
81 | 81 | */ |
82 | 82 | static void usb_scan_devices(void); |
83 | 83 | |
84 | -/*********************************************************************** | |
85 | - * wait_ms | |
86 | - */ | |
87 | - | |
88 | -inline void wait_ms(unsigned long ms) | |
89 | -{ | |
90 | - while (ms-- > 0) | |
91 | - udelay(1000); | |
92 | -} | |
93 | - | |
94 | 84 | /*************************************************************************** |
95 | 85 | * Init USB Device |
96 | 86 | */ |
... | ... | @@ -209,7 +199,7 @@ |
209 | 199 | while (timeout--) { |
210 | 200 | if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC)) |
211 | 201 | break; |
212 | - wait_ms(1); | |
202 | + mdelay(1); | |
213 | 203 | } |
214 | 204 | if (dev->status) |
215 | 205 | return -1; |
... | ... | @@ -233,7 +223,7 @@ |
233 | 223 | while (timeout--) { |
234 | 224 | if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC)) |
235 | 225 | break; |
236 | - wait_ms(1); | |
226 | + mdelay(1); | |
237 | 227 | } |
238 | 228 | *actual_length = dev->act_len; |
239 | 229 | if (dev->status == 0) |
... | ... | @@ -897,7 +887,7 @@ |
897 | 887 | return 1; |
898 | 888 | } |
899 | 889 | |
900 | - wait_ms(10); /* Let the SET_ADDRESS settle */ | |
890 | + mdelay(10); /* Let the SET_ADDRESS settle */ | |
901 | 891 | |
902 | 892 | tmp = sizeof(dev->descriptor); |
903 | 893 |
common/usb_hub.c
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | /* Wait at least 100 msec for power to become stable */ |
123 | - wait_ms(max(pgood_delay, (unsigned)100)); | |
123 | + mdelay(max(pgood_delay, (unsigned)100)); | |
124 | 124 | } |
125 | 125 | |
126 | 126 | void usb_hub_reset(void) |
... | ... | @@ -160,7 +160,7 @@ |
160 | 160 | for (tries = 0; tries < MAX_TRIES; tries++) { |
161 | 161 | |
162 | 162 | usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET); |
163 | - wait_ms(200); | |
163 | + mdelay(200); | |
164 | 164 | |
165 | 165 | if (usb_get_port_status(dev, port + 1, &portsts) < 0) { |
166 | 166 | USB_HUB_PRINTF("get_port_status failed status %lX\n", |
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | if (portstatus & USB_PORT_STAT_ENABLE) |
188 | 188 | break; |
189 | 189 | |
190 | - wait_ms(200); | |
190 | + mdelay(200); | |
191 | 191 | } |
192 | 192 | |
193 | 193 | if (tries == MAX_TRIES) { |
... | ... | @@ -232,7 +232,7 @@ |
232 | 232 | if (!(portstatus & USB_PORT_STAT_CONNECTION)) |
233 | 233 | return; |
234 | 234 | } |
235 | - wait_ms(200); | |
235 | + mdelay(200); | |
236 | 236 | |
237 | 237 | /* Reset the port */ |
238 | 238 | if (hub_port_reset(dev, port, &portstatus) < 0) { |
... | ... | @@ -240,7 +240,7 @@ |
240 | 240 | return; |
241 | 241 | } |
242 | 242 | |
243 | - wait_ms(200); | |
243 | + mdelay(200); | |
244 | 244 | |
245 | 245 | /* Allocate a new device struct for it */ |
246 | 246 | usb = usb_alloc_new_device(); |
common/usb_storage.c
... | ... | @@ -438,19 +438,19 @@ |
438 | 438 | } |
439 | 439 | |
440 | 440 | /* long wait for reset */ |
441 | - wait_ms(150); | |
441 | + mdelay(150); | |
442 | 442 | USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result, |
443 | 443 | us->pusb_dev->status); |
444 | 444 | pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); |
445 | 445 | result = usb_clear_halt(us->pusb_dev, pipe); |
446 | 446 | /* long wait for reset */ |
447 | - wait_ms(150); | |
447 | + mdelay(150); | |
448 | 448 | USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n", |
449 | 449 | result, us->pusb_dev->status); |
450 | 450 | /* long wait for reset */ |
451 | 451 | pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out); |
452 | 452 | result = usb_clear_halt(us->pusb_dev, pipe); |
453 | - wait_ms(150); | |
453 | + mdelay(150); | |
454 | 454 | USB_STOR_PRINTF("BBB_reset result %d: status %lX" |
455 | 455 | " clearing OUT endpoint\n", result, |
456 | 456 | us->pusb_dev->status); |
... | ... | @@ -478,7 +478,7 @@ |
478 | 478 | USB_CNTL_TIMEOUT * 5); |
479 | 479 | |
480 | 480 | /* long wait for reset */ |
481 | - wait_ms(1500); | |
481 | + mdelay(1500); | |
482 | 482 | USB_STOR_PRINTF("CB_reset result %d: status %lX" |
483 | 483 | " clearing endpoint halt\n", result, |
484 | 484 | us->pusb_dev->status); |
... | ... | @@ -621,7 +621,7 @@ |
621 | 621 | while (timeout--) { |
622 | 622 | if ((volatile int *) us->ip_wanted == 0) |
623 | 623 | break; |
624 | - wait_ms(10); | |
624 | + mdelay(10); | |
625 | 625 | } |
626 | 626 | if (us->ip_wanted) { |
627 | 627 | printf(" Did not get interrupt on CBI\n"); |
... | ... | @@ -692,7 +692,7 @@ |
692 | 692 | usb_stor_BBB_reset(us); |
693 | 693 | return USB_STOR_TRANSPORT_FAILED; |
694 | 694 | } |
695 | - wait_ms(5); | |
695 | + mdelay(5); | |
696 | 696 | pipein = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); |
697 | 697 | pipeout = usb_sndbulkpipe(us->pusb_dev, us->ep_out); |
698 | 698 | /* DATA phase + error handling */ |
... | ... | @@ -884,7 +884,7 @@ |
884 | 884 | srb->sense_buf[12], srb->sense_buf[13]); |
885 | 885 | return USB_STOR_TRANSPORT_FAILED; |
886 | 886 | } else { |
887 | - wait_ms(100); | |
887 | + mdelay(100); | |
888 | 888 | goto do_retry; |
889 | 889 | } |
890 | 890 | break; |
... | ... | @@ -960,7 +960,7 @@ |
960 | 960 | if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD) |
961 | 961 | return 0; |
962 | 962 | usb_request_sense(srb, ss); |
963 | - wait_ms(100); | |
963 | + mdelay(100); | |
964 | 964 | } while (retries--); |
965 | 965 | |
966 | 966 | return -1; |
drivers/usb/host/ehci-hcd.c
... | ... | @@ -776,7 +776,7 @@ |
776 | 776 | goto unknown; |
777 | 777 | } |
778 | 778 | |
779 | - wait_ms(1); | |
779 | + mdelay(1); | |
780 | 780 | len = min3(srclen, le16_to_cpu(req->length), length); |
781 | 781 | if (srcptr != NULL && len > 0) |
782 | 782 | memcpy(buffer, srcptr, len); |
... | ... | @@ -857,7 +857,7 @@ |
857 | 857 | ehci_writel(&hcor->or_configflag, cmd); |
858 | 858 | /* unblock posted write */ |
859 | 859 | cmd = ehci_readl(&hcor->or_usbcmd); |
860 | - wait_ms(5); | |
860 | + mdelay(5); | |
861 | 861 | reg = HC_VERSION(ehci_readl(&hccr->cr_capbase)); |
862 | 862 | printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff); |
863 | 863 |
drivers/usb/host/isp116x-hcd.c
... | ... | @@ -578,7 +578,7 @@ |
578 | 578 | /* When root hub or any of its ports is going |
579 | 579 | to come out of suspend, it may take more |
580 | 580 | than 10ms for status bits to stabilize. */ |
581 | - wait_ms(20); | |
581 | + mdelay(20); | |
582 | 582 | } |
583 | 583 | |
584 | 584 | if (intstat & HCINT_SO) { |
... | ... | @@ -679,7 +679,7 @@ |
679 | 679 | /* Pack data into FIFO ram */ |
680 | 680 | pack_fifo(isp116x, dev, pipe, ptd, 1, buffer, len); |
681 | 681 | #ifdef EXTRA_DELAY |
682 | - wait_ms(EXTRA_DELAY); | |
682 | + mdelay(EXTRA_DELAY); | |
683 | 683 | #endif |
684 | 684 | |
685 | 685 | /* Start the data transfer */ |
686 | 686 | |
... | ... | @@ -983,11 +983,11 @@ |
983 | 983 | HCRHPORT1 + wIndex - 1); |
984 | 984 | if (!(tmp & RH_PS_PRS)) |
985 | 985 | break; |
986 | - wait_ms(1); | |
986 | + mdelay(1); | |
987 | 987 | } |
988 | 988 | isp116x_write_reg32(isp116x, HCRHPORT1 + wIndex - 1, |
989 | 989 | RH_PS_PRS); |
990 | - wait_ms(10); | |
990 | + mdelay(10); | |
991 | 991 | |
992 | 992 | len = 0; |
993 | 993 | break; |
... | ... | @@ -1251,7 +1251,7 @@ |
1251 | 1251 | isp116x_write_reg32(isp116x, HCCMDSTAT, HCCMDSTAT_HCR); |
1252 | 1252 | while (--retries) { |
1253 | 1253 | /* It usually resets within 1 ms */ |
1254 | - wait_ms(1); | |
1254 | + mdelay(1); | |
1255 | 1255 | if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & HCCMDSTAT_HCR)) |
1256 | 1256 | break; |
1257 | 1257 | } |
... | ... | @@ -1278,7 +1278,7 @@ |
1278 | 1278 | clkrdy = isp116x_read_reg16(isp116x, HCuPINT) & HCuPINT_CLKRDY; |
1279 | 1279 | if (clkrdy) |
1280 | 1280 | break; |
1281 | - wait_ms(1); | |
1281 | + mdelay(1); | |
1282 | 1282 | } |
1283 | 1283 | if (!clkrdy) { |
1284 | 1284 | ERR("clock not ready after %dms", timeout); |
drivers/usb/host/ohci-hcd.c
... | ... | @@ -1279,7 +1279,7 @@ |
1279 | 1279 | pkt_print(NULL, dev, pipe, buffer, transfer_len, |
1280 | 1280 | cmd, "SUB(rh)", usb_pipein(pipe)); |
1281 | 1281 | #else |
1282 | - wait_ms(1); | |
1282 | + mdelay(1); | |
1283 | 1283 | #endif |
1284 | 1284 | if (usb_pipeint(pipe)) { |
1285 | 1285 | info("Root-Hub submit IRQ: NOT implemented"); |
... | ... | @@ -1360,7 +1360,7 @@ |
1360 | 1360 | OK(0); |
1361 | 1361 | case (RH_PORT_POWER): |
1362 | 1362 | WR_RH_PORTSTAT(RH_PS_PPS); |
1363 | - wait_ms(100); | |
1363 | + mdelay(100); | |
1364 | 1364 | OK(0); |
1365 | 1365 | case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/ |
1366 | 1366 | if (RD_RH_PORTSTAT & RH_PS_CCS) |
... | ... | @@ -1465,7 +1465,7 @@ |
1465 | 1465 | #ifdef DEBUG |
1466 | 1466 | ohci_dump_roothub(&gohci, 1); |
1467 | 1467 | #else |
1468 | - wait_ms(1); | |
1468 | + mdelay(1); | |
1469 | 1469 | #endif |
1470 | 1470 | |
1471 | 1471 | len = min_t(int, len, leni); |
... | ... | @@ -1478,7 +1478,7 @@ |
1478 | 1478 | pkt_print(NULL, dev, pipe, buffer, |
1479 | 1479 | transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/); |
1480 | 1480 | #else |
1481 | - wait_ms(1); | |
1481 | + mdelay(1); | |
1482 | 1482 | #endif |
1483 | 1483 | |
1484 | 1484 | return stat; |
... | ... | @@ -1516,7 +1516,7 @@ |
1516 | 1516 | pkt_print(urb, dev, pipe, buffer, transfer_len, |
1517 | 1517 | setup, "SUB", usb_pipein(pipe)); |
1518 | 1518 | #else |
1519 | - wait_ms(1); | |
1519 | + mdelay(1); | |
1520 | 1520 | #endif |
1521 | 1521 | if (!maxsize) { |
1522 | 1522 | err("submit_common_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1530,7 +1530,7 @@ |
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | #if 0 |
1533 | - wait_ms(10); | |
1533 | + mdelay(10); | |
1534 | 1534 | /* ohci_dump_status(&gohci); */ |
1535 | 1535 | #endif |
1536 | 1536 | |
... | ... | @@ -1560,7 +1560,7 @@ |
1560 | 1560 | } |
1561 | 1561 | |
1562 | 1562 | if (--timeout) { |
1563 | - wait_ms(1); | |
1563 | + mdelay(1); | |
1564 | 1564 | if (!urb->finished) |
1565 | 1565 | dbg("*"); |
1566 | 1566 | |
... | ... | @@ -1580,7 +1580,7 @@ |
1580 | 1580 | pkt_print(urb, dev, pipe, buffer, transfer_len, |
1581 | 1581 | setup, "RET(ctlr)", usb_pipein(pipe)); |
1582 | 1582 | #else |
1583 | - wait_ms(1); | |
1583 | + mdelay(1); | |
1584 | 1584 | #endif |
1585 | 1585 | |
1586 | 1586 | /* free TDs in urb_priv */ |
... | ... | @@ -1607,7 +1607,7 @@ |
1607 | 1607 | pkt_print(NULL, dev, pipe, buffer, transfer_len, |
1608 | 1608 | setup, "SUB", usb_pipein(pipe)); |
1609 | 1609 | #else |
1610 | - wait_ms(1); | |
1610 | + mdelay(1); | |
1611 | 1611 | #endif |
1612 | 1612 | if (!maxsize) { |
1613 | 1613 | err("submit_control_message: pipesize for pipe %lx is zero", |
... | ... | @@ -1677,7 +1677,7 @@ |
1677 | 1677 | ohci_writel(OHCI_OCR, &ohci->regs->cmdstatus); |
1678 | 1678 | info("USB HC TakeOver from SMM"); |
1679 | 1679 | while (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) { |
1680 | - wait_ms(10); | |
1680 | + mdelay(10); | |
1681 | 1681 | if (--smm_timeout == 0) { |
1682 | 1682 | err("USB HC TakeOver failed!"); |
1683 | 1683 | return -1; |
... | ... | @@ -1813,7 +1813,7 @@ |
1813 | 1813 | #ifdef DEBUG |
1814 | 1814 | ohci_dump(ohci, 1); |
1815 | 1815 | #else |
1816 | - wait_ms(1); | |
1816 | + mdelay(1); | |
1817 | 1817 | #endif |
1818 | 1818 | /* FIXME: be optimistic, hope that bug won't repeat often. */ |
1819 | 1819 | /* Make some non-interrupt context restart the controller. */ |
... | ... | @@ -1824,7 +1824,7 @@ |
1824 | 1824 | } |
1825 | 1825 | |
1826 | 1826 | if (ints & OHCI_INTR_WDH) { |
1827 | - wait_ms(1); | |
1827 | + mdelay(1); | |
1828 | 1828 | ohci_writel(OHCI_INTR_WDH, ®s->intrdisable); |
1829 | 1829 | (void)ohci_readl(®s->intrdisable); /* flush */ |
1830 | 1830 | stat = dl_done_list(&gohci); |
... | ... | @@ -1841,7 +1841,7 @@ |
1841 | 1841 | /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ |
1842 | 1842 | if (ints & OHCI_INTR_SF) { |
1843 | 1843 | unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1; |
1844 | - wait_ms(1); | |
1844 | + mdelay(1); | |
1845 | 1845 | ohci_writel(OHCI_INTR_SF, ®s->intrdisable); |
1846 | 1846 | if (ohci->ed_rm_list[frame] != NULL) |
1847 | 1847 | ohci_writel(OHCI_INTR_SF, ®s->intrenable); |
... | ... | @@ -1973,7 +1973,7 @@ |
1973 | 1973 | #ifdef DEBUG |
1974 | 1974 | ohci_dump(&gohci, 1); |
1975 | 1975 | #else |
1976 | - wait_ms(1); | |
1976 | + mdelay(1); | |
1977 | 1977 | #endif |
1978 | 1978 | ohci_inited = 1; |
1979 | 1979 | return 0; |
drivers/usb/host/r8a66597-hcd.c
... | ... | @@ -497,7 +497,7 @@ |
497 | 497 | |
498 | 498 | old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST); |
499 | 499 | while (count > 0) { |
500 | - wait_ms(R8A66597_RH_POLL_TIME); | |
500 | + mdelay(R8A66597_RH_POLL_TIME); | |
501 | 501 | |
502 | 502 | syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST); |
503 | 503 | if (syssts == old_syssts) { |
504 | 504 | |
505 | 505 | |
... | ... | @@ -511,11 +511,11 @@ |
511 | 511 | |
512 | 512 | static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port) |
513 | 513 | { |
514 | - wait_ms(10); | |
514 | + mdelay(10); | |
515 | 515 | r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port)); |
516 | - wait_ms(50); | |
516 | + mdelay(50); | |
517 | 517 | r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port)); |
518 | - wait_ms(50); | |
518 | + mdelay(50); | |
519 | 519 | } |
520 | 520 | |
521 | 521 | static int check_usb_device_connecting(struct r8a66597 *r8a66597) |
... | ... | @@ -823,7 +823,7 @@ |
823 | 823 | stat = USB_ST_STALLED; |
824 | 824 | } |
825 | 825 | |
826 | - wait_ms(1); | |
826 | + mdelay(1); | |
827 | 827 | |
828 | 828 | len = min_t(int, len, leni); |
829 | 829 | |
... | ... | @@ -918,7 +918,7 @@ |
918 | 918 | r8a66597->reg = CONFIG_R8A66597_BASE_ADDR; |
919 | 919 | |
920 | 920 | disable_controller(r8a66597); |
921 | - wait_ms(100); | |
921 | + mdelay(100); | |
922 | 922 | |
923 | 923 | enable_controller(r8a66597); |
924 | 924 | r8a66597_port_power(r8a66597, 0 , 1); |
... | ... | @@ -926,7 +926,7 @@ |
926 | 926 | /* check usb device */ |
927 | 927 | check_usb_device_connecting(r8a66597); |
928 | 928 | |
929 | - wait_ms(50); | |
929 | + mdelay(50); | |
930 | 930 | |
931 | 931 | return 0; |
932 | 932 | } |
include/usb.h
... | ... | @@ -199,7 +199,6 @@ |
199 | 199 | void *buffer, int transfer_len, int interval); |
200 | 200 | int usb_disable_asynch(int disable); |
201 | 201 | int usb_maxpacket(struct usb_device *dev, unsigned long pipe); |
202 | -inline void wait_ms(unsigned long ms); | |
203 | 202 | int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, |
204 | 203 | int cfgno); |
205 | 204 | int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, |