diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-03-31 15:30:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:40 -0400 |
commit | 84e250ffa76dddc1bad84e04248a27f442c25986 (patch) | |
tree | b253b1e2b030b160d2c458aece9c8122446e433f /drivers/usb/musb/blackfin.c | |
parent | cc835e321a9f3fa5e083436872e198095f4805b9 (diff) |
musb: proper hookup to transceiver drivers
Let the otg_transceiver in MUSB be managed by an external driver;
don't assume it's integrated. OMAP3 chips need it to be external,
and there may be ways to interact with the transceiver which add
functionality to the system.
Platform init code is responsible for setting up the transeciver,
probably using the NOP transceiver for integrated transceivers.
External ones will use whatever the board init code provided,
such as twl4030 or something more hands-off.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/blackfin.c')
-rw-r--r-- | drivers/usb/musb/blackfin.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 786134852092..f2f66ebc7362 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -143,7 +143,7 @@ static void musb_conn_timer_handler(unsigned long _musb) | |||
143 | u16 val; | 143 | u16 val; |
144 | 144 | ||
145 | spin_lock_irqsave(&musb->lock, flags); | 145 | spin_lock_irqsave(&musb->lock, flags); |
146 | switch (musb->xceiv.state) { | 146 | switch (musb->xceiv->state) { |
147 | case OTG_STATE_A_IDLE: | 147 | case OTG_STATE_A_IDLE: |
148 | case OTG_STATE_A_WAIT_BCON: | 148 | case OTG_STATE_A_WAIT_BCON: |
149 | /* Start a new session */ | 149 | /* Start a new session */ |
@@ -154,7 +154,7 @@ static void musb_conn_timer_handler(unsigned long _musb) | |||
154 | val = musb_readw(musb->mregs, MUSB_DEVCTL); | 154 | val = musb_readw(musb->mregs, MUSB_DEVCTL); |
155 | if (!(val & MUSB_DEVCTL_BDEVICE)) { | 155 | if (!(val & MUSB_DEVCTL_BDEVICE)) { |
156 | gpio_set_value(musb->config->gpio_vrsel, 1); | 156 | gpio_set_value(musb->config->gpio_vrsel, 1); |
157 | musb->xceiv.state = OTG_STATE_A_WAIT_BCON; | 157 | musb->xceiv->state = OTG_STATE_A_WAIT_BCON; |
158 | } else { | 158 | } else { |
159 | gpio_set_value(musb->config->gpio_vrsel, 0); | 159 | gpio_set_value(musb->config->gpio_vrsel, 0); |
160 | 160 | ||
@@ -247,6 +247,11 @@ int __init musb_platform_init(struct musb *musb) | |||
247 | } | 247 | } |
248 | gpio_direction_output(musb->config->gpio_vrsel, 0); | 248 | gpio_direction_output(musb->config->gpio_vrsel, 0); |
249 | 249 | ||
250 | usb_nop_xceiv_register(); | ||
251 | musb->xceiv = otg_get_transceiver(); | ||
252 | if (!musb->xceiv) | ||
253 | return -ENODEV; | ||
254 | |||
250 | if (ANOMALY_05000346) { | 255 | if (ANOMALY_05000346) { |
251 | bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value); | 256 | bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value); |
252 | SSYNC(); | 257 | SSYNC(); |
@@ -291,7 +296,7 @@ int __init musb_platform_init(struct musb *musb) | |||
291 | musb_conn_timer_handler, (unsigned long) musb); | 296 | musb_conn_timer_handler, (unsigned long) musb); |
292 | } | 297 | } |
293 | if (is_peripheral_enabled(musb)) | 298 | if (is_peripheral_enabled(musb)) |
294 | musb->xceiv.set_power = bfin_set_power; | 299 | musb->xceiv->set_power = bfin_set_power; |
295 | 300 | ||
296 | musb->isr = blackfin_interrupt; | 301 | musb->isr = blackfin_interrupt; |
297 | 302 | ||