]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/musb/omap2430.c
USB: musb: sysfs mode updates
[linux-2.6-omap-h63xx.git] / drivers / usb / musb / omap2430.c
index ce6c162920f7bfcb5bef980b2438aeba4661d12b..52988a403b5c59b75bbea578dd53145c49893d23 100644 (file)
@@ -196,7 +196,7 @@ static int omap_set_power(struct otg_transceiver *x, unsigned mA)
 
 static int musb_platform_resume(struct musb *musb);
 
-void musb_platform_set_mode(struct musb *musb, u8 musb_mode)
+int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 {
        u8      devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
 
@@ -204,15 +204,24 @@ void musb_platform_set_mode(struct musb *musb, u8 musb_mode)
        musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 
        switch (musb_mode) {
+#ifdef CONFIG_USB_MUSB_HDRC_HCD
        case MUSB_HOST:
                otg_set_host(&musb->xceiv, musb->xceiv.host);
                break;
+#endif
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
        case MUSB_PERIPHERAL:
                otg_set_peripheral(&musb->xceiv, musb->xceiv.gadget);
                break;
+#endif
+#ifdef CONFIG_USB_MUSB_OTG
        case MUSB_OTG:
                break;
+#endif
+       default:
+               return -EINVAL;
        }
+       return 0;
 }
 
 int __init musb_platform_init(struct musb *musb)