On Thu, Aug 16, 2012 at 11:51 AM, Felipe Balbi <[email protected]> wrote:
> After introducing the new ->reset method on
> struct usb_gadget_driver, UDC drivers are
> required to implement proper handling for it.
>
> This patch adds proper ->reset handling for
> musb driver.
>
> Signed-off-by: Felipe Balbi <[email protected]>
> ---
> drivers/usb/musb/musb_gadget.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index d0b87e7..30fca10 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -2163,9 +2163,16 @@ __acquires(musb->lock)
> : NULL
> );
>
> - /* report disconnect, if we didn't already (flushing EP state) */
> - if (musb->g.speed != USB_SPEED_UNKNOWN)
> - musb_g_disconnect(musb);
> + /* report reset, if we didn't already (flushing EP state) */
> + if (musb->gadget_driver && musb->gadget_driver->reset) {
> + spin_unlock(&musb->lock);
> + musb->gadget_driver->reset(&musb->g);
What will this call back do ?
> + spin_lock(&musb->lock);
> + } else if (musb->gadget_driver && musb->gadget_driver->disconnect) {
> + spin_unlock(&musb->lock);
> + musb->gadget_driver->disconnect(&musb->g);
> + spin_lock(&musb->lock);
> + }
>
> /* clear HR */
> else if (devctl & MUSB_DEVCTL_HR)
> --
> 1.7.12.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html