]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci-omap: Set caps2 to indicate no physical write protect pin
authorKishon Vijay Abraham I <kishon@ti.com>
Thu, 21 Mar 2019 06:15:44 +0000 (11:45 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 21 Mar 2019 10:19:06 +0000 (11:19 +0100)
commitb0a9bcbc2f103f689819eae81b888395a19fd1ca
treefe4d3fe3a5306ff15215cae8d1e7d1495dea394e
parent3660318004cc27b1dac1e00b7c1240f968a7e037
mmc: sdhci-omap: Set caps2 to indicate no physical write protect pin

After commit e58af1d6c374838 ("mmc: sdhci: use WP GPIO in
sdhci_check_ro()") and commit dd773835e5432e3 ("mmc: sdhci-omap: drop
->get_ro() implementation"), sdhci-omap relied on SDHCI_PRESENT_STATE
to check if the card is read-only, if wp-gpios is not populated
in device tree. However SDHCI_PRESENT_STATE in sdhci-omap does not have
correct read-only state.

sdhci-omap can be used by platforms with both micro SD slot and standard
SD slot with physical write protect pin (using GPIO). Set caps2 to
MMC_CAP2_NO_WRITE_PROTECT based on if wp-gpios property is populated or
not.

This fix is required since existing device-tree node doesn't have
"disable-wp" property and to preserve old-dt compatibility.

Fixes: e58af1d6c374838 ("mmc: sdhci: use WP GPIO in sdhci_check_ro()")
Fixes: dd773835e5432e3 ("mmc: sdhci-omap: drop ->get_ro() implementation")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-omap.c