[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230223201019.3a5njywzchztcs5e@synopsys.com>
Date: Thu, 23 Feb 2023 20:10:22 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Prashanth K <quic_prashk@...cinc.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Jakob Koschel <jakobkoschel@...il.com>,
Jó Ágila Bitsch <jgilab@...il.com>,
Alan Stern <stern@...land.harvard.edu>,
Pratham Pratap <quic_ppratap@...cinc.com>,
Jack Pham <quic_jackp@...cinc.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] usb: gadget: composite: Draw 100mA current if not
configured
On Thu, Feb 23, 2023, Prashanth K wrote:
> Currently we don't change the current value if device isn't in
> configured state. But the battery charging specification says,
Can you provide the spec section also?
> device can draw up to 100mA of current if its in unconfigured
Is this related to being self-powered?
> state. Hence add a Vbus_draw work in composite_resume to draw
> 100mA if the device isn't configured.
>
> Signed-off-by: Prashanth K <quic_prashk@...cinc.com>
> ---
> drivers/usb/gadget/composite.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 403563c..386140f 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -2449,6 +2449,10 @@ void composite_resume(struct usb_gadget *gadget)
> usb_gadget_clear_selfpowered(gadget);
>
> usb_gadget_vbus_draw(gadget, maxpower);
> + } else {
> + maxpower = CONFIG_USB_GADGET_VBUS_DRAW;
> + maxpower = min(maxpower, 100U);
> + usb_gadget_vbus_draw(gadget, maxpower);
> }
>
> cdev->suspended = 0;
> --
> 2.7.4
>
Thanks,
Thinh
Powered by blists - more mailing lists