aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-05-06 20:31:20 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2015-06-01 09:07:00 +0200
commit19f4424677455a01b93163975cfbcffa9adb3336 (patch)
tree995b9643e6ac498a8d9991e6df13bd2cf6db05e3 /drivers/mmc
parentmmc: Add support for disabling write-protect detection (diff)
downloadlinux-dev-19f4424677455a01b93163975cfbcffa9adb3336.tar.xz
linux-dev-19f4424677455a01b93163975cfbcffa9adb3336.zip
mmc: dt: Allow to specify that no write protect signal is present
Allow to specify in the device-tree that no physical write-protect signal is connected to a particular instance of a MMC controller. Setting the property will cause the core will assume that the SD card is always read-write. The name for the new property is 'disable-wp' and was chosen based on the property with the same function from the Synopsys designware mobile storage host controller DT bindings specification. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/host.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 86c495b7a335..99a9c9011c50 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -484,6 +484,9 @@ int mmc_of_parse(struct mmc_host *host)
else if (ret != -ENOENT)
return ret;
+ if (of_property_read_bool(np, "disable-wp"))
+ host->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
+
/* See the comment on CD inversion above */
if (ro_cap_invert ^ ro_gpio_invert)
host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;