diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2012-09-17 14:16:39 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-10-03 10:05:16 -0400 |
commit | b4967aa58e2bbafbb280dd4f0c5a777181500e41 (patch) | |
tree | 3899b2b1cd497a416a885f552b2f5ecdeaf7b0a8 | |
parent | f90a0612f0e110a8af976835273124dff4fa8b3d (diff) |
mmc: dw_mmc: add quirk to indicate missing write protect line
If the write protect pad of the controller is not connected to the write
protect pin of the slot, the driver should be notified of this condition
so that incorrect check for write protection by reading the WRTORT
register can avoided. The get_ro platform callback can be used for in
such cases, but with device tree support enabled, such platform callbacks
cannot be supported.
Add a new quirk for notifying the driver about the missing write protect
line so the driver can assume that the card write protection is disabled.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 4 | ||||
-rw-r--r-- | include/linux/mmc/dw_mmc.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index de45ad24becb..455a155406bc 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -830,7 +830,9 @@ static int dw_mci_get_ro(struct mmc_host *mmc) | |||
830 | struct dw_mci_board *brd = slot->host->pdata; | 830 | struct dw_mci_board *brd = slot->host->pdata; |
831 | 831 | ||
832 | /* Use platform get_ro function, else try on board write protect */ | 832 | /* Use platform get_ro function, else try on board write protect */ |
833 | if (brd->get_ro) | 833 | if (brd->quirks & DW_MCI_QUIRK_NO_WRITE_PROTECT) |
834 | read_only = 0; | ||
835 | else if (brd->get_ro) | ||
834 | read_only = brd->get_ro(slot->id); | 836 | read_only = brd->get_ro(slot->id); |
835 | else | 837 | else |
836 | read_only = | 838 | read_only = |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 787ad569c99b..b72e4aa91c11 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -205,7 +205,8 @@ struct dw_mci_dma_ops { | |||
205 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) | 205 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) |
206 | /* Unreliable card detection */ | 206 | /* Unreliable card detection */ |
207 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) | 207 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) |
208 | 208 | /* Write Protect detection not available */ | |
209 | #define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) | ||
209 | 210 | ||
210 | struct dma_pdata; | 211 | struct dma_pdata; |
211 | 212 | ||