Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252598
b: refs/heads/master
c: e2142df
h: refs/heads/master
v: v3
  • Loading branch information
Kristen Carlson Accardi authored and Vinod Koul committed Apr 1, 2011
1 parent 63cb8d2 commit d963532
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 427cdf19b97e509e21e5d347e18d8b0b34723dfc
refs/heads/master: e2142df7ec7184ed4a77ada686bc1eb41075490f
17 changes: 13 additions & 4 deletions trunk/drivers/dma/intel_mid_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,7 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
if (err)
goto err_dma;

pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_allow(&pdev->dev);
return 0;

Expand Down Expand Up @@ -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)
{
struct middma_device *device = pci_get_drvdata(pdev);

pm_runtime_get_noresume(&pdev->dev);
pm_runtime_forbid(&pdev->dev);
middma_shutdown(pdev);
pci_dev_put(pdev);
kfree(device);
Expand Down Expand Up @@ -1385,13 +1387,20 @@ int dma_resume(struct pci_dev *pci)
static int dma_runtime_suspend(struct device *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)
{
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)
Expand Down

0 comments on commit d963532

Please sign in to comment.