mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Elson Roy Serrao <quic_eserrao@quicinc.com>
Cc: Thinh.Nguyen@synopsys.com, balbi@kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	quic_wcheng@quicinc.com, quic_jackp@quicinc.com
Subject: Re: [PATCH v2 1/5] usb: gadget: Add remote wakeup capable flag
Date: Thu, 19 Jan 2023 14:02:27 +0100	[thread overview]
Message-ID: <Y8k/Y4O/99pnKI2h@kroah.com> (raw)
In-Reply-To: <1673992507-7823-2-git-send-email-quic_eserrao@quicinc.com>

On Tue, Jan 17, 2023 at 01:55:03PM -0800, Elson Roy Serrao wrote:
> Add a flag to indicate whether the gadget is capable
> of sending remote wakeup to the host.
> 
> Signed-off-by: Elson Roy Serrao <quic_eserrao@quicinc.com>
> ---
>  drivers/usb/gadget/composite.c | 3 +++
>  include/linux/usb/gadget.h     | 2 ++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 403563c..b83963a 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -965,6 +965,9 @@ static int set_config(struct usb_composite_dev *cdev,
>  	else
>  		usb_gadget_clear_selfpowered(gadget);
>  
> +	if (USB_CONFIG_ATT_WAKEUP & c->bmAttributes)
> +		gadget->rw_capable = 1;
> +
>  	usb_gadget_vbus_draw(gadget, power);
>  	if (result >= 0 && cdev->delayed_status)
>  		result = USB_GADGET_DELAYED_STATUS;
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index dc3092c..15785f8 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -385,6 +385,7 @@ struct usb_gadget_ops {
>   *	indicates that it supports LPM as per the LPM ECN & errata.
>   * @irq: the interrupt number for device controller.
>   * @id_number: a unique ID number for ensuring that gadget names are distinct
> + * @rw_capable: True if the gadget is capable of sending remote wakeup.
>   *
>   * Gadgets have a mostly-portable "gadget driver" implementing device
>   * functions, handling all usb configurations and interfaces.  Gadget
> @@ -446,6 +447,7 @@ struct usb_gadget {
>  	unsigned			lpm_capable:1;
>  	int				irq;
>  	int				id_number;
> +	unsigned			rw_capable:1;

Why not put this by the other bitfields in this structure?

thanks,

greg k-h

  parent reply	other threads:[~2023-01-20  5:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 21:55 [PATCH v2 0/5] Add function suspend/resume and remote wakeup support Elson Roy Serrao
2023-01-17 21:55 ` [PATCH v2 1/5] usb: gadget: Add remote wakeup capable flag Elson Roy Serrao
2023-01-19  1:44   ` Thinh Nguyen
2023-01-20  0:13     ` Elson Serrao
2023-01-20  1:15       ` Thinh Nguyen
2023-01-21  0:06         ` Elson Serrao
2023-01-21  0:21           ` Thinh Nguyen
2023-01-21  1:55             ` Alan Stern
2023-01-21  2:02               ` Thinh Nguyen
2023-01-21  2:06                 ` Alan Stern
2023-01-21  2:12                   ` Thinh Nguyen
2023-01-23 19:33                     ` Thinh Nguyen
2023-01-23 20:25                       ` Elson Serrao
2023-01-23 23:02                         ` Thinh Nguyen
2023-01-24  1:42                           ` Elson Serrao
2023-01-19 13:02   ` Greg KH [this message]
2023-01-19 23:48     ` Elson Serrao
2023-01-17 21:55 ` [PATCH v2 2/5] usb: dwc3: Add remote wakeup handling Elson Roy Serrao
2023-01-17 21:55 ` [PATCH v2 3/5] usb: gadget: Add function wakeup support Elson Roy Serrao
2023-01-17 21:55 ` [PATCH v2 4/5] usb: dwc3: Add function suspend and " Elson Roy Serrao
2023-01-19  2:18   ` Thinh Nguyen
2023-01-19 20:03     ` Elson Serrao
2023-01-17 21:55 ` [PATCH v2 5/5] usb: gadget: f_ecm: Add suspend/resume and remote " Elson Roy Serrao

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=Y8k/Y4O/99pnKI2h@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_eserrao@quicinc.com \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_wcheng@quicinc.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®