usb: dwc3: gadget: Change condition for processing suspend event
[ Upstream commit4decf4060e] 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:72704f876f("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8a859ac86d
commit
98bf98e749
@@ -3726,15 +3726,8 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
|
|||||||
break;
|
break;
|
||||||
case DWC3_DEVICE_EVENT_EOPF:
|
case DWC3_DEVICE_EVENT_EOPF:
|
||||||
/* It changed to be suspend event for version 2.30a and above */
|
/* It changed to be suspend event for version 2.30a and above */
|
||||||
if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) {
|
if (!DWC3_VER_IS_PRIOR(DWC3, 230A))
|
||||||
/*
|
dwc3_gadget_suspend_interrupt(dwc, event->event_info);
|
||||||
* Ignore suspend event until the gadget enters into
|
|
||||||
* USB_STATE_CONFIGURED state.
|
|
||||||
*/
|
|
||||||
if (dwc->gadget->state >= USB_STATE_CONFIGURED)
|
|
||||||
dwc3_gadget_suspend_interrupt(dwc,
|
|
||||||
event->event_info);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case DWC3_DEVICE_EVENT_SOF:
|
case DWC3_DEVICE_EVENT_SOF:
|
||||||
case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
|
case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
|
||||||
|
|||||||
Reference in New Issue
Block a user