summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-17 19:28:05 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2018-01-18 11:08:56 +0300
commit85f9ef8cdfb463e6e8ff9fe8cdcc0aed438b526e (patch)
treec10cb09051ce0191129171a5a496de91d33db8d3 /drivers/mmc/core
parentbc45719c1b1a56047246d44c7e4ed88a8ae702c1 (diff)
downloadlinux-85f9ef8cdfb463e6e8ff9fe8cdcc0aed438b526e.tar.xz
mmc: slot-gpio: add a helper to check capability of GPIO WP detection
Like mmc_can_gpio_cd(), mmc_can_gpio_ro() will also be useful for host drivers to know whether GPIO write-protect detection is supported. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/slot-gpio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index f7c6e0542de7..3698b0576009 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -305,3 +305,11 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
return 0;
}
EXPORT_SYMBOL(mmc_gpiod_request_ro);
+
+bool mmc_can_gpio_ro(struct mmc_host *host)
+{
+ struct mmc_gpio *ctx = host->slot.handler_priv;
+
+ return ctx->ro_gpio ? true : false;
+}
+EXPORT_SYMBOL(mmc_can_gpio_ro);