]> git.baikalelectronics.ru Git - kernel.git/commit
memstick: rtsx_usb_ms: Support runtime power management
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 5 Nov 2018 08:45:06 +0000 (16:45 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Dec 2018 07:26:24 +0000 (08:26 +0100)
commit7fd97fc800a7fc27c97a1265b9b72fb80511377a
tree6569c07a0954abec2a3b2d2ee77641b4d16e576a
parenta4c824d8bb593e83f41f9b5019bb872189ba6b10
memstick: rtsx_usb_ms: Support runtime power management

In order to let host's parent device, rtsx_usb, to use USB remote wake
up signaling to do card detection, it needs to be suspended. Hence it's
necessary to add runtime PM support for the memstick host.

To keep memstick host stays suspended when it's not in use, convert the
card detection function from kthread to delayed_work, which can be
scheduled when the host is resumed and can be canceled when the host is
suspended.

Put the device to suspend when there's no card and the power mode is
MEMSTICK_POWER_OFF.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/memstick/host/rtsx_usb_ms.c