• Robert Jarzmik's avatar
    usb: gadget: pxa27x_udc: fix clock prepare and enable · f4fd094c
    Robert Jarzmik authored
    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: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    f4fd094c
pxa27x_udc.c 66.2 KB