[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140313152517.GG4599@saruman.home>
Date: Thu, 13 Mar 2014 10:25:17 -0500
From: Felipe Balbi <balbi@...com>
To: Suresh Gupta <suresh.gupta@...escale.com>
CC: <balbi@...com>, <gregkh@...uxfoundation.org>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Stefani Seibold <stefani@...bold.net>
Subject: Re: [PATCH] USB: Gadget: fsl driver pullup fix
Hi,
On Thu, Mar 13, 2014 at 06:40:55PM +0530, Suresh Gupta wrote:
> Attached is a small fix for the fsl usb gadget driver. This fix the
> driver in a way that the usb device will be only "pulled up" on requests
> like other usb gadget drivers do.
> This is necessary, because the device information is not always
> available until an application is up and running which provides this
> datas.
>
> Signed-off-by: Stefani Seibold <stefani@...bold.net>
> Signed-off-by: Suresh Gupta <suresh.gupta@...escale.com>
> ---
> drivers/usb/gadget/fsl_udc_core.c | 38 +++++++++++++++++++++-----------------
> 1 file changed, 21 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
> index 35cb972..9a93727 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -153,6 +153,21 @@ static inline void fsl_set_accessors(struct fsl_usb2_platform_data *pdata) {}
> /********************************************************************
> * Internal Used Function
> ********************************************************************/
> +static int can_pullup(struct fsl_udc *udc)
> +{
> + return udc->driver && udc->softconnect && udc->vbus_active;
> +}
> +
> +static void set_pullup(struct fsl_udc *udc)
> +{
> + if (can_pullup(udc))
> + fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
> + &dr_regs->usbcmd);
> + else
> + fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP),
> + &dr_regs->usbcmd);
> +}
why is this a "fix", you just re-factored some code into set_pullup().
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists