Re: [PATCH 07/13] langwell: USB Client Remote Wakeup Support

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

 



On Thu, Aug 05, 2010 at 02:18:21PM +0100, Alan Cox wrote:
> From: JiebingLi <jiebing.li@xxxxxxxxx>
> 
> Remote wakeup support in client driver. Made non-debug only this time.
> 
> Signed-off-by: JiebingLi <jiebing.li@xxxxxxxxx>
> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
> ---
> 
>  drivers/usb/gadget/langwell_udc.c |   67 ++++++++++++++++++++++++++++++++++---
>  drivers/usb/gadget/langwell_udc.h |    3 ++
>  2 files changed, 65 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
> index 8b92e22..4b134ab 100644
> --- a/drivers/usb/gadget/langwell_udc.c
> +++ b/drivers/usb/gadget/langwell_udc.c
> @@ -1815,6 +1815,36 @@ 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;
> +	unsigned long		flags;
> +	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;
> +
> +	/* 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);

Why would you want to wake up the Host though remote wakeup feature is not set
by the host? Host might have disabled the wakeup capability on purpose.
Peripheral must honor it.
> +
> +	langwell_wakeup(&dev->gadget);
> +
> +	return rc;
> +}
> +static DEVICE_ATTR(remote_wakeup, S_IWUSR, NULL, store_remote_wakeup);
> +
-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
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