diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-05-01 17:11:56 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-07-21 00:02:20 -0400 |
commit | 3071cafb7f6f9cbb52b1b7eb308c8b45cae0dcf8 (patch) | |
tree | b8deac0d73ab04057e6aba86faff14d6c3bd295c /drivers/mmc/host/tmio_mmc_pio.c | |
parent | d7d8d500bc03891c4a86da49858c46e2db256581 (diff) | |
download | talos-op-linux-3071cafb7f6f9cbb52b1b7eb308c8b45cae0dcf8.tar.gz talos-op-linux-3071cafb7f6f9cbb52b1b7eb308c8b45cae0dcf8.zip |
mmc: tmio: use generic GPIO CD and WP handlers
The tmio-mmc driver is already using the generic GPIO CD handler in IRQ
mode. This patch adds support for CD polling mode and also checks for
availability of a WP GPIO.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc_pio.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc_pio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index f8df02111794..0d8a9bbe30be 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -875,6 +875,9 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc) { struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_data *pdata = host->pdata; + int ret = mmc_gpio_get_ro(mmc); + if (ret >= 0) + return ret; return !((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)); @@ -884,6 +887,9 @@ static int tmio_mmc_get_cd(struct mmc_host *mmc) { struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_data *pdata = host->pdata; + int ret = mmc_gpio_get_cd(mmc); + if (ret >= 0) + return ret; if (!pdata->get_cd) return -ENOSYS; |