From: Grazvydas Ignotas Date: Tue, 26 Feb 2013 00:52:24 +0000 (+0200) Subject: usb: musb: honour initial transceiver state X-Git-Tag: sz_154~24 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=6aaf9ca301254ace90bf531142e9d0e3e75dbab3 usb: musb: honour initial transceiver state As the OTG transceiver driver usually starts first, it should already have default_a variable set according to ID pin state, so don't override it. In case default_a was not changed by trasceiver, it will default to 0 and this code will work as before. --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 35e30e1356a3..ad67cf92fe89 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2066,9 +2066,13 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ? 'B' : 'A')); } else /* peripheral is enabled */ { - MUSB_DEV_MODE(musb); - musb->xceiv->default_a = 0; - musb->xceiv->state = OTG_STATE_B_IDLE; + if (musb->xceiv->default_a) { + MUSB_HST_MODE(musb); + musb->xceiv->state = OTG_STATE_A_IDLE; + } else { + MUSB_DEV_MODE(musb); + musb->xceiv->state = OTG_STATE_B_IDLE; + } status = musb_gadget_setup(musb);