Skip to content

Commit 031d2cc

Browse files
kishonstorulf
authored andcommitted
mmc: sdhci-omap: Set caps2 to indicate no physical write protect pin
After commit 6d5cd06 ("mmc: sdhci: use WP GPIO in sdhci_check_ro()") and commit 39ee32c ("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: 6d5cd06 ("mmc: sdhci: use WP GPIO in sdhci_check_ro()") Fixes: 39ee32c ("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>
1 parent 2b77158 commit 031d2cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mmc/host/sdhci-omap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,9 @@ static int sdhci_omap_probe(struct platform_device *pdev)
10561056
mmc->f_max = 48000000;
10571057
}
10581058

1059+
if (!mmc_can_gpio_ro(mmc))
1060+
mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
1061+
10591062
pltfm_host->clk = devm_clk_get(dev, "fck");
10601063
if (IS_ERR(pltfm_host->clk)) {
10611064
ret = PTR_ERR(pltfm_host->clk);

0 commit comments

Comments
 (0)