Skip to content

Commit

Permalink
mmc: mxcmmc: use slot-gpio API for write-protect detection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vdsao authored and cjb committed Apr 12, 2013
1 parent c7ceab0 commit bcf5352
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/mmc/host/mxcmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/of_device.h>
#include <linux/of_dma.h>
#include <linux/of_gpio.h>
#include <linux/mmc/slot-gpio.h>

#include <asm/dma.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -917,10 +918,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc)
if (host->pdata && host->pdata->get_ro)
return !!host->pdata->get_ro(mmc_dev(mmc));
/*
* Board doesn't support read only detection; let the mmc core
* decide what to do.
* If board doesn't support read only detection (no mmc_gpio
* context or gpio is invalid), then let the mmc core decide
* what to do.
*/
return -ENOSYS;
return mmc_gpio_get_ro(mmc);
}

static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)
Expand Down

0 comments on commit bcf5352

Please sign in to comment.