aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-pci.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2010-03-05 16:43:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:37 -0500
commit2f4cbb3d834922ffa0309b6a08fa42dac87ef9d2 (patch)
tree9c4b919b3851d3e0c066ba5c456bf0d2c150da4f /drivers/mmc/host/sdhci-pci.c
parentda68c4eb258cd9f3f0b8aeb7e46b8118bb6358b6 (diff)
sdio: sdhci support for suspend mode PM features
Tested with an XO v1.5 from OLPC. Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pci.c')
-rw-r--r--drivers/mmc/host/sdhci-pci.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 5c3a1767770a..dbf054315fe2 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -501,6 +501,7 @@ static int sdhci_pci_suspend (struct pci_dev *pdev, pm_message_t state)
501{ 501{
502 struct sdhci_pci_chip *chip; 502 struct sdhci_pci_chip *chip;
503 struct sdhci_pci_slot *slot; 503 struct sdhci_pci_slot *slot;
504 mmc_pm_flag_t pm_flags = 0;
504 int i, ret; 505 int i, ret;
505 506
506 chip = pci_get_drvdata(pdev); 507 chip = pci_get_drvdata(pdev);
@@ -519,6 +520,8 @@ static int sdhci_pci_suspend (struct pci_dev *pdev, pm_message_t state)
519 sdhci_resume_host(chip->slots[i]->host); 520 sdhci_resume_host(chip->slots[i]->host);
520 return ret; 521 return ret;
521 } 522 }
523
524 pm_flags |= slot->host->mmc->pm_flags;
522 } 525 }
523 526
524 if (chip->fixes && chip->fixes->suspend) { 527 if (chip->fixes && chip->fixes->suspend) {
@@ -531,9 +534,15 @@ static int sdhci_pci_suspend (struct pci_dev *pdev, pm_message_t state)
531 } 534 }
532 535
533 pci_save_state(pdev); 536 pci_save_state(pdev);
534 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); 537 if (pm_flags & MMC_PM_KEEP_POWER) {
535 pci_disable_device(pdev); 538 if (pm_flags & MMC_PM_WAKE_SDIO_IRQ)
536 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 539 pci_enable_wake(pdev, PCI_D3hot, 1);
540 pci_set_power_state(pdev, PCI_D3hot);
541 } else {
542 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
543 pci_disable_device(pdev);
544 pci_set_power_state(pdev, pci_choose_state(pdev, state));
545 }
537 546
538 return 0; 547 return 0;
539} 548}
@@ -653,6 +662,8 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot(
653 goto unmap; 662 goto unmap;
654 } 663 }
655 664
665 host->mmc->pm_caps = MMC_PM_KEEP_POWER | MMC_PM_WAKE_SDIO_IRQ;
666
656 ret = sdhci_add_host(host); 667 ret = sdhci_add_host(host);
657 if (ret) 668 if (ret)
658 goto remove; 669 goto remove;