Skip to content

Commit f3521d7

Browse files
jwrdegoedestorulf
authored andcommitted
mmc: sdhci-acpi: Fix Lenovo Yoga Tablet 2 Pro 1380 sdcard slot not working
The Lenovo Yoga Tablet 2 Pro 1380 sdcard slot has an active high cd pin and a broken wp pin which always reports the card being write-protected. Add a DMI quirk to address both issues. Reviewed-by: Andy Shevchenko <[email protected]> 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 a92a73b commit f3521d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/mmc/host/sdhci-acpi.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct sdhci_acpi_host {
8080
enum {
8181
DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP = BIT(0),
8282
DMI_QUIRK_SD_NO_WRITE_PROTECT = BIT(1),
83+
DMI_QUIRK_SD_CD_ACTIVE_HIGH = BIT(2),
8384
};
8485

8586
static inline void *sdhci_acpi_priv(struct sdhci_acpi_host *c)
@@ -747,6 +748,26 @@ static const struct dmi_system_id sdhci_acpi_quirks[] = {
747748
},
748749
.driver_data = (void *)DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP,
749750
},
751+
{
752+
/*
753+
* Lenovo Yoga Tablet 2 Pro 1380F/L (13" Android version) this
754+
* has broken WP reporting and an inverted CD signal.
755+
* Note this has more or less the same BIOS as the Lenovo Yoga
756+
* Tablet 2 830F/L or 1050F/L (8" and 10" Android), but unlike
757+
* the 830 / 1050 models which share the same mainboard this
758+
* model has a different mainboard and the inverted CD and
759+
* broken WP are unique to this board.
760+
*/
761+
.matches = {
762+
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
763+
DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
764+
DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
765+
/* Full match so as to NOT match the 830/1050 BIOS */
766+
DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21.X64.0005.R00.1504101516"),
767+
},
768+
.driver_data = (void *)(DMI_QUIRK_SD_NO_WRITE_PROTECT |
769+
DMI_QUIRK_SD_CD_ACTIVE_HIGH),
770+
},
750771
{
751772
/*
752773
* The Toshiba WT8-B's microSD slot always reports the card being
@@ -867,6 +888,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
867888
if (sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD)) {
868889
bool v = sdhci_acpi_flag(c, SDHCI_ACPI_SD_CD_OVERRIDE_LEVEL);
869890

891+
if (quirks & DMI_QUIRK_SD_CD_ACTIVE_HIGH)
892+
host->mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
893+
870894
err = mmc_gpiod_request_cd(host->mmc, NULL, 0, v, 0);
871895
if (err) {
872896
if (err == -EPROBE_DEFER)

0 commit comments

Comments
 (0)