diff options
| -rw-r--r-- | drivers/mmc/host/dw_mmc.c | 11 | ||||
| -rw-r--r-- | include/linux/mmc/dw_mmc.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 39cf54f479d9..8f216edbdf08 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
| @@ -996,7 +996,8 @@ static int dw_mci_get_ro(struct mmc_host *mmc) | |||
| 996 | int gpio_ro = mmc_gpio_get_ro(mmc); | 996 | int gpio_ro = mmc_gpio_get_ro(mmc); |
| 997 | 997 | ||
| 998 | /* Use platform get_ro function, else try on board write protect */ | 998 | /* Use platform get_ro function, else try on board write protect */ |
| 999 | if (slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) | 999 | if ((slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) || |
| 1000 | (slot->host->quirks & DW_MCI_QUIRK_NO_WRITE_PROTECT)) | ||
| 1000 | read_only = 0; | 1001 | read_only = 0; |
| 1001 | else if (!IS_ERR_VALUE(gpio_ro)) | 1002 | else if (!IS_ERR_VALUE(gpio_ro)) |
| 1002 | read_only = gpio_ro; | 1003 | read_only = gpio_ro; |
| @@ -2014,8 +2015,11 @@ static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot) | |||
| 2014 | 2015 | ||
| 2015 | /* get quirks */ | 2016 | /* get quirks */ |
| 2016 | for (idx = 0; idx < ARRAY_SIZE(of_slot_quirks); idx++) | 2017 | for (idx = 0; idx < ARRAY_SIZE(of_slot_quirks); idx++) |
| 2017 | if (of_get_property(np, of_slot_quirks[idx].quirk, NULL)) | 2018 | if (of_get_property(np, of_slot_quirks[idx].quirk, NULL)) { |
| 2019 | dev_warn(dev, "Slot quirk %s is deprecated\n", | ||
| 2020 | of_slot_quirks[idx].quirk); | ||
| 2018 | quirks |= of_slot_quirks[idx].id; | 2021 | quirks |= of_slot_quirks[idx].id; |
| 2022 | } | ||
| 2019 | 2023 | ||
| 2020 | return quirks; | 2024 | return quirks; |
| 2021 | } | 2025 | } |
| @@ -2279,6 +2283,9 @@ static struct dw_mci_of_quirks { | |||
| 2279 | { | 2283 | { |
| 2280 | .quirk = "broken-cd", | 2284 | .quirk = "broken-cd", |
| 2281 | .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION, | 2285 | .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION, |
| 2286 | }, { | ||
| 2287 | .quirk = "disable-wp", | ||
| 2288 | .id = DW_MCI_QUIRK_NO_WRITE_PROTECT, | ||
| 2282 | }, | 2289 | }, |
| 2283 | }; | 2290 | }; |
| 2284 | 2291 | ||
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index babaea93bca6..29ce014ab421 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -213,6 +213,8 @@ struct dw_mci_dma_ops { | |||
| 213 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) | 213 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) |
| 214 | /* Unreliable card detection */ | 214 | /* Unreliable card detection */ |
| 215 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) | 215 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) |
| 216 | /* No write protect */ | ||
| 217 | #define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) | ||
| 216 | 218 | ||
| 217 | /* Slot level quirks */ | 219 | /* Slot level quirks */ |
| 218 | /* This slot has no write protect */ | 220 | /* This slot has no write protect */ |
