Skip to content

Commit 3397b25

Browse files
jwrdegoedestorulf
authored andcommitted
mmc: sdhci-acpi: Disable write protect detection on Acer Aspire Switch 10 (SW5-012)
On the Acer Aspire Switch 10 (SW5-012) microSD slot always reports the card being write-protected even though microSD cards do not have a write-protect switch at all. Add a new DMI_QUIRK_SD_NO_WRITE_PROTECT quirk which when set sets the MMC_CAP2_NO_WRITE_PROTECT flag on the controller for the external SD slot; and add a DMI quirk table entry which selects this quirk for the Acer SW5-012. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Adrian Hunter <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 84d49b3 commit 3397b25

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/mmc/host/sdhci-acpi.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct sdhci_acpi_host {
8080

8181
enum {
8282
DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP = BIT(0),
83+
DMI_QUIRK_SD_NO_WRITE_PROTECT = BIT(1),
8384
};
8485

8586
static inline void *sdhci_acpi_priv(struct sdhci_acpi_host *c)
@@ -671,6 +672,18 @@ static const struct dmi_system_id sdhci_acpi_quirks[] = {
671672
},
672673
.driver_data = (void *)DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP,
673674
},
675+
{
676+
/*
677+
* The Acer Aspire Switch 10 (SW5-012) microSD slot always
678+
* reports the card being write-protected even though microSD
679+
* cards do not have a write-protect switch at all.
680+
*/
681+
.matches = {
682+
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
683+
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
684+
},
685+
.driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT,
686+
},
674687
{} /* Terminating entry */
675688
};
676689

@@ -795,6 +808,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
795808

796809
if (quirks & DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP)
797810
c->reset_signal_volt_on_suspend = true;
811+
812+
if (quirks & DMI_QUIRK_SD_NO_WRITE_PROTECT)
813+
host->mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
798814
}
799815

800816
err = sdhci_setup_host(host);

0 commit comments

Comments
 (0)