diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-11-24 06:06:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-07 12:59:58 -0500 |
commit | 96a274d1da950a96cb31ac1bed044e049d770980 (patch) | |
tree | 6069c17f492e3bfbc75d59b3d6d47a81bf7ae7d6 /drivers/usb/musb/omap2430.c | |
parent | aa69a8093ff985873cb44fe1157bd6db29a20fe4 (diff) |
USB: musb: sysfs mode updates
Fix three omissions in the "mode" sysfs attribute support:
(a) inability to report errors;
(b) no DaVinci support ... just report an error;
(c) for omap2430, accepting unsupportable values
The 2430 stuff is still odd....
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r-- | drivers/usb/musb/omap2430.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index ce6c162920f7..52988a403b5c 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -196,7 +196,7 @@ static int omap_set_power(struct otg_transceiver *x, unsigned mA) | |||
196 | 196 | ||
197 | static int musb_platform_resume(struct musb *musb); | 197 | static int musb_platform_resume(struct musb *musb); |
198 | 198 | ||
199 | void musb_platform_set_mode(struct musb *musb, u8 musb_mode) | 199 | int musb_platform_set_mode(struct musb *musb, u8 musb_mode) |
200 | { | 200 | { |
201 | u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); | 201 | u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); |
202 | 202 | ||
@@ -204,15 +204,24 @@ void musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
204 | musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); | 204 | musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); |
205 | 205 | ||
206 | switch (musb_mode) { | 206 | switch (musb_mode) { |
207 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
207 | case MUSB_HOST: | 208 | case MUSB_HOST: |
208 | otg_set_host(&musb->xceiv, musb->xceiv.host); | 209 | otg_set_host(&musb->xceiv, musb->xceiv.host); |
209 | break; | 210 | break; |
211 | #endif | ||
212 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
210 | case MUSB_PERIPHERAL: | 213 | case MUSB_PERIPHERAL: |
211 | otg_set_peripheral(&musb->xceiv, musb->xceiv.gadget); | 214 | otg_set_peripheral(&musb->xceiv, musb->xceiv.gadget); |
212 | break; | 215 | break; |
216 | #endif | ||
217 | #ifdef CONFIG_USB_MUSB_OTG | ||
213 | case MUSB_OTG: | 218 | case MUSB_OTG: |
214 | break; | 219 | break; |
220 | #endif | ||
221 | default: | ||
222 | return -EINVAL; | ||
215 | } | 223 | } |
224 | return 0; | ||
216 | } | 225 | } |
217 | 226 | ||
218 | int __init musb_platform_init(struct musb *musb) | 227 | int __init musb_platform_init(struct musb *musb) |