mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Suresh Gupta <suresh.gupta@freescale.com>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Stefani Seibold <stefani@seibold.net>
Subject: Re: [PATCH] USB: Gadget: fsl driver pullup fix
Date: Thu, 13 Mar 2014 10:25:17 -0500	[thread overview]
Message-ID: <20140313152517.GG4599@saruman.home> (raw)
In-Reply-To: <1394716255-26963-1-git-send-email-suresh.gupta@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

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@seibold.net>
> Signed-off-by: Suresh Gupta <suresh.gupta@freescale.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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-03-13 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 13:10 Suresh Gupta
2014-03-13 15:25 ` Felipe Balbi [this message]
2014-03-14 20:53   ` suresh.gupta
2014-03-15  1:35     ` Felipe Balbi
2014-03-19 14:23       ` suresh.gupta
2014-03-19 15:46         ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140313152517.GG4599@saruman.home \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stefani@seibold.net \
    --cc=suresh.gupta@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®