提交 bcf53524 编写于 作者: A Anatolij Gustschin 提交者: Chris Ball

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: NAnatolij Gustschin <agust@denx.de>
Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 c7ceab02
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_dma.h> #include <linux/of_dma.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/mmc/slot-gpio.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -917,10 +918,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc) ...@@ -917,10 +918,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc)
if (host->pdata && host->pdata->get_ro) if (host->pdata && host->pdata->get_ro)
return !!host->pdata->get_ro(mmc_dev(mmc)); return !!host->pdata->get_ro(mmc_dev(mmc));
/* /*
* Board doesn't support read only detection; let the mmc core * If board doesn't support read only detection (no mmc_gpio
* decide what to do. * 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) static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册