diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-05-19 14:36:02 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-22 04:05:21 -0400 |
commit | ac8fb3e8627d5494f3d2221925a82be4c1778b0e (patch) | |
tree | 5e2e62928e4eeb67aac2363b613ec087546912d6 /drivers/mmc/host/tmio_mmc.c | |
parent | 65a1b0347a329422e939e14daae6dad9a29e9cf2 (diff) |
tmio: add a platform flag to disable card write-protection detection
Write-protection status is not always available, e.g., micro-SD cards do not
have a write-protection switch at all. This patch adds a flag to let platforms
force tmio_mmc to consider the card writable.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 3ecd41875fac..faa16b7d9412 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -748,8 +748,11 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
748 | static int tmio_mmc_get_ro(struct mmc_host *mmc) | 748 | static int tmio_mmc_get_ro(struct mmc_host *mmc) |
749 | { | 749 | { |
750 | struct tmio_mmc_host *host = mmc_priv(mmc); | 750 | struct tmio_mmc_host *host = mmc_priv(mmc); |
751 | struct mfd_cell *cell = host->pdev->dev.platform_data; | ||
752 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
751 | 753 | ||
752 | return (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT) ? 0 : 1; | 754 | return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || |
755 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; | ||
753 | } | 756 | } |
754 | 757 | ||
755 | static const struct mmc_host_ops tmio_mmc_ops = { | 758 | static const struct mmc_host_ops tmio_mmc_ops = { |