]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mmc: core: Add support for Power Off Notification for SD cards
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 4 May 2021 16:12:22 +0000 (18:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 May 2021 13:12:29 +0000 (15:12 +0200)
commit24d558f75ba3bbe76a974c34c05f7a98d2368be3
tree5c4a27796695cae52d211ae7fb710d224af766da
parent98ac8c53e1a7ad3194bf08d38cad9adbbaf87166
mmc: core: Add support for Power Off Notification for SD cards

Rather than only deselecting the SD card via a CMD7, before we cut power to
it at system suspend, at runtime suspend or at shutdown, let's add support
for a graceful power off sequence via enabling the SD Power Off
Notification feature.

Note that, the Power Off Notification feature was added in the SD spec
v4.x, which is several years ago. However, it's still a bit unclear how
often the SD card vendors decides to implement support for it. To validate
these changes a Sandisk Extreme PRO A2 64GB has been used, which seems to
work nicely.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20210504161222.101536-12-ulf.hansson@linaro.org
drivers/mmc/core/sd.c
include/linux/mmc/sd.h