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>
master
Mike Frysinger 12 years ago committed by Marek Vasut
parent b974308105
commit 5b84dd67cf
  1. 28
      arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
  2. 2
      arch/arm/cpu/pxa/usb.c
  3. 28
      arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
  4. 6
      arch/powerpc/cpu/mpc5xxx/usb_ohci.c
  5. 6
      arch/powerpc/cpu/ppc4xx/usb_ohci.c
  6. 8
      arch/sparc/cpu/leon3/usb_uhci.c
  7. 2
      board/efikamx/efikamx-usb.c
  8. 4
      board/mcc200/auto_update.c
  9. 8
      board/mpl/common/usb_uhci.c
  10. 10
      board/renesas/sh7785lcr/selfcheck.c
  11. 16
      common/usb.c
  12. 10
      common/usb_hub.c
  13. 16
      common/usb_storage.c
  14. 4
      drivers/usb/host/ehci-hcd.c
  15. 12
      drivers/usb/host/isp116x-hcd.c
  16. 28
      drivers/usb/host/ohci-hcd.c
  17. 14
      drivers/usb/host/r8a66597-hcd.c
  18. 1
      include/usb.h

@ -1057,7 +1057,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)",
usb_pipein(pipe)); usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (usb_pipeint(pipe)) { if (usb_pipeint(pipe)) {
info("Root-Hub submit IRQ: NOT implemented"); info("Root-Hub submit IRQ: NOT implemented");
@ -1260,7 +1260,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
#ifdef DEBUG #ifdef DEBUG
ohci_dump_roothub(&gohci, 1); ohci_dump_roothub(&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
len = min_t(int, len, leni); len = min_t(int, len, leni);
@ -1275,7 +1275,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)",
0 /*usb_pipein(pipe) */); 0 /*usb_pipein(pipe) */);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
return stat; return stat;
@ -1302,7 +1302,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB",
usb_pipein(pipe)); usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_common_message: pipesize for pipe %lx is zero", err("submit_common_message: pipesize for pipe %lx is zero",
@ -1316,7 +1316,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
return -1; return -1;
} }
wait_ms(10); mdelay(10);
/* ohci_dump_status(&gohci); */ /* ohci_dump_status(&gohci); */
/* allow more time for a BULK device to react - some are slow */ /* allow more time for a BULK device to react - some are slow */
@ -1351,7 +1351,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
} }
if (--timeout) { if (--timeout) {
wait_ms(1); mdelay(1);
if (!urb_finished) if (!urb_finished)
dbg("\%"); dbg("\%");
@ -1396,7 +1396,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)",
usb_pipein(pipe)); usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* free TDs in urb_priv */ /* free TDs in urb_priv */
@ -1423,7 +1423,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB",
usb_pipein(pipe)); usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_control_message: pipesize for pipe %lx is zero", err("submit_control_message: pipesize for pipe %lx is zero",
@ -1463,7 +1463,7 @@ static int hc_reset(struct ohci *ohci)
writel(OHCI_OCR, &ohci->regs->cmdstatus); writel(OHCI_OCR, &ohci->regs->cmdstatus);
info("USB HC TakeOver from SMM"); info("USB HC TakeOver from SMM");
while (readl(&ohci->regs->control) & OHCI_CTRL_IR) { while (readl(&ohci->regs->control) & OHCI_CTRL_IR) {
wait_ms(10); mdelay(10);
if (--smm_timeout == 0) { if (--smm_timeout == 0) {
err("USB HC TakeOver failed!"); err("USB HC TakeOver failed!");
return -1; return -1;
@ -1600,7 +1600,7 @@ static int hc_interrupt(void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump(ohci, 1); ohci_dump(ohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* FIXME: be optimistic, hope that bug won't repeat often. */ /* FIXME: be optimistic, hope that bug won't repeat often. */
/* Make some non-interrupt context restart the controller. */ /* Make some non-interrupt context restart the controller. */
@ -1611,7 +1611,7 @@ static int hc_interrupt(void)
} }
if (ints & OHCI_INTR_WDH) { if (ints & OHCI_INTR_WDH) {
wait_ms(1); mdelay(1);
writel(OHCI_INTR_WDH, &regs->intrdisable); writel(OHCI_INTR_WDH, &regs->intrdisable);
stat = dl_done_list(&gohci, dl_reverse_done_list(&gohci)); stat = dl_done_list(&gohci, dl_reverse_done_list(&gohci));
@ -1627,7 +1627,7 @@ static int hc_interrupt(void)
/* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
if (ints & OHCI_INTR_SF) { if (ints & OHCI_INTR_SF) {
unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1; unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1;
wait_ms(1); mdelay(1);
writel(OHCI_INTR_SF, &regs->intrdisable); writel(OHCI_INTR_SF, &regs->intrdisable);
if (ohci->ed_rm_list[frame] != NULL) if (ohci->ed_rm_list[frame] != NULL)
writel(OHCI_INTR_SF, &regs->intrenable); writel(OHCI_INTR_SF, &regs->intrenable);
@ -1718,7 +1718,7 @@ int usb_lowlevel_init(void)
/* FIXME this is a second HC reset; why?? */ /* FIXME this is a second HC reset; why?? */
gohci.hc_control = OHCI_USB_RESET; gohci.hc_control = OHCI_USB_RESET;
writel(gohci.hc_control, &gohci.regs->control); writel(gohci.hc_control, &gohci.regs->control);
wait_ms(10); mdelay(10);
if (hc_start(&gohci) < 0) { if (hc_start(&gohci) < 0) {
err("can't start usb-%s", gohci.slot_name); err("can't start usb-%s", gohci.slot_name);
@ -1730,7 +1730,7 @@ int usb_lowlevel_init(void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump(&gohci, 1); ohci_dump(&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
ohci_inited = 1; ohci_inited = 1;
urb_finished = 1; urb_finished = 1;

@ -48,7 +48,7 @@ int usb_cpu_init(void)
#endif #endif
writel(readl(UHCHR) | UHCHR_FHR, UHCHR); writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
wait_ms(11); mdelay(11);
writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR); writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR); writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);

@ -1012,7 +1012,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
urb_priv.actual_length = 0; urb_priv.actual_length = 0;
pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe)); pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (usb_pipeint(pipe)) { if (usb_pipeint(pipe)) {
info("Root-Hub submit IRQ: NOT implemented"); info("Root-Hub submit IRQ: NOT implemented");
@ -1189,7 +1189,7 @@ pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
#ifdef DEBUG #ifdef DEBUG
ohci_dump_roothub (&gohci, 1); ohci_dump_roothub (&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
len = min_t(int, len, leni); len = min_t(int, len, leni);
@ -1203,7 +1203,7 @@ pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
urb_priv.actual_length = transfer_len; urb_priv.actual_length = transfer_len;
pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/); pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
return stat; return stat;
@ -1230,7 +1230,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
urb_priv.actual_length = 0; urb_priv.actual_length = 0;
pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe)); pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_common_message: pipesize for pipe %lx is zero", err("submit_common_message: pipesize for pipe %lx is zero",
@ -1243,7 +1243,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
return -1; return -1;
} }
wait_ms(10); mdelay(10);
/* ohci_dump_status(&gohci); */ /* ohci_dump_status(&gohci); */
/* allow more time for a BULK device to react - some are slow */ /* allow more time for a BULK device to react - some are slow */
@ -1267,7 +1267,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
break; break;
} }
if (--timeout) { if (--timeout) {
udelay(250); /* wait_ms(1); */ udelay(250); /* mdelay(1); */
} else { } else {
err("CTL:TIMEOUT "); err("CTL:TIMEOUT ");
stat = USB_ST_CRC_ERR; stat = USB_ST_CRC_ERR;
@ -1302,7 +1302,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
#ifdef DEBUG #ifdef DEBUG
pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe)); pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* free TDs in urb_priv */ /* free TDs in urb_priv */
@ -1328,7 +1328,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
urb_priv.actual_length = 0; urb_priv.actual_length = 0;
pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe)); pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_control_message: pipesize for pipe %lx is zero", err("submit_control_message: pipesize for pipe %lx is zero",
@ -1367,7 +1367,7 @@ static int hc_reset (ohci_t *ohci)
writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
info("USB HC TakeOver from SMM"); info("USB HC TakeOver from SMM");
while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
wait_ms (10); mdelay (10);
if (--smm_timeout == 0) { if (--smm_timeout == 0) {
err("USB HC TakeOver failed!"); err("USB HC TakeOver failed!");
return -1; return -1;
@ -1490,7 +1490,7 @@ hc_interrupt (void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump (ohci, 1); ohci_dump (ohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* FIXME: be optimistic, hope that bug won't repeat often. */ /* FIXME: be optimistic, hope that bug won't repeat often. */
/* Make some non-interrupt context restart the controller. */ /* Make some non-interrupt context restart the controller. */
@ -1501,7 +1501,7 @@ hc_interrupt (void)
} }
if (ints & OHCI_INTR_WDH) { if (ints & OHCI_INTR_WDH) {
wait_ms(1); mdelay(1);
writel (OHCI_INTR_WDH, &regs->intrdisable); writel (OHCI_INTR_WDH, &regs->intrdisable);
stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci)); stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
writel (OHCI_INTR_WDH, &regs->intrenable); writel (OHCI_INTR_WDH, &regs->intrenable);
@ -1516,7 +1516,7 @@ hc_interrupt (void)
/* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
if (ints & OHCI_INTR_SF) { if (ints & OHCI_INTR_SF) {
unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1; unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1;
wait_ms(1); mdelay(1);
writel (OHCI_INTR_SF, &regs->intrdisable); writel (OHCI_INTR_SF, &regs->intrdisable);
if (ohci->ed_rm_list[frame] != NULL) if (ohci->ed_rm_list[frame] != NULL)
writel (OHCI_INTR_SF, &regs->intrenable); writel (OHCI_INTR_SF, &regs->intrenable);
@ -1686,7 +1686,7 @@ int usb_lowlevel_init(void)
/* FIXME this is a second HC reset; why?? */ /* FIXME this is a second HC reset; why?? */
writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control); writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
wait_ms (10); mdelay (10);
if (hc_start (&gohci) < 0) if (hc_start (&gohci) < 0)
goto errout; goto errout;
@ -1694,7 +1694,7 @@ int usb_lowlevel_init(void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump (&gohci, 1); ohci_dump (&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
ohci_inited = 1; ohci_inited = 1;
return 0; return 0;

@ -1269,7 +1269,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
} }
if (--timeout) { if (--timeout) {
wait_ms(1); mdelay(1);
if (!urb_finished) if (!urb_finished)
dbg("\%"); dbg("\%");
@ -1372,7 +1372,7 @@ static int hc_reset (ohci_t *ohci)
writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
info("USB HC TakeOver from SMM"); info("USB HC TakeOver from SMM");
while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
wait_ms (10); mdelay (10);
if (--smm_timeout == 0) { if (--smm_timeout == 0) {
err("USB HC TakeOver failed!"); err("USB HC TakeOver failed!");
return -1; return -1;
@ -1529,7 +1529,7 @@ hc_interrupt (void)
/* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
if (ints & OHCI_INTR_SF) { if (ints & OHCI_INTR_SF) {
unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1; unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1;
wait_ms(1); mdelay(1);
writel (OHCI_INTR_SF, &regs->intrdisable); writel (OHCI_INTR_SF, &regs->intrdisable);
if (ohci->ed_rm_list[frame] != NULL) if (ohci->ed_rm_list[frame] != NULL)
writel (OHCI_INTR_SF, &regs->intrenable); writel (OHCI_INTR_SF, &regs->intrenable);

@ -1274,7 +1274,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
} }
if (--timeout) { if (--timeout) {
wait_ms(1); mdelay(1);
if (!urb_finished) if (!urb_finished)
dbg("\%"); dbg("\%");
@ -1377,7 +1377,7 @@ static int hc_reset (ohci_t *ohci)
writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
info("USB HC TakeOver from SMM"); info("USB HC TakeOver from SMM");
while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
wait_ms (10); mdelay (10);
if (--smm_timeout == 0) { if (--smm_timeout == 0) {
err("USB HC TakeOver failed!"); err("USB HC TakeOver failed!");
return -1; return -1;
@ -1534,7 +1534,7 @@ hc_interrupt (void)
/* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
if (ints & OHCI_INTR_SF) { if (ints & OHCI_INTR_SF) {
unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1; unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1;
wait_ms(1); mdelay(1);
writel (OHCI_INTR_SF, &regs->intrdisable); writel (OHCI_INTR_SF, &regs->intrdisable);
if (ohci->ed_rm_list[frame] != NULL) if (ohci->ed_rm_list[frame] != NULL)
writel (OHCI_INTR_SF, &regs->intrenable); writel (OHCI_INTR_SF, &regs->intrenable);

@ -515,9 +515,9 @@ void reset_hc(void)
out16r(usb_base_addr + USBCMD, USBCMD_GRESET | USBCMD_RS); out16r(usb_base_addr + USBCMD, USBCMD_GRESET | USBCMD_RS);
/* Turn off all interrupts */ /* Turn off all interrupts */
out16r(usb_base_addr + USBINTR, 0); out16r(usb_base_addr + USBINTR, 0);
wait_ms(50); mdelay(50);
out16r(usb_base_addr + USBCMD, 0); out16r(usb_base_addr + USBCMD, 0);
wait_ms(10); mdelay(10);
} }
void start_hc(void) void start_hc(void)
@ -1044,7 +1044,7 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
status = (status & 0xfff5) | USBPORTSC_PR; status = (status & 0xfff5) | USBPORTSC_PR;
out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
status); status);
wait_ms(10); mdelay(10);
status = (status & 0xfff5) & ~USBPORTSC_PR; status = (status & 0xfff5) & ~USBPORTSC_PR;
out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
status); status);
@ -1052,7 +1052,7 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
status = (status & 0xfff5) | USBPORTSC_PE; status = (status & 0xfff5) | USBPORTSC_PE;
out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
status); status);
wait_ms(10); mdelay(10);
status = (status & 0xfff5) | 0xa; status = (status & 0xfff5) | 0xa;
out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1), out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
status); status);

@ -187,7 +187,7 @@ void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS); ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
wait_ms(50); mdelay(50);
/* terminate the reset */ /* terminate the reset */
*reg = ehci_readl(status_reg); *reg = ehci_readl(status_reg);

@ -284,7 +284,7 @@ int au_do_update(int idx, long sz)
*/ */
debug ("flash_sect_erase(%lx, %lx);\n", start, end); debug ("flash_sect_erase(%lx, %lx);\n", start, end);
flash_sect_erase(start, end); flash_sect_erase(start, end);
wait_ms(100); mdelay(100);
#ifdef CONFIG_PROGRESSBAR #ifdef CONFIG_PROGRESSBAR
show_progress(end - start, totsize); show_progress(end - start, totsize);
#endif #endif
@ -352,7 +352,7 @@ int do_auto_update(void)
* Read keypad status * Read keypad status
*/ */
i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status1, 2); i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status1, 2);
wait_ms(500); mdelay(500);
i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status2, 2); i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status2, 2);
/* /*

@ -435,9 +435,9 @@ void reset_hc(void)
out16r( usb_base_addr + USBCMD,USBCMD_GRESET | USBCMD_RS); out16r( usb_base_addr + USBCMD,USBCMD_GRESET | USBCMD_RS);
/* Turn off all interrupts */ /* Turn off all interrupts */
out16r(usb_base_addr + USBINTR,0); out16r(usb_base_addr + USBINTR,0);
wait_ms(50); mdelay(50);
out16r( usb_base_addr + USBCMD,0); out16r( usb_base_addr + USBCMD,0);
wait_ms(10); mdelay(10);
} }
void start_hc(void) void start_hc(void)
@ -926,13 +926,13 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
status = in16r(usb_base_addr+USBPORTSC1+2*(wIndex-1)); status = in16r(usb_base_addr+USBPORTSC1+2*(wIndex-1));
status = (status & 0xfff5) | USBPORTSC_PR; status = (status & 0xfff5) | USBPORTSC_PR;
out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
wait_ms(10); mdelay(10);
status = (status & 0xfff5) & ~USBPORTSC_PR; status = (status & 0xfff5) & ~USBPORTSC_PR;
out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
udelay(10); udelay(10);
status = (status & 0xfff5) | USBPORTSC_PE; status = (status & 0xfff5) | USBPORTSC_PE;
out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
wait_ms(10); mdelay(10);
status = (status & 0xfff5) | 0xa; status = (status & 0xfff5) | 0xa;
out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status); out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
len=0; len=0;

@ -33,12 +33,6 @@
#define SM107_DEVICEID (0x13e00060 + NOCACHE_OFFSET) #define SM107_DEVICEID (0x13e00060 + NOCACHE_OFFSET)
static void wait_ms(unsigned long time)
{
while (time--)
udelay(1000);
}
static void test_pld(void) static void test_pld(void)
{ {
printf("PLD version = %04x\n", readb(PLD_VERSR)); printf("PLD version = %04x\n", readb(PLD_VERSR));
@ -53,10 +47,10 @@ static void test_led(void)
{ {
printf("turn on LEDs 3, 5, 7, 9\n"); printf("turn on LEDs 3, 5, 7, 9\n");
writeb(0x55, PLD_LEDCR); writeb(0x55, PLD_LEDCR);
wait_ms(2000); mdelay(2000);
printf("turn on LEDs 4, 6, 8, 10\n"); printf("turn on LEDs 4, 6, 8, 10\n");
writeb(0xaa, PLD_LEDCR); writeb(0xaa, PLD_LEDCR);
wait_ms(2000); mdelay(2000);
writeb(0x00, PLD_LEDCR); writeb(0x00, PLD_LEDCR);
} }

@ -81,16 +81,6 @@ char usb_started; /* flag for the started/stopped USB status */
*/ */
static void usb_scan_devices(void); static void usb_scan_devices(void);
/***********************************************************************
* wait_ms
*/
inline void wait_ms(unsigned long ms)
{
while (ms-- > 0)
udelay(1000);
}
/*************************************************************************** /***************************************************************************
* Init USB Device * Init USB Device
*/ */
@ -209,7 +199,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
while (timeout--) { while (timeout--) {
if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC)) if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
break; break;
wait_ms(1); mdelay(1);
} }
if (dev->status) if (dev->status)
return -1; return -1;
@ -233,7 +223,7 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
while (timeout--) { while (timeout--) {
if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC)) if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
break; break;
wait_ms(1); mdelay(1);
} }
*actual_length = dev->act_len; *actual_length = dev->act_len;
if (dev->status == 0) if (dev->status == 0)
@ -897,7 +887,7 @@ int usb_new_device(struct usb_device *dev)
return 1; return 1;
} }
wait_ms(10); /* Let the SET_ADDRESS settle */ mdelay(10); /* Let the SET_ADDRESS settle */
tmp = sizeof(dev->descriptor); tmp = sizeof(dev->descriptor);

@ -120,7 +120,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
} }
/* Wait at least 100 msec for power to become stable */ /* Wait at least 100 msec for power to become stable */
wait_ms(max(pgood_delay, (unsigned)100)); mdelay(max(pgood_delay, (unsigned)100));
} }
void usb_hub_reset(void) void usb_hub_reset(void)
@ -160,7 +160,7 @@ int hub_port_reset(struct usb_device *dev, int port,
for (tries = 0; tries < MAX_TRIES; tries++) { for (tries = 0; tries < MAX_TRIES; tries++) {
usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET); usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET);
wait_ms(200); mdelay(200);
if (usb_get_port_status(dev, port + 1, &portsts) < 0) { if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
USB_HUB_PRINTF("get_port_status failed status %lX\n", USB_HUB_PRINTF("get_port_status failed status %lX\n",
@ -187,7 +187,7 @@ int hub_port_reset(struct usb_device *dev, int port,
if (portstatus & USB_PORT_STAT_ENABLE) if (portstatus & USB_PORT_STAT_ENABLE)
break; break;
wait_ms(200); mdelay(200);
} }
if (tries == MAX_TRIES) { if (tries == MAX_TRIES) {
@ -232,7 +232,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
if (!(portstatus & USB_PORT_STAT_CONNECTION)) if (!(portstatus & USB_PORT_STAT_CONNECTION))
return; return;
} }
wait_ms(200); mdelay(200);
/* Reset the port */ /* Reset the port */
if (hub_port_reset(dev, port, &portstatus) < 0) { if (hub_port_reset(dev, port, &portstatus) < 0) {
@ -240,7 +240,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
return; return;
} }
wait_ms(200); mdelay(200);
/* Allocate a new device struct for it */ /* Allocate a new device struct for it */
usb = usb_alloc_new_device(); usb = usb_alloc_new_device();

@ -438,19 +438,19 @@ static int usb_stor_BBB_reset(struct us_data *us)
} }
/* long wait for reset */ /* long wait for reset */
wait_ms(150); mdelay(150);
USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result, USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result,
us->pusb_dev->status); us->pusb_dev->status);
pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
result = usb_clear_halt(us->pusb_dev, pipe); result = usb_clear_halt(us->pusb_dev, pipe);
/* long wait for reset */ /* long wait for reset */
wait_ms(150); mdelay(150);
USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n", USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n",
result, us->pusb_dev->status); result, us->pusb_dev->status);
/* long wait for reset */ /* long wait for reset */
pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out); pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
result = usb_clear_halt(us->pusb_dev, pipe); result = usb_clear_halt(us->pusb_dev, pipe);
wait_ms(150); mdelay(150);
USB_STOR_PRINTF("BBB_reset result %d: status %lX" USB_STOR_PRINTF("BBB_reset result %d: status %lX"
" clearing OUT endpoint\n", result, " clearing OUT endpoint\n", result,
us->pusb_dev->status); us->pusb_dev->status);
@ -478,7 +478,7 @@ static int usb_stor_CB_reset(struct us_data *us)
USB_CNTL_TIMEOUT * 5); USB_CNTL_TIMEOUT * 5);
/* long wait for reset */ /* long wait for reset */
wait_ms(1500); mdelay(1500);
USB_STOR_PRINTF("CB_reset result %d: status %lX" USB_STOR_PRINTF("CB_reset result %d: status %lX"
" clearing endpoint halt\n", result, " clearing endpoint halt\n", result,
us->pusb_dev->status); us->pusb_dev->status);
@ -621,7 +621,7 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
while (timeout--) { while (timeout--) {
if ((volatile int *) us->ip_wanted == 0) if ((volatile int *) us->ip_wanted == 0)
break; break;
wait_ms(10); mdelay(10);
} }
if (us->ip_wanted) { if (us->ip_wanted) {
printf(" Did not get interrupt on CBI\n"); printf(" Did not get interrupt on CBI\n");
@ -692,7 +692,7 @@ int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
usb_stor_BBB_reset(us); usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} }
wait_ms(5); mdelay(5);
pipein = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); pipein = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
pipeout = usb_sndbulkpipe(us->pusb_dev, us->ep_out); pipeout = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
/* DATA phase + error handling */ /* DATA phase + error handling */
@ -884,7 +884,7 @@ do_retry:
srb->sense_buf[12], srb->sense_buf[13]); srb->sense_buf[12], srb->sense_buf[13]);
return USB_STOR_TRANSPORT_FAILED; return USB_STOR_TRANSPORT_FAILED;
} else { } else {
wait_ms(100); mdelay(100);
goto do_retry; goto do_retry;
} }
break; break;
@ -960,7 +960,7 @@ static int usb_test_unit_ready(ccb *srb, struct us_data *ss)
if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD) if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
return 0; return 0;
usb_request_sense(srb, ss); usb_request_sense(srb, ss);
wait_ms(100); mdelay(100);
} while (retries--); } while (retries--);
return -1; return -1;

@ -776,7 +776,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
goto unknown; goto unknown;
} }
wait_ms(1); mdelay(1);
len = min3(srclen, le16_to_cpu(req->length), length); len = min3(srclen, le16_to_cpu(req->length), length);
if (srcptr != NULL && len > 0) if (srcptr != NULL && len > 0)
memcpy(buffer, srcptr, len); memcpy(buffer, srcptr, len);
@ -857,7 +857,7 @@ int usb_lowlevel_init(void)
ehci_writel(&hcor->or_configflag, cmd); ehci_writel(&hcor->or_configflag, cmd);
/* unblock posted write */ /* unblock posted write */
cmd = ehci_readl(&hcor->or_usbcmd); cmd = ehci_readl(&hcor->or_usbcmd);
wait_ms(5); mdelay(5);
reg = HC_VERSION(ehci_readl(&hccr->cr_capbase)); reg = HC_VERSION(ehci_readl(&hccr->cr_capbase));
printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff); printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);

@ -578,7 +578,7 @@ static int isp116x_interrupt(struct isp116x *isp116x)
/* When root hub or any of its ports is going /* When root hub or any of its ports is going
to come out of suspend, it may take more to come out of suspend, it may take more
than 10ms for status bits to stabilize. */ than 10ms for status bits to stabilize. */
wait_ms(20); mdelay(20);
} }
if (intstat & HCINT_SO) { if (intstat & HCINT_SO) {
@ -679,7 +679,7 @@ retry_same:
/* Pack data into FIFO ram */ /* Pack data into FIFO ram */
pack_fifo(isp116x, dev, pipe, ptd, 1, buffer, len); pack_fifo(isp116x, dev, pipe, ptd, 1, buffer, len);
#ifdef EXTRA_DELAY #ifdef EXTRA_DELAY
wait_ms(EXTRA_DELAY); mdelay(EXTRA_DELAY);
#endif #endif
/* Start the data transfer */ /* Start the data transfer */
@ -983,11 +983,11 @@ static int isp116x_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
HCRHPORT1 + wIndex - 1); HCRHPORT1 + wIndex - 1);
if (!(tmp & RH_PS_PRS)) if (!(tmp & RH_PS_PRS))
break; break;
wait_ms(1); mdelay(1);
} }
isp116x_write_reg32(isp116x, HCRHPORT1 + wIndex - 1, isp116x_write_reg32(isp116x, HCRHPORT1 + wIndex - 1,
RH_PS_PRS); RH_PS_PRS);
wait_ms(10); mdelay(10);
len = 0; len = 0;
break; break;
@ -1251,7 +1251,7 @@ static int isp116x_sw_reset(struct isp116x *isp116x)
isp116x_write_reg32(isp116x, HCCMDSTAT, HCCMDSTAT_HCR); isp116x_write_reg32(isp116x, HCCMDSTAT, HCCMDSTAT_HCR);
while (--retries) { while (--retries) {
/* It usually resets within 1 ms */ /* It usually resets within 1 ms */
wait_ms(1); mdelay(1);
if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & HCCMDSTAT_HCR)) if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & HCCMDSTAT_HCR))
break; break;
} }
@ -1278,7 +1278,7 @@ static int isp116x_reset(struct isp116x *isp116x)
clkrdy = isp116x_read_reg16(isp116x, HCuPINT) & HCuPINT_CLKRDY; clkrdy = isp116x_read_reg16(isp116x, HCuPINT) & HCuPINT_CLKRDY;
if (clkrdy) if (clkrdy)
break; break;
wait_ms(1); mdelay(1);
} }
if (!clkrdy) { if (!clkrdy) {
ERR("clock not ready after %dms", timeout); ERR("clock not ready after %dms", timeout);

@ -1279,7 +1279,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
pkt_print(NULL, dev, pipe, buffer, transfer_len, pkt_print(NULL, dev, pipe, buffer, transfer_len,
cmd, "SUB(rh)", usb_pipein(pipe)); cmd, "SUB(rh)", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (usb_pipeint(pipe)) { if (usb_pipeint(pipe)) {
info("Root-Hub submit IRQ: NOT implemented"); info("Root-Hub submit IRQ: NOT implemented");
@ -1360,7 +1360,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
OK(0); OK(0);
case (RH_PORT_POWER): case (RH_PORT_POWER):
WR_RH_PORTSTAT(RH_PS_PPS); WR_RH_PORTSTAT(RH_PS_PPS);
wait_ms(100); mdelay(100);
OK(0); OK(0);
case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/ case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
if (RD_RH_PORTSTAT & RH_PS_CCS) if (RD_RH_PORTSTAT & RH_PS_CCS)
@ -1465,7 +1465,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
#ifdef DEBUG #ifdef DEBUG
ohci_dump_roothub(&gohci, 1); ohci_dump_roothub(&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
len = min_t(int, len, leni); len = min_t(int, len, leni);
@ -1478,7 +1478,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
pkt_print(NULL, dev, pipe, buffer, pkt_print(NULL, dev, pipe, buffer,
transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/); transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
return stat; return stat;
@ -1516,7 +1516,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(urb, dev, pipe, buffer, transfer_len, pkt_print(urb, dev, pipe, buffer, transfer_len,
setup, "SUB", usb_pipein(pipe)); setup, "SUB", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_common_message: pipesize for pipe %lx is zero", err("submit_common_message: pipesize for pipe %lx is zero",
@ -1530,7 +1530,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
} }
#if 0 #if 0
wait_ms(10); mdelay(10);
/* ohci_dump_status(&gohci); */ /* ohci_dump_status(&gohci); */
#endif #endif
@ -1560,7 +1560,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
} }
if (--timeout) { if (--timeout) {
wait_ms(1); mdelay(1);
if (!urb->finished) if (!urb->finished)
dbg("*"); dbg("*");
@ -1580,7 +1580,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(urb, dev, pipe, buffer, transfer_len, pkt_print(urb, dev, pipe, buffer, transfer_len,
setup, "RET(ctlr)", usb_pipein(pipe)); setup, "RET(ctlr)", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* free TDs in urb_priv */ /* free TDs in urb_priv */
@ -1607,7 +1607,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
pkt_print(NULL, dev, pipe, buffer, transfer_len, pkt_print(NULL, dev, pipe, buffer, transfer_len,
setup, "SUB", usb_pipein(pipe)); setup, "SUB", usb_pipein(pipe));
#else #else
wait_ms(1); mdelay(1);
#endif #endif
if (!maxsize) { if (!maxsize) {
err("submit_control_message: pipesize for pipe %lx is zero", err("submit_control_message: pipesize for pipe %lx is zero",
@ -1677,7 +1677,7 @@ static int hc_reset(ohci_t *ohci)
ohci_writel(OHCI_OCR, &ohci->regs->cmdstatus); ohci_writel(OHCI_OCR, &ohci->regs->cmdstatus);
info("USB HC TakeOver from SMM"); info("USB HC TakeOver from SMM");
while (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) { while (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) {
wait_ms(10); mdelay(10);
if (--smm_timeout == 0) { if (--smm_timeout == 0) {
err("USB HC TakeOver failed!"); err("USB HC TakeOver failed!");
return -1; return -1;
@ -1813,7 +1813,7 @@ static int hc_interrupt(void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump(ohci, 1); ohci_dump(ohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
/* FIXME: be optimistic, hope that bug won't repeat often. */ /* FIXME: be optimistic, hope that bug won't repeat often. */
/* Make some non-interrupt context restart the controller. */ /* Make some non-interrupt context restart the controller. */
@ -1824,7 +1824,7 @@ static int hc_interrupt(void)
} }
if (ints & OHCI_INTR_WDH) { if (ints & OHCI_INTR_WDH) {
wait_ms(1); mdelay(1);
ohci_writel(OHCI_INTR_WDH, &regs->intrdisable); ohci_writel(OHCI_INTR_WDH, &regs->intrdisable);
(void)ohci_readl(&regs->intrdisable); /* flush */ (void)ohci_readl(&regs->intrdisable); /* flush */
stat = dl_done_list(&gohci); stat = dl_done_list(&gohci);
@ -1841,7 +1841,7 @@ static int hc_interrupt(void)
/* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
if (ints & OHCI_INTR_SF) { if (ints & OHCI_INTR_SF) {
unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1; unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1;
wait_ms(1); mdelay(1);
ohci_writel(OHCI_INTR_SF, &regs->intrdisable); ohci_writel(OHCI_INTR_SF, &regs->intrdisable);
if (ohci->ed_rm_list[frame] != NULL) if (ohci->ed_rm_list[frame] != NULL)
ohci_writel(OHCI_INTR_SF, &regs->intrenable); ohci_writel(OHCI_INTR_SF, &regs->intrenable);
@ -1973,7 +1973,7 @@ int usb_lowlevel_init(void)
#ifdef DEBUG #ifdef DEBUG
ohci_dump(&gohci, 1); ohci_dump(&gohci, 1);
#else #else
wait_ms(1); mdelay(1);
#endif #endif
ohci_inited = 1; ohci_inited = 1;
return 0; return 0;

@ -497,7 +497,7 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST); old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
while (count > 0) { while (count > 0) {
wait_ms(R8A66597_RH_POLL_TIME); mdelay(R8A66597_RH_POLL_TIME);
syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST); syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
if (syssts == old_syssts) { if (syssts == old_syssts) {
@ -511,11 +511,11 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port) static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port)
{ {
wait_ms(10); mdelay(10);
r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port)); r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port));
wait_ms(50); mdelay(50);
r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port)); r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port));
wait_ms(50); mdelay(50);
} }
static int check_usb_device_connecting(struct r8a66597 *r8a66597) static int check_usb_device_connecting(struct r8a66597 *r8a66597)
@ -823,7 +823,7 @@ static int r8a66597_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
stat = USB_ST_STALLED; stat = USB_ST_STALLED;
} }
wait_ms(1); mdelay(1);
len = min_t(int, len, leni); len = min_t(int, len, leni);
@ -918,7 +918,7 @@ int usb_lowlevel_init(void)
r8a66597->reg = CONFIG_R8A66597_BASE_ADDR; r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
disable_controller(r8a66597); disable_controller(r8a66597);
wait_ms(100); mdelay(100);
enable_controller(r8a66597); enable_controller(r8a66597);
r8a66597_port_power(r8a66597, 0 , 1); r8a66597_port_power(r8a66597, 0 , 1);
@ -926,7 +926,7 @@ int usb_lowlevel_init(void)
/* check usb device */ /* check usb device */
check_usb_device_connecting(r8a66597); check_usb_device_connecting(r8a66597);
wait_ms(50); mdelay(50);
return 0; return 0;
} }

@ -199,7 +199,6 @@ int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
void *buffer, int transfer_len, int interval); void *buffer, int transfer_len, int interval);
int usb_disable_asynch(int disable); int usb_disable_asynch(int disable);
int usb_maxpacket(struct usb_device *dev, unsigned long pipe); int usb_maxpacket(struct usb_device *dev, unsigned long pipe);
inline void wait_ms(unsigned long ms);
int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer, int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer,
int cfgno); int cfgno);
int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type,

Loading…
Cancel
Save