OSDN Git Service

usb: dwc2: Add device partial power down functions
authorArtur Petrosyan <Arthur.Petrosyan@synopsys.com>
Thu, 8 Apr 2021 09:44:29 +0000 (13:44 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Apr 2021 13:16:38 +0000 (15:16 +0200)
commitbe2b960e57154aadd18d57897fec2cae2eef137c
treeb4de0a8d4fe4fbdda66ad70666bbbbe24afee7a9
parente9fcb07704fcef6fa6d0333fd2b3a62442eaf45b
usb: dwc2: Add device partial power down functions

For device mode Partial Power Down entering and exiting
separate functions are needed to implement the logic.
Earlier the logic was implemented in one function. Which was
confusing the readability. Also both host and device implementations
were in the same function.

- Added device partial power down functions which must be called
by dwc2_enter_partial_power_down()/dwc2_exit_partial_power_down()
functions.

- Added "in_ppd" flag in "dwc2_hsotg" struct to indicate the
core state after entering into partial power down mode.

Added function names:
dwc2_gadget_enter_partial_power_down()
dwc2_gadget_exit_partial_power_down()

NOTE: There is a checkpatch "CHECK" warning on "udelay(100)".
The delay is needed to properly exit gadget Partial Power Down
A delay less than 100 doesn't work.

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Link: https://lore.kernel.org/r/20210408094430.383B9A0094@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/gadget.c