aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorGravatar Shawn Lin <shawn.lin@rock-chips.com> 2016-10-12 10:50:37 +0800
committerGravatar Ulf Hansson <ulf.hansson@linaro.org> 2016-11-29 09:00:37 +0100
commit50fcbbbb79de4b95a765ea170677c9810fcb9cee (patch)
tree6a9abe578055294f8ff50bda912aa53fe0de60da /drivers/mmc/core
parentmmc: dw_mmc-rockchip: add runtime PM support (diff)
downloadlinux-50fcbbbb79de4b95a765ea170677c9810fcb9cee.tar.gz
linux-50fcbbbb79de4b95a765ea170677c9810fcb9cee.tar.bz2
linux-50fcbbbb79de4b95a765ea170677c9810fcb9cee.zip
mmc: core: expose the capability of gpio card detect
Add new helper API mmc_can_gpio_cd for slot-gpio to make host drivers know whether it supports gpio card detect. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.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 27117ba47073..babe591aea96 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -258,6 +258,14 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
}
EXPORT_SYMBOL(mmc_gpiod_request_cd);
+bool mmc_can_gpio_cd(struct mmc_host *host)
+{
+ struct mmc_gpio *ctx = host->slot.handler_priv;
+
+ return ctx->cd_gpio ? true : false;
+}
+EXPORT_SYMBOL(mmc_can_gpio_cd);
+
/**
* mmc_gpiod_request_ro - request a gpio descriptor for write protection
* @host: mmc host