OSDN Git Service

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)
commitf4fd094cdfd124d7653a500e81ec3bb7ae3e9919
tree8478a055ecd2b442fe6abc68bc4fab96b052c698
parent95fcc6a9014f1ea6419d1e8ce796173410c5ad63
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