aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2013-04-08 17:28:07 -0400
committerChris Ball <cjb@laptop.org>2013-04-12 15:13:27 -0400
commitbcf53524ac4532da546cb87099a6e164d5394004 (patch)
tree486ae94de2819ecaf38ea139583a16d8772bd171 /drivers/mmc/host
parentc7ceab02543f8a03b4df3d4465b089c8117a5e09 (diff)
mmc: mxcmmc: use slot-gpio API for write-protect detection
slot-gpio API suppors read-only detection when "wp-gpios" property is present in the device tree mmc node. Use this API for write-protect detection. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/mxcmmc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 3f8d3394197c..df28ebf7e240 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -38,6 +38,7 @@
38#include <linux/of_device.h> 38#include <linux/of_device.h>
39#include <linux/of_dma.h> 39#include <linux/of_dma.h>
40#include <linux/of_gpio.h> 40#include <linux/of_gpio.h>
41#include <linux/mmc/slot-gpio.h>
41 42
42#include <asm/dma.h> 43#include <asm/dma.h>
43#include <asm/irq.h> 44#include <asm/irq.h>
@@ -917,10 +918,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc)
917 if (host->pdata && host->pdata->get_ro) 918 if (host->pdata && host->pdata->get_ro)
918 return !!host->pdata->get_ro(mmc_dev(mmc)); 919 return !!host->pdata->get_ro(mmc_dev(mmc));
919 /* 920 /*
920 * Board doesn't support read only detection; let the mmc core 921 * If board doesn't support read only detection (no mmc_gpio
921 * decide what to do. 922 * context or gpio is invalid), then let the mmc core decide
923 * what to do.
922 */ 924 */
923 return -ENOSYS; 925 return mmc_gpio_get_ro(mmc);
924} 926}
925 927
926static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) 928static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)