summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2009-12-15 12:47:30 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-23 20:34:17 +0100
commitcd42fef0a0b061817904fd6feb0de66830794857 (patch)
tree39f03b9d03f517c644b6e463ee733ee0959c2104 /drivers/usb
parentUSB: musb: gadget: set otg tranceiver to idle when registering gadget (diff)
downloadlinux-cd42fef0a0b061817904fd6feb0de66830794857.tar.xz
linux-cd42fef0a0b061817904fd6feb0de66830794857.zip
USB: musb: do not work if no gadget driver is loaded
On OTG and gadget-only configurations, we need a gadget driver in order to work properly, so avoid changing operation modes when there's no gadget driver loaded. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/musb_core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 1041bb734bb4..24ff09754e0c 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1521,6 +1521,14 @@ irqreturn_t musb_interrupt(struct musb *musb)
(devctl & MUSB_DEVCTL_HM) ? "host" : "peripheral",
musb->int_usb, musb->int_tx, musb->int_rx);
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+ if (is_otg_enabled(musb) || is_peripheral_enabled(musb))
+ if (!musb->gadget_driver) {
+ DBG(5, "No gadget driver loaded\n");
+ return IRQ_HANDLED;
+ }
+#endif
+
/* the core can interrupt us for multiple reasons; docs have
* a generic interrupt flowchart to follow
*/