usb: dwc3: gadget: Check ENBLSLPM before sending ep command
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Tue, 11 Sep 2018 19:42:05 +0000 (12:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:22:55 +0000 (08:22 +0100)
commitcd51659e864b2c9e8d844f9ddde6b84df39da856
tree9281458834e6c9a9ba4c76408757a3f688b03623
parent5e57274c63b332cf3a73277db7fc48ada598c2df
usb: dwc3: gadget: Check ENBLSLPM before sending ep command

[ Upstream commit 87dd96111b0bb8e616fcbd74dbf4bb4182f2c596 ]

When operating in USB 2.0 speeds (HS/FS), if GUSB2PHYCFG.ENBLSLPM or
GUSB2PHYCFG.SUSPHY is set, it must be cleared before issuing an endpoint
command.

Current implementation only save and restore GUSB2PHYCFG.SUSPHY
configuration. We must save and clear both GUSB2PHYCFG.ENBLSLPM and
GUSB2PHYCFG.SUSPHY settings. Restore them after the command is
completed.

DWC_usb3 3.30a and DWC_usb31 1.90a programming guide section 3.2.2

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c