Commit e2142df7 authored by Kristen Carlson Accardi's avatar Kristen Carlson Accardi Committed by Vinod Koul

intel_mid_dma: fix runtime pm issues

Use the correct api in probe to enable runtime pm for this driver.
Additionally, do not just call legacy suspend for runtime_suspend,
as this duplicates some work the pci core does for you.
Signed-off-by: default avatarKristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 427cdf19
...@@ -1292,8 +1292,7 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev, ...@@ -1292,8 +1292,7 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
if (err) if (err)
goto err_dma; goto err_dma;
pm_runtime_set_active(&pdev->dev); pm_runtime_put_noidle(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_allow(&pdev->dev); pm_runtime_allow(&pdev->dev);
return 0; return 0;
...@@ -1322,6 +1321,9 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev, ...@@ -1322,6 +1321,9 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
static void __devexit intel_mid_dma_remove(struct pci_dev *pdev) static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
{ {
struct middma_device *device = pci_get_drvdata(pdev); struct middma_device *device = pci_get_drvdata(pdev);
pm_runtime_get_noresume(&pdev->dev);
pm_runtime_forbid(&pdev->dev);
middma_shutdown(pdev); middma_shutdown(pdev);
pci_dev_put(pdev); pci_dev_put(pdev);
kfree(device); kfree(device);
...@@ -1385,13 +1387,20 @@ int dma_resume(struct pci_dev *pci) ...@@ -1385,13 +1387,20 @@ int dma_resume(struct pci_dev *pci)
static int dma_runtime_suspend(struct device *dev) static int dma_runtime_suspend(struct device *dev)
{ {
struct pci_dev *pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
return dma_suspend(pci_dev, PMSG_SUSPEND); struct middma_device *device = pci_get_drvdata(pci_dev);
device->state = SUSPENDED;
return 0;
} }
static int dma_runtime_resume(struct device *dev) static int dma_runtime_resume(struct device *dev)
{ {
struct pci_dev *pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
return dma_resume(pci_dev); struct middma_device *device = pci_get_drvdata(pci_dev);
device->state = RUNNING;
iowrite32(REG_BIT0, device->dma_base + DMA_CFG);
return 0;
} }
static int dma_runtime_idle(struct device *dev) static int dma_runtime_idle(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment