]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: gadget: Change condition for processing suspend event
authorPrashanth K <quic_prashk@quicinc.com>
Fri, 24 Feb 2023 05:46:58 +0000 (11:16 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:27 +0000 (23:03 +0900)
commit16320146e125a8b417863c5df2b2abf2e2c67f12
treeeffedcfd27eca3bad84f6d0df0894d7acb8f5ef2
parent9cd8f4219d42fa682c443d649ec05fcf02a7e545
usb: dwc3: gadget: Change condition for processing suspend event

[ Upstream commit 4decf4060ecfee1f7a710999fcd421645ac0c419 ]

Currently we process the suspend interrupt event only if the
device is in configured state. Consider a case where device
is not configured and got suspend interrupt, in that case our
gadget will still use 100mA as composite_suspend didn't happen.
But battery charging specification (BC1.2) expects a downstream
device to draw less than 2.5mA when unconnected OR suspended.

Fix this by removing the condition for processing suspend event,
and thus composite_resume would set vbus draw to 2.

Fixes: 0bb040afbad3 ("dwc3: gadget: Implement the suspend entry event handler")
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/1677217619-10261-2-git-send-email-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c