misc: rtsx: Rework runtime power management flow
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 25 Jan 2022 05:50:07 +0000 (13:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Jan 2022 17:53:28 +0000 (18:53 +0100)
commit597568e8df046ebf349c706b281a711297ab20fb
treefb4b2f40db686d24f776abf59dc7ce1458d37330
parent7499b529d97f752124fa62fefa1d6d44b371215a
misc: rtsx: Rework runtime power management flow

Commit 5b4258f6721f ("misc: rtsx: rts5249 support runtime PM")
uses "rtd3_work" and "idle_work" to manage it's own runtime PM state
machine.

When its child device, rtsx_pci_sdmmc, uses runtime PM refcount
correctly, all the additional works can be managed by generic runtime PM
helpers.

So consolidate "idle_work" and "rtd3_work" into generic runtime idle
callback and runtime suspend callback, respectively.

Fixes: 5b4258f6721f ("misc: rtsx: rts5249 support runtime PM")
Cc: Ricky WU <ricky_wu@realtek.com>
Tested-by: Ricky WU <ricky_wu@realtek.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20220125055010.1866563-2-kai.heng.feng@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cardreader/rtsx_pcr.c
include/linux/rtsx_pci.h