]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
memstick: rtsx_usb_ms: Support runtime power management
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Fri, 11 Jan 2019 08:30:00 +0000 (09:30 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit9243eb5bc647b395f7b033b6358008caa559ca89
treea2cc18d1bf50e5f8966a95058c496077142a7f02
parent955e0a810951717b6d706b3a86d5bf9a753d1df3
memstick: rtsx_usb_ms: Support runtime power management

BugLink: https://bugs.launchpad.net/bugs/1811337
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>
(cherry picked from commit 6827ca573c03385439fdfc8b512d556dc7c54fc9)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/memstick/host/rtsx_usb_ms.c