]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc2: drd: restore role and overrides upon resume
authorFabrice Gasnier <fabrice.gasnier@foss.st.com>
Mon, 6 Dec 2021 15:56:43 +0000 (16:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Dec 2021 15:52:51 +0000 (16:52 +0100)
commit6a36fdafa80a59f0b83af3fbc458e194fa3378bc
tree2a965e4b3a053861a4810afe6dae82cbafc8d788
parenta918e824c800c8bf1e6ca9b3ab156d78bbe5d764
usb: dwc2: drd: restore role and overrides upon resume

Override enable bits may not be restored when going to low power mode
(e.g. when in DWC2_POWER_DOWN_PARAM_NONE).
These bits are set when probing/initializing drd (role switch). Restore
them upon resume from low power mode (in case these have been lost).

To achieve this, the last known role is restored upon resume. And the
override enable bits are always set when configuring aval, bval and vbval.

When resuming, forcing the role should be done only once, or this can cause
port changes in HOST mode for instance.
So, only restore FORCEDEVMODE/FORCEHOSTMODE when role_sw is unused

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/1638806203-6624-4-git-send-email-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/drd.c
drivers/usb/dwc2/platform.c