summaryrefslogtreecommitdiffstats
path: root/drivers/memstick
diff options
context:
space:
mode:
authorUlf Hansson2018-06-04 08:30:24 +0200
committerUlf Hansson2018-12-17 08:26:24 +0100
commit4dad599b8b5d1ffc5ef12a2edb13d15d537202ba (patch)
tree05f48c34b475d257494f4f4882549d3c53dd6750 /drivers/memstick
parentmmc: rtsx_usb_sdmmc: Re-work runtime PM support (diff)
downloadkernel-qcow2-linux-4dad599b8b5d1ffc5ef12a2edb13d15d537202ba.tar.gz
kernel-qcow2-linux-4dad599b8b5d1ffc5ef12a2edb13d15d537202ba.tar.xz
kernel-qcow2-linux-4dad599b8b5d1ffc5ef12a2edb13d15d537202ba.zip
mmc: rtsx_usb_sdmmc: Re-work card detection/removal support
The rtsx USB parent device, has logic to detect when a card is inserted into the card slot. Although, the logic can't detect when a card is removed. This makes things a bit tricky, which is why the current method is simply to turn on MMC_CAP_NEEDS_POLL during probe. Using MMC_CAP_NEEDS_POLL means lots of energy being wasted, as the mmc host becomes runtime resumed frequently by the mmc core, while it polls for new cards being inserted. To address this problem, let's start relying on that the rtsx USB driver runtime resumes its child device, which is the rtsx_usb_sdmmc device, when it detects that a new card being inserted. This means dropping MMC_CAP_NEEDS_POLL from being set during probe. Instead let's implement a ->runtime_resume() callback to schedule a detect work and to set MMC_CAP_NEEDS_POLL. In this way, polling is enabled as long as there is card inserted, thus we can rely on the mmc core to detect also when the card becomes removed. Furthermore, to avoid polling forever after a card has been removed, let's implement a ->runtime_suspend() callback and make it clear MMC_CAP_NEEDS_POLL. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Diffstat (limited to 'drivers/memstick')
0 files changed, 0 insertions, 0 deletions