diff options
-rw-r--r-- | drivers/mmc/host/sdhci-pci.c | 10 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pci.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index f46b84ce4ec8..92e6e81b4de2 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -225,6 +225,7 @@ static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = { | |||
225 | static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = { | 225 | static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = { |
226 | .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, | 226 | .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, |
227 | .allow_runtime_pm = true, | 227 | .allow_runtime_pm = true, |
228 | .own_cd_for_runtime_pm = true, | ||
228 | }; | 229 | }; |
229 | 230 | ||
230 | static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = { | 231 | static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = { |
@@ -289,6 +290,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = { | |||
289 | static const struct sdhci_pci_fixes sdhci_intel_byt_sd = { | 290 | static const struct sdhci_pci_fixes sdhci_intel_byt_sd = { |
290 | .quirks2 = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON, | 291 | .quirks2 = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON, |
291 | .allow_runtime_pm = true, | 292 | .allow_runtime_pm = true, |
293 | .own_cd_for_runtime_pm = true, | ||
292 | }; | 294 | }; |
293 | 295 | ||
294 | /* Define Host controllers for Intel Merrifield platform */ | 296 | /* Define Host controllers for Intel Merrifield platform */ |
@@ -1371,6 +1373,14 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( | |||
1371 | 1373 | ||
1372 | sdhci_pci_add_own_cd(slot); | 1374 | sdhci_pci_add_own_cd(slot); |
1373 | 1375 | ||
1376 | /* | ||
1377 | * Check if the chip needs a separate GPIO for card detect to wake up | ||
1378 | * from runtime suspend. If it is not there, don't allow runtime PM. | ||
1379 | * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure. | ||
1380 | */ | ||
1381 | if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio)) | ||
1382 | chip->allow_runtime_pm = false; | ||
1383 | |||
1374 | return slot; | 1384 | return slot; |
1375 | 1385 | ||
1376 | remove: | 1386 | remove: |
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h index 0347804eda80..6d718719659e 100644 --- a/drivers/mmc/host/sdhci-pci.h +++ b/drivers/mmc/host/sdhci-pci.h | |||
@@ -39,6 +39,7 @@ struct sdhci_pci_fixes { | |||
39 | unsigned int quirks; | 39 | unsigned int quirks; |
40 | unsigned int quirks2; | 40 | unsigned int quirks2; |
41 | bool allow_runtime_pm; | 41 | bool allow_runtime_pm; |
42 | bool own_cd_for_runtime_pm; | ||
42 | 43 | ||
43 | int (*probe) (struct sdhci_pci_chip *); | 44 | int (*probe) (struct sdhci_pci_chip *); |
44 | 45 | ||