mmc: core: Read the SD function extension registers for power management
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 4 May 2021 16:12:20 +0000 (18:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 14 Jun 2021 11:57:36 +0000 (13:57 +0200)
commitc784f92769ae8eafb2eb489408757528ff7525df
treec02e338b1841ef0da7f4ac7bba0a2dfa85a05dc4
parentdbea8ae9febdea11cb74d094e6b730987079679e
mmc: core: Read the SD function extension registers for power management

In the SD spec v4.0 the CMD48/49 and CMD58/59 were introduced as optional
commands. In the SD spec v4.1 the SD function extension registers were
introduced, which requires support for CMD48/49/58/59 to be read/written
from/to.

Moreover, a specific function extension register were added to let the card
announce support for optional features in regards to power management. The
features that were added are "Power Off Notification", "Power Down Mode"
and "Power Sustenance".

As a first step to support this, let's read and parse the register for
power management during the SD card initialization and store the
information about the supported features in the struct mmc_card. In this
way, we prepare for subsequent changes to implement the complete support
for the new features.

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