[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120509191950.GB15527@herton-ThinkPad-T420>
Date: Wed, 9 May 2012 12:19:50 -0700
From: Herton Ronaldo Krzesinski <herton.krzesinski@...onical.com>
To: Ben Hutchings <ben@...adent.org.uk>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
alan@...rguk.ukuu.org.uk, Felipe Balbi <balbi@...com>
Subject: Re: [ 034/167] [PATCH] usb: gadget: udc-core: stop UDC on
device-initiated disconnect
On Wed, May 09, 2012 at 06:51:03AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Felipe Balbi <balbi@...com>
>
> commit 6d258a4c42089229b855fd706622029decf316d6 upstream.
We also need a follow up fix to this, commit
83a787a71e034244a9fd1d5988fe18f226341417 upstream.
>
> When we want to do device-initiated disconnect,
> let's make sure we stop the UDC in order to
> e.g. allow lower power states to be achieved by
> turning off unnecessary clocks and/or stoping
> PHYs.
>
> When reconnecting, call ->udc_start() again to
> make sure UDC is reinitialized.
>
> Signed-off-by: Felipe Balbi <balbi@...com>
> Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
> ---
> drivers/usb/gadget/udc-core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> index 56da49f..c261887 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -411,8 +411,12 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
> struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
>
> if (sysfs_streq(buf, "connect")) {
> + if (udc_is_newstyle(udc))
> + usb_gadget_udc_start(udc->gadget, udc->driver);
> usb_gadget_connect(udc->gadget);
> } else if (sysfs_streq(buf, "disconnect")) {
> + if (udc_is_newstyle(udc))
> + usb_gadget_udc_stop(udc->gadget, udc->driver);
> usb_gadget_disconnect(udc->gadget);
> } else {
> dev_err(dev, "unsupported command '%s'\n", buf);
> --
> 1.7.10
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists