Commit 42c0bf1c authored by Felipe Balbi's avatar Felipe Balbi

usb: otg: prefix otg_state_string with usb_

all other functions under drivers/usb/ start
with usb_, let's do the same thing.

This patch is in preparation for moving otg_state_string
to usb-common.c and deleting otg.c completely.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6a1e3ef4
...@@ -149,7 +149,7 @@ static void otg_timer(unsigned long _musb) ...@@ -149,7 +149,7 @@ static void otg_timer(unsigned long _musb)
*/ */
devctl = musb_readb(mregs, MUSB_DEVCTL); devctl = musb_readb(mregs, MUSB_DEVCTL);
dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -195,7 +195,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -195,7 +195,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
if (musb->is_active || (musb->a_wait_bcon == 0 && if (musb->is_active || (musb->a_wait_bcon == 0 &&
musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) { musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
dev_dbg(musb->controller, "%s active, deleting timer\n", dev_dbg(musb->controller, "%s active, deleting timer\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
del_timer(&otg_workaround); del_timer(&otg_workaround);
last_timer = jiffies; last_timer = jiffies;
return; return;
...@@ -208,7 +208,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -208,7 +208,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
last_timer = timeout; last_timer = timeout;
dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n", dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
jiffies_to_msecs(timeout - jiffies)); jiffies_to_msecs(timeout - jiffies));
mod_timer(&otg_workaround, timeout); mod_timer(&otg_workaround, timeout);
} }
...@@ -298,7 +298,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci) ...@@ -298,7 +298,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
/* NOTE: this must complete power-on within 100 ms. */ /* NOTE: this must complete power-on within 100 ms. */
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off", drvvbus ? "on" : "off",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
err ? " ERROR" : "", err ? " ERROR" : "",
devctl); devctl);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
......
...@@ -280,13 +280,13 @@ static void musb_conn_timer_handler(unsigned long _musb) ...@@ -280,13 +280,13 @@ static void musb_conn_timer_handler(unsigned long _musb)
break; break;
default: default:
dev_dbg(musb->controller, "%s state not handled\n", dev_dbg(musb->controller, "%s state not handled\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
break; break;
} }
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
dev_dbg(musb->controller, "state is %s\n", dev_dbg(musb->controller, "state is %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
static void bfin_musb_enable(struct musb *musb) static void bfin_musb_enable(struct musb *musb)
...@@ -307,7 +307,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on) ...@@ -307,7 +307,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on)
dev_dbg(musb->controller, "VBUS %s, devctl %02x " dev_dbg(musb->controller, "VBUS %s, devctl %02x "
/* otg %3x conf %08x prcm %08x */ "\n", /* otg %3x conf %08x prcm %08x */ "\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
musb_readb(musb->mregs, MUSB_DEVCTL)); musb_readb(musb->mregs, MUSB_DEVCTL));
} }
......
...@@ -198,7 +198,7 @@ static void otg_timer(unsigned long _musb) ...@@ -198,7 +198,7 @@ static void otg_timer(unsigned long _musb)
*/ */
devctl = musb_readb(mregs, MUSB_DEVCTL); devctl = musb_readb(mregs, MUSB_DEVCTL);
dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -267,7 +267,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -267,7 +267,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout)
if (musb->is_active || (musb->a_wait_bcon == 0 && if (musb->is_active || (musb->a_wait_bcon == 0 &&
musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) { musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
dev_dbg(musb->controller, "%s active, deleting timer\n", dev_dbg(musb->controller, "%s active, deleting timer\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
del_timer(&otg_workaround); del_timer(&otg_workaround);
last_timer = jiffies; last_timer = jiffies;
return; return;
...@@ -280,7 +280,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -280,7 +280,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout)
last_timer = timeout; last_timer = timeout;
dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n", dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
jiffies_to_msecs(timeout - jiffies)); jiffies_to_msecs(timeout - jiffies));
mod_timer(&otg_workaround, timeout); mod_timer(&otg_workaround, timeout);
} }
...@@ -360,7 +360,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) ...@@ -360,7 +360,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off", drvvbus ? "on" : "off",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
err ? " ERROR" : "", err ? " ERROR" : "",
devctl); devctl);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
......
...@@ -215,7 +215,7 @@ static void otg_timer(unsigned long _musb) ...@@ -215,7 +215,7 @@ static void otg_timer(unsigned long _musb)
*/ */
devctl = musb_readb(mregs, MUSB_DEVCTL); devctl = musb_readb(mregs, MUSB_DEVCTL);
dev_dbg(musb->controller, "poll devctl %02x (%s)\n", devctl, dev_dbg(musb->controller, "poll devctl %02x (%s)\n", devctl,
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -349,7 +349,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci) ...@@ -349,7 +349,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
davinci_musb_source_power(musb, drvvbus, 0); davinci_musb_source_power(musb, drvvbus, 0);
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off", drvvbus ? "on" : "off",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
err ? " ERROR" : "", err ? " ERROR" : "",
devctl); devctl);
retval = IRQ_HANDLED; retval = IRQ_HANDLED;
......
...@@ -372,13 +372,13 @@ static void musb_otg_timer_func(unsigned long data) ...@@ -372,13 +372,13 @@ static void musb_otg_timer_func(unsigned long data)
case OTG_STATE_A_SUSPEND: case OTG_STATE_A_SUSPEND:
case OTG_STATE_A_WAIT_BCON: case OTG_STATE_A_WAIT_BCON:
dev_dbg(musb->controller, "HNP: %s timeout\n", dev_dbg(musb->controller, "HNP: %s timeout\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
musb_platform_set_vbus(musb, 0); musb_platform_set_vbus(musb, 0);
musb->xceiv->state = OTG_STATE_A_WAIT_VFALL; musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
break; break;
default: default:
dev_dbg(musb->controller, "HNP: Unhandled mode %s\n", dev_dbg(musb->controller, "HNP: Unhandled mode %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
musb->ignore_disconnect = 0; musb->ignore_disconnect = 0;
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
...@@ -393,13 +393,14 @@ void musb_hnp_stop(struct musb *musb) ...@@ -393,13 +393,14 @@ void musb_hnp_stop(struct musb *musb)
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
u8 reg; u8 reg;
dev_dbg(musb->controller, "HNP: stop from %s\n", otg_state_string(musb->xceiv->state)); dev_dbg(musb->controller, "HNP: stop from %s\n",
usb_otg_state_string(musb->xceiv->state));
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
case OTG_STATE_A_PERIPHERAL: case OTG_STATE_A_PERIPHERAL:
musb_g_disconnect(musb); musb_g_disconnect(musb);
dev_dbg(musb->controller, "HNP: back to %s\n", dev_dbg(musb->controller, "HNP: back to %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
break; break;
case OTG_STATE_B_HOST: case OTG_STATE_B_HOST:
dev_dbg(musb->controller, "HNP: Disabling HR\n"); dev_dbg(musb->controller, "HNP: Disabling HR\n");
...@@ -413,7 +414,7 @@ void musb_hnp_stop(struct musb *musb) ...@@ -413,7 +414,7 @@ void musb_hnp_stop(struct musb *musb)
break; break;
default: default:
dev_dbg(musb->controller, "HNP: Stopping in unknown state %s\n", dev_dbg(musb->controller, "HNP: Stopping in unknown state %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
/* /*
...@@ -451,7 +452,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -451,7 +452,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
*/ */
if (int_usb & MUSB_INTR_RESUME) { if (int_usb & MUSB_INTR_RESUME) {
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
dev_dbg(musb->controller, "RESUME (%s)\n", otg_state_string(musb->xceiv->state)); dev_dbg(musb->controller, "RESUME (%s)\n", usb_otg_state_string(musb->xceiv->state));
if (devctl & MUSB_DEVCTL_HM) { if (devctl & MUSB_DEVCTL_HM) {
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
...@@ -493,7 +494,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -493,7 +494,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
default: default:
WARNING("bogus %s RESUME (%s)\n", WARNING("bogus %s RESUME (%s)\n",
"host", "host",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} else { } else {
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -522,7 +523,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -522,7 +523,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
default: default:
WARNING("bogus %s RESUME (%s)\n", WARNING("bogus %s RESUME (%s)\n",
"peripheral", "peripheral",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} }
} }
...@@ -538,7 +539,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -538,7 +539,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
} }
dev_dbg(musb->controller, "SESSION_REQUEST (%s)\n", dev_dbg(musb->controller, "SESSION_REQUEST (%s)\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
/* IRQ arrives from ID pin sense or (later, if VBUS power /* IRQ arrives from ID pin sense or (later, if VBUS power
* is removed) SRP. responses are time critical: * is removed) SRP. responses are time critical:
...@@ -603,7 +604,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -603,7 +604,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
} }
dev_dbg(musb->controller, "VBUS_ERROR in %s (%02x, %s), retry #%d, port1 %08x\n", dev_dbg(musb->controller, "VBUS_ERROR in %s (%02x, %s), retry #%d, port1 %08x\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
devctl, devctl,
({ char *s; ({ char *s;
switch (devctl & MUSB_DEVCTL_VBUS) { switch (devctl & MUSB_DEVCTL_VBUS) {
...@@ -628,7 +629,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -628,7 +629,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
if (int_usb & MUSB_INTR_SUSPEND) { if (int_usb & MUSB_INTR_SUSPEND) {
dev_dbg(musb->controller, "SUSPEND (%s) devctl %02x\n", dev_dbg(musb->controller, "SUSPEND (%s) devctl %02x\n",
otg_state_string(musb->xceiv->state), devctl); usb_otg_state_string(musb->xceiv->state), devctl);
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -745,12 +746,12 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -745,12 +746,12 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
usb_hcd_resume_root_hub(hcd); usb_hcd_resume_root_hub(hcd);
dev_dbg(musb->controller, "CONNECT (%s) devctl %02x\n", dev_dbg(musb->controller, "CONNECT (%s) devctl %02x\n",
otg_state_string(musb->xceiv->state), devctl); usb_otg_state_string(musb->xceiv->state), devctl);
} }
if ((int_usb & MUSB_INTR_DISCONNECT) && !musb->ignore_disconnect) { if ((int_usb & MUSB_INTR_DISCONNECT) && !musb->ignore_disconnect) {
dev_dbg(musb->controller, "DISCONNECT (%s) as %s, devctl %02x\n", dev_dbg(musb->controller, "DISCONNECT (%s) as %s, devctl %02x\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
MUSB_MODE(musb), devctl); MUSB_MODE(musb), devctl);
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
...@@ -787,7 +788,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -787,7 +788,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
break; break;
default: default:
WARNING("unhandled DISCONNECT transition (%s)\n", WARNING("unhandled DISCONNECT transition (%s)\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
break; break;
} }
} }
...@@ -813,7 +814,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -813,7 +814,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
} }
} else { } else {
dev_dbg(musb->controller, "BUS RESET as %s\n", dev_dbg(musb->controller, "BUS RESET as %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
case OTG_STATE_A_SUSPEND: case OTG_STATE_A_SUSPEND:
/* We need to ignore disconnect on suspend /* We need to ignore disconnect on suspend
...@@ -826,7 +827,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -826,7 +827,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
case OTG_STATE_A_WAIT_BCON: /* OPT TD.4.7-900ms */ case OTG_STATE_A_WAIT_BCON: /* OPT TD.4.7-900ms */
/* never use invalid T(a_wait_bcon) */ /* never use invalid T(a_wait_bcon) */
dev_dbg(musb->controller, "HNP: in %s, %d msec timeout\n", dev_dbg(musb->controller, "HNP: in %s, %d msec timeout\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
TA_WAIT_BCON(musb)); TA_WAIT_BCON(musb));
mod_timer(&musb->otg_timer, jiffies mod_timer(&musb->otg_timer, jiffies
+ msecs_to_jiffies(TA_WAIT_BCON(musb))); + msecs_to_jiffies(TA_WAIT_BCON(musb)));
...@@ -838,7 +839,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -838,7 +839,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
break; break;
case OTG_STATE_B_WAIT_ACON: case OTG_STATE_B_WAIT_ACON:
dev_dbg(musb->controller, "HNP: RESET (%s), to b_peripheral\n", dev_dbg(musb->controller, "HNP: RESET (%s), to b_peripheral\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
musb->xceiv->state = OTG_STATE_B_PERIPHERAL; musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
musb_g_reset(musb); musb_g_reset(musb);
break; break;
...@@ -850,7 +851,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -850,7 +851,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
break; break;
default: default:
dev_dbg(musb->controller, "Unhandled BUS RESET as %s\n", dev_dbg(musb->controller, "Unhandled BUS RESET as %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} }
} }
...@@ -1632,7 +1633,7 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1632,7 +1633,7 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
int ret = -EINVAL; int ret = -EINVAL;
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
ret = sprintf(buf, "%s\n", otg_state_string(musb->xceiv->state)); ret = sprintf(buf, "%s\n", usb_otg_state_string(musb->xceiv->state));
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return ret; return ret;
......
...@@ -225,7 +225,7 @@ static void otg_timer(unsigned long _musb) ...@@ -225,7 +225,7 @@ static void otg_timer(unsigned long _musb)
*/ */
devctl = dsps_readb(mregs, MUSB_DEVCTL); devctl = dsps_readb(mregs, MUSB_DEVCTL);
dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -274,7 +274,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -274,7 +274,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
if (musb->is_active || (musb->a_wait_bcon == 0 && if (musb->is_active || (musb->a_wait_bcon == 0 &&
musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) { musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
dev_dbg(musb->controller, "%s active, deleting timer\n", dev_dbg(musb->controller, "%s active, deleting timer\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
del_timer(&glue->timer[pdev->id]); del_timer(&glue->timer[pdev->id]);
glue->last_timer[pdev->id] = jiffies; glue->last_timer[pdev->id] = jiffies;
return; return;
...@@ -289,7 +289,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -289,7 +289,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
glue->last_timer[pdev->id] = timeout; glue->last_timer[pdev->id] = timeout;
dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n", dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
jiffies_to_msecs(timeout - jiffies)); jiffies_to_msecs(timeout - jiffies));
mod_timer(&glue->timer[pdev->id], timeout); mod_timer(&glue->timer[pdev->id], timeout);
} }
...@@ -378,7 +378,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci) ...@@ -378,7 +378,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
/* NOTE: this must complete power-on within 100 ms. */ /* NOTE: this must complete power-on within 100 ms. */
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off", drvvbus ? "on" : "off",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
err ? " ERROR" : "", err ? " ERROR" : "",
devctl); devctl);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
......
...@@ -1571,7 +1571,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) ...@@ -1571,7 +1571,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget)
goto done; goto done;
default: default:
dev_dbg(musb->controller, "Unhandled wake: %s\n", dev_dbg(musb->controller, "Unhandled wake: %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
goto done; goto done;
} }
...@@ -1970,7 +1970,7 @@ void musb_g_resume(struct musb *musb) ...@@ -1970,7 +1970,7 @@ void musb_g_resume(struct musb *musb)
break; break;
default: default:
WARNING("unhandled RESUME transition (%s)\n", WARNING("unhandled RESUME transition (%s)\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} }
...@@ -2000,7 +2000,7 @@ void musb_g_suspend(struct musb *musb) ...@@ -2000,7 +2000,7 @@ void musb_g_suspend(struct musb *musb)
* A_PERIPHERAL may need care too * A_PERIPHERAL may need care too
*/ */
WARNING("unhandled SUSPEND transition (%s)\n", WARNING("unhandled SUSPEND transition (%s)\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} }
...@@ -2034,7 +2034,7 @@ void musb_g_disconnect(struct musb *musb) ...@@ -2034,7 +2034,7 @@ void musb_g_disconnect(struct musb *musb)
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
default: default:
dev_dbg(musb->controller, "Unhandled disconnect %s, setting a_idle\n", dev_dbg(musb->controller, "Unhandled disconnect %s, setting a_idle\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
musb->xceiv->state = OTG_STATE_A_IDLE; musb->xceiv->state = OTG_STATE_A_IDLE;
MUSB_HST_MODE(musb); MUSB_HST_MODE(musb);
break; break;
......
...@@ -2453,7 +2453,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd) ...@@ -2453,7 +2453,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
if (musb->is_active) { if (musb->is_active) {
WARNING("trying to suspend as %s while active\n", WARNING("trying to suspend as %s while active\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
return -EBUSY; return -EBUSY;
} else } else
return 0; return 0;
......
...@@ -95,7 +95,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend) ...@@ -95,7 +95,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
break; break;
default: default:
dev_dbg(musb->controller, "bogus rh suspend? %s\n", dev_dbg(musb->controller, "bogus rh suspend? %s\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} else if (power & MUSB_POWER_SUSPENDM) { } else if (power & MUSB_POWER_SUSPENDM) {
power &= ~MUSB_POWER_SUSPENDM; power &= ~MUSB_POWER_SUSPENDM;
...@@ -203,7 +203,7 @@ void musb_root_disconnect(struct musb *musb) ...@@ -203,7 +203,7 @@ void musb_root_disconnect(struct musb *musb)
break; break;
default: default:
dev_dbg(musb->controller, "host disconnect (%s)\n", dev_dbg(musb->controller, "host disconnect (%s)\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
} }
......
...@@ -117,7 +117,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -117,7 +117,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
if (musb->is_active || ((musb->a_wait_bcon == 0) if (musb->is_active || ((musb->a_wait_bcon == 0)
&& (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) { && (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
dev_dbg(musb->controller, "%s active, deleting timer\n", dev_dbg(musb->controller, "%s active, deleting timer\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
del_timer(&musb_idle_timer); del_timer(&musb_idle_timer);
last_timer = jiffies; last_timer = jiffies;
return; return;
...@@ -134,7 +134,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -134,7 +134,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
last_timer = timeout; last_timer = timeout;
dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n", dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
(unsigned long)jiffies_to_msecs(timeout - jiffies)); (unsigned long)jiffies_to_msecs(timeout - jiffies));
mod_timer(&musb_idle_timer, timeout); mod_timer(&musb_idle_timer, timeout);
} }
...@@ -200,7 +200,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) ...@@ -200,7 +200,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
dev_dbg(musb->controller, "VBUS %s, devctl %02x " dev_dbg(musb->controller, "VBUS %s, devctl %02x "
/* otg %3x conf %08x prcm %08x */ "\n", /* otg %3x conf %08x prcm %08x */ "\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
musb_readb(musb->mregs, MUSB_DEVCTL)); musb_readb(musb->mregs, MUSB_DEVCTL));
} }
......
...@@ -423,7 +423,7 @@ static void musb_do_idle(unsigned long _musb) ...@@ -423,7 +423,7 @@ static void musb_do_idle(unsigned long _musb)
&& (musb->idle_timeout == 0 && (musb->idle_timeout == 0
|| time_after(jiffies, musb->idle_timeout))) { || time_after(jiffies, musb->idle_timeout))) {
dev_dbg(musb->controller, "Nothing connected %s, turning off VBUS\n", dev_dbg(musb->controller, "Nothing connected %s, turning off VBUS\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case OTG_STATE_A_IDLE: case OTG_STATE_A_IDLE:
...@@ -478,7 +478,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -478,7 +478,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout)
if (musb->is_active || ((musb->a_wait_bcon == 0) if (musb->is_active || ((musb->a_wait_bcon == 0)
&& (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) { && (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
dev_dbg(musb->controller, "%s active, deleting timer\n", dev_dbg(musb->controller, "%s active, deleting timer\n",
otg_state_string(musb->xceiv->state)); usb_otg_state_string(musb->xceiv->state));
del_timer(&musb_idle_timer); del_timer(&musb_idle_timer);
last_timer = jiffies; last_timer = jiffies;
return; return;
...@@ -495,7 +495,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout) ...@@ -495,7 +495,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout)
last_timer = timeout; last_timer = timeout;
dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n", dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
(unsigned long)jiffies_to_msecs(timeout - jiffies)); (unsigned long)jiffies_to_msecs(timeout - jiffies));
mod_timer(&musb_idle_timer, timeout); mod_timer(&musb_idle_timer, timeout);
} }
...@@ -571,7 +571,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) ...@@ -571,7 +571,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
dev_dbg(musb->controller, "VBUS %s, devctl %02x otg %3x conf %08x prcm %08x\n", dev_dbg(musb->controller, "VBUS %s, devctl %02x otg %3x conf %08x prcm %08x\n",
otg_state_string(musb->xceiv->state), usb_otg_state_string(musb->xceiv->state),
musb_readb(musb->mregs, MUSB_DEVCTL), musb_readb(musb->mregs, MUSB_DEVCTL),
musb_readl(tbase, TUSB_DEV_OTG_STAT), musb_readl(tbase, TUSB_DEV_OTG_STAT),
conf, prcm); conf, prcm);
...@@ -678,13 +678,13 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) ...@@ -678,13 +678,13 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
musb->is_active = 0; musb->is_active = 0;
} }
dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", dev_dbg(musb->controller, "vbus change, %s, otg %03x\n",
otg_state_string(musb->xceiv->state), otg_stat); usb_otg_state_string(musb->xceiv->state), otg_stat);
idle_timeout = jiffies + (1 * HZ); idle_timeout = jiffies + (1 * HZ);
schedule_work(&musb->irq_work); schedule_work(&musb->irq_work);
} else /* A-dev state machine */ { } else /* A-dev state machine */ {
dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", dev_dbg(musb->controller, "vbus change, %s, otg %03x\n",
otg_state_string(musb->xceiv->state), otg_stat); usb_otg_state_string(musb->xceiv->state), otg_stat);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
case OTG_STATE_A_IDLE: case OTG_STATE_A_IDLE:
...@@ -733,7 +733,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) ...@@ -733,7 +733,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
u8 devctl; u8 devctl;
dev_dbg(musb->controller, "%s timer, %03x\n", dev_dbg(musb->controller, "%s timer, %03x\n",
otg_state_string(musb->xceiv->state), otg_stat); usb_otg_state_string(musb->xceiv->state), otg_stat);
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
case OTG_STATE_A_WAIT_VRISE: case OTG_STATE_A_WAIT_VRISE:
......
...@@ -992,7 +992,7 @@ static int show_fsl_usb2_otg_state(struct device *dev, ...@@ -992,7 +992,7 @@ static int show_fsl_usb2_otg_state(struct device *dev,
/* State */ /* State */
t = scnprintf(next, size, t = scnprintf(next, size,
"OTG state: %s\n\n", "OTG state: %s\n\n",
otg_state_string(fsl_otg_dev->phy.state)); usb_otg_state_string(fsl_otg_dev->phy.state));
size -= t; size -= t;
next += t; next += t;
......
...@@ -236,7 +236,7 @@ isp1301_clear_bits(struct isp1301 *isp, u8 reg, u8 bits) ...@@ -236,7 +236,7 @@ isp1301_clear_bits(struct isp1301 *isp, u8 reg, u8 bits)
static inline const char *state_name(struct isp1301 *isp) static inline const char *state_name(struct isp1301 *isp)
{ {
return otg_state_string(isp->phy.state); return usb_otg_state_string(isp->phy.state);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -481,7 +481,7 @@ static void check_state(struct isp1301 *isp, const char *tag) ...@@ -481,7 +481,7 @@ static void check_state(struct isp1301 *isp, const char *tag)
if (isp->phy.state == state && !extra) if (isp->phy.state == state && !extra)
return; return;
pr_debug("otg: %s FSM %s/%02x, %s, %06x\n", tag, pr_debug("otg: %s FSM %s/%02x, %s, %06x\n", tag,
otg_state_string(state), fsm, state_name(isp), usb_otg_state_string(state), fsm, state_name(isp),
omap_readl(OTG_CTRL)); omap_readl(OTG_CTRL));
} }
...@@ -1077,7 +1077,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat) ...@@ -1077,7 +1077,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
if (state != isp->phy.state) if (state != isp->phy.state)
pr_debug(" isp, %s -> %s\n", pr_debug(" isp, %s -> %s\n",
otg_state_string(state), state_name(isp)); usb_otg_state_string(state), state_name(isp));
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
/* update the OTG controller state to match the isp1301; may /* update the OTG controller state to match the isp1301; may
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/usb/otg.h> #include <linux/usb/otg.h>
const char *otg_state_string(enum usb_otg_state state) const char *usb_otg_state_string(enum usb_otg_state state)
{ {
switch (state) { switch (state) {
case OTG_STATE_A_IDLE: case OTG_STATE_A_IDLE:
...@@ -44,4 +44,4 @@ const char *otg_state_string(enum usb_otg_state state) ...@@ -44,4 +44,4 @@ const char *otg_state_string(enum usb_otg_state state)
return "UNDEFINED"; return "UNDEFINED";
} }
} }
EXPORT_SYMBOL(otg_state_string); EXPORT_SYMBOL(usb_otg_state_string);
...@@ -119,7 +119,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state) ...@@ -119,7 +119,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
state_changed = 1; state_changed = 1;
if (fsm->otg->phy->state == new_state) if (fsm->otg->phy->state == new_state)
return 0; return 0;
VDBG("Set state: %s\n", otg_state_string(new_state)); VDBG("Set state: %s\n", usb_otg_state_string(new_state));
otg_leave_state(fsm, fsm->otg->phy->state); otg_leave_state(fsm, fsm->otg->phy->state);
switch (new_state) { switch (new_state) {
case OTG_STATE_B_IDLE: case OTG_STATE_B_IDLE:
......
...@@ -37,9 +37,9 @@ struct usb_otg { ...@@ -37,9 +37,9 @@ struct usb_otg {
}; };
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
extern const char *otg_state_string(enum usb_otg_state state); extern const char *usb_otg_state_string(enum usb_otg_state state);
#else #else
static inline const char *otg_state_string(enum usb_otg_state state) static inline const char *usb_otg_state_string(enum usb_otg_state state)
{ {
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment