diff options
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r-- | drivers/usb/chipidea/core.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index ba4a2a1eb3ff..939c6ad71068 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -518,38 +518,6 @@ int hw_device_reset(struct ci_hdrc *ci) | |||
518 | return 0; | 518 | return 0; |
519 | } | 519 | } |
520 | 520 | ||
521 | /** | ||
522 | * hw_wait_reg: wait the register value | ||
523 | * | ||
524 | * Sometimes, it needs to wait register value before going on. | ||
525 | * Eg, when switch to device mode, the vbus value should be lower | ||
526 | * than OTGSC_BSV before connects to host. | ||
527 | * | ||
528 | * @ci: the controller | ||
529 | * @reg: register index | ||
530 | * @mask: mast bit | ||
531 | * @value: the bit value to wait | ||
532 | * @timeout_ms: timeout in millisecond | ||
533 | * | ||
534 | * This function returns an error code if timeout | ||
535 | */ | ||
536 | int hw_wait_reg(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask, | ||
537 | u32 value, unsigned int timeout_ms) | ||
538 | { | ||
539 | unsigned long elapse = jiffies + msecs_to_jiffies(timeout_ms); | ||
540 | |||
541 | while (hw_read(ci, reg, mask) != value) { | ||
542 | if (time_after(jiffies, elapse)) { | ||
543 | dev_err(ci->dev, "timeout waiting for %08x in %d\n", | ||
544 | mask, reg); | ||
545 | return -ETIMEDOUT; | ||
546 | } | ||
547 | msleep(20); | ||
548 | } | ||
549 | |||
550 | return 0; | ||
551 | } | ||
552 | |||
553 | static irqreturn_t ci_irq(int irq, void *data) | 521 | static irqreturn_t ci_irq(int irq, void *data) |
554 | { | 522 | { |
555 | struct ci_hdrc *ci = data; | 523 | struct ci_hdrc *ci = data; |