usb: fix musb gadget to enable OTG mode conditionally
authorApelete Seketeli <apelete@seketeli.net>
Tue, 19 Nov 2013 22:18:20 +0000 (23:18 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 25 Nov 2013 16:25:58 +0000 (10:25 -0600)
commit614f7f5c01b9777d726cc6e8ae7969a39b3f1d36
tree161126dd6ad9c85c9f80a7c62405077f45f61bfe
parent6f7f998454a45d1eb59577e7e1c5bac55cb69e7d
usb: fix musb gadget to enable OTG mode conditionally

The musb driver is usable in host, gadget or dual role mode depending
on the kernel configuration.

However, the musb gadget part of the driver is enabling OTG mode
whether the driver is built for dual role or gadget only mode. This
induces a bug for gadget only USB device controllers where the kernel
tries to use Host Negotiation Protocol with such controllers, which
causes a panic.

This behaviour is now fixed by enabling OTG mode only when musb driver
is built for dual role mode.

Signed-off-by: Apelete Seketeli <apelete@seketeli.net>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c