Re: [PATCH 14/25] langwell: USB Client Remote Wakeup Support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 04, 2010 at 10:52:06PM +0100, Alan Cox wrote:
> From: JiebingLi <jiebing.li@xxxxxxxxx>
> 
> Remote wakeup support in client driver
> 
> Signed-off-by: JiebingLi <jiebing.li@xxxxxxxxx>
> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
> ---
> 
>  drivers/usb/gadget/langwell_udc.c |   71 ++++++++++++++++++++++++++++++++++---
>  drivers/usb/gadget/langwell_udc.h |    3 ++
>  2 files changed, 69 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
> index 8b92e22..30acd86 100644
> --- a/drivers/usb/gadget/langwell_udc.c
> +++ b/drivers/usb/gadget/langwell_udc.c
> @@ -1815,6 +1815,40 @@ static ssize_t show_langwell_udc(struct device *_dev,
>  static DEVICE_ATTR(langwell_udc, S_IRUGO, show_langwell_udc, NULL);
>  
>  
> +/* device "remote_wakeup" sysfs attribute file */
> +static ssize_t store_remote_wakeup(struct device *_dev,
> +		struct device_attribute *attr, const char *buf, size_t count)
> +{
> +	struct langwell_udc	*dev = the_controller;
> +#if defined(CONFIG_USB_DEBUG)
> +	unsigned long		flags;
> +#endif

Don't put ifdefs in the .c code please.

> +	ssize_t			rc = count;
> +
> +	if (count > 2)
> +		return -EINVAL;
> +
> +	if (count > 0 && buf[count-1] == '\n')
> +		((char *) buf)[count-1] = 0;
> +
> +	if (buf[0] != '1')
> +		return -EINVAL;
> +
> +#if defined(CONFIG_USB_DEBUG)
> +	/* force remote wakeup enabled in case gadget driver doesn't support */
> +	spin_lock_irqsave(&dev->lock, flags);
> +	dev->remote_wakeup = 1;
> +	dev->dev_status |= (1 << USB_DEVICE_REMOTE_WAKEUP);
> +	spin_unlock_irqrestore(&dev->lock, flags);
> +#endif

Why is this a debug-only thing?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux