OSDN Git Service

usb: musb: dsps: move try_idle to start hook
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 15 Oct 2013 16:29:23 +0000 (18:29 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 17 Oct 2013 14:55:05 +0000 (09:55 -0500)
commit8b9fcce2d88586b9a120ff3e039d8f42413f0bb0
tree07f1ba04397da036b71860492b52ae6a79d696d9
parentae44df2e21b50f9fff28ac75c57e399c04df812c
usb: musb: dsps: move try_idle to start hook

The timer is initialized right after musb is probed. There is actually
no need to have this timer running because _nothing_ will happen until
we have the gadget loaded. Also we need this timer only if we run in OTG
mode _and_ we need it also after the gadget has been replaced with
another one.

I've been looking at am35x.c, da8xx.c, omap2430.c, tusb6010.c. da8xx
seem to have the same problem as dsps and doing mostly the same thing.
tusb6010 seem to do something different and do some actual "idle / power
saving" work so I am not too comfortable to remove
musb_platform_try_idle() from musb_gadget_setup().

Therefore this patch does not start the timer if there is no gadget
active (which is at musb_gadget_setup() at time). In order to have the
timer active after the gadget is loaded it will be triggered from
dsps_musb_enable().

Cc: stable@vger.kernel.org # v3.11
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_dsps.c