]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: pxa27x_udc: fix clock prepare and enable
authorRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 17 Oct 2014 20:43:06 +0000 (22:43 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:01:18 +0000 (10:01 -0600)
commit08ab63db61dde7a0e37d94f319820436252e4532
tree8478a055ecd2b442fe6abc68bc4fab96b052c698
parent9c2ba5a6b3b9304f6c5aba1f93590541fa281111
usb: gadget: pxa27x_udc: fix clock prepare and enable

As the udc clock controls both the output signals and the internal IP,
it must be enabled before any UDC register is touched.

The bug is revealed when the clock framework disables the clock for a
couple of milliseconds during the boot sequence, and the endpoint
configuration is lost. The bug is hidden when clock framework is not
used, because no "unused clocks disable" occurs.

This patch fixes the wrong behaviour by ensuring that :
 - whenever a UDC register is read or written, the clock is enabled
 - reworks the endpoints programming to have it done under running clock
 - reworks suspend/resume to ensure the same thing

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/pxa27x_udc.c