aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanxiao.Dong <chuanxiao.dong@intel.com>2014-07-15 05:28:05 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-26 05:23:41 -0400
commit6b91f2d42ad5506f21f83e25ffd56f27981825a7 (patch)
tree4b5706c8101096d21ece4384648c84261525c34e
parent5204d00f06ac9af4ef9c469cce7f9bbe179739b1 (diff)
mmc: sdhci-pci: remove PCI PM functions in suspend/resume callback
It is not required (in fact it even is not recommended) that a PCI driver's suspend() callback save the standard configuration registers of the device, prepare it for waking up the system, or put it into a low-power state. All of these operations can very well be taken care of by the PCI subsystem, without the driver's participation. Thus remove these PCI functions. For the device which has wake up capability, use device_init_wakeup to init the wake up capability so that PCI core will help to enable the wakeup for it. Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci-pci.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 42f4633d0060..c3a1debc9289 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -1143,18 +1143,13 @@ static int sdhci_pci_suspend(struct device *dev)
1143 goto err_pci_suspend; 1143 goto err_pci_suspend;
1144 } 1144 }
1145 1145
1146 pci_save_state(pdev);
1147 if (pm_flags & MMC_PM_KEEP_POWER) { 1146 if (pm_flags & MMC_PM_KEEP_POWER) {
1148 if (pm_flags & MMC_PM_WAKE_SDIO_IRQ) { 1147 if (pm_flags & MMC_PM_WAKE_SDIO_IRQ)
1149 pci_pme_active(pdev, true); 1148 device_init_wakeup(dev, true);
1150 pci_enable_wake(pdev, PCI_D3hot, 1); 1149 else
1151 } 1150 device_init_wakeup(dev, false);
1152 pci_set_power_state(pdev, PCI_D3hot); 1151 } else
1153 } else { 1152 device_init_wakeup(dev, false);
1154 pci_enable_wake(pdev, PCI_D3hot, 0);
1155 pci_disable_device(pdev);
1156 pci_set_power_state(pdev, PCI_D3hot);
1157 }
1158 1153
1159 return 0; 1154 return 0;
1160 1155
@@ -1175,12 +1170,6 @@ static int sdhci_pci_resume(struct device *dev)
1175 if (!chip) 1170 if (!chip)
1176 return 0; 1171 return 0;
1177 1172
1178 pci_set_power_state(pdev, PCI_D0);
1179 pci_restore_state(pdev);
1180 ret = pci_enable_device(pdev);
1181 if (ret)
1182 return ret;
1183
1184 if (chip->fixes && chip->fixes->resume) { 1173 if (chip->fixes && chip->fixes->resume) {
1185 ret = chip->fixes->resume(chip); 1174 ret = chip->fixes->resume(chip);
1186 if (ret) 1175 if (ret)