aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/dw/pci.c')
-rw-r--r--drivers/dma/dw/pci.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
index e89fc24b8293..fec59f1a77bb 100644
--- a/drivers/dma/dw/pci.c
+++ b/drivers/dma/dw/pci.c
@@ -75,6 +75,36 @@ static void dw_pci_remove(struct pci_dev *pdev)
75 dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret); 75 dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
76} 76}
77 77
78#ifdef CONFIG_PM_SLEEP
79
80static int dw_pci_suspend_late(struct device *dev)
81{
82 struct pci_dev *pci = to_pci_dev(dev);
83 struct dw_dma_chip *chip = pci_get_drvdata(pci);
84
85 return dw_dma_suspend(chip);
86};
87
88static int dw_pci_resume_early(struct device *dev)
89{
90 struct pci_dev *pci = to_pci_dev(dev);
91 struct dw_dma_chip *chip = pci_get_drvdata(pci);
92
93 return dw_dma_resume(chip);
94};
95
96#else /* !CONFIG_PM_SLEEP */
97
98#define dw_pci_suspend_late NULL
99#define dw_pci_resume_early NULL
100
101#endif /* !CONFIG_PM_SLEEP */
102
103static const struct dev_pm_ops dw_pci_dev_pm_ops = {
104 .suspend_late = dw_pci_suspend_late,
105 .resume_early = dw_pci_resume_early,
106};
107
78static DEFINE_PCI_DEVICE_TABLE(dw_pci_id_table) = { 108static DEFINE_PCI_DEVICE_TABLE(dw_pci_id_table) = {
79 /* Medfield */ 109 /* Medfield */
80 { PCI_VDEVICE(INTEL, 0x0827), (kernel_ulong_t)&dw_pci_pdata }, 110 { PCI_VDEVICE(INTEL, 0x0827), (kernel_ulong_t)&dw_pci_pdata },
@@ -83,6 +113,9 @@ static DEFINE_PCI_DEVICE_TABLE(dw_pci_id_table) = {
83 /* BayTrail */ 113 /* BayTrail */
84 { PCI_VDEVICE(INTEL, 0x0f06), (kernel_ulong_t)&dw_pci_pdata }, 114 { PCI_VDEVICE(INTEL, 0x0f06), (kernel_ulong_t)&dw_pci_pdata },
85 { PCI_VDEVICE(INTEL, 0x0f40), (kernel_ulong_t)&dw_pci_pdata }, 115 { PCI_VDEVICE(INTEL, 0x0f40), (kernel_ulong_t)&dw_pci_pdata },
116
117 /* Haswell */
118 { PCI_VDEVICE(INTEL, 0x9c60), (kernel_ulong_t)&dw_pci_pdata },
86 { } 119 { }
87}; 120};
88MODULE_DEVICE_TABLE(pci, dw_pci_id_table); 121MODULE_DEVICE_TABLE(pci, dw_pci_id_table);
@@ -92,6 +125,9 @@ static struct pci_driver dw_pci_driver = {
92 .id_table = dw_pci_id_table, 125 .id_table = dw_pci_id_table,
93 .probe = dw_pci_probe, 126 .probe = dw_pci_probe,
94 .remove = dw_pci_remove, 127 .remove = dw_pci_remove,
128 .driver = {
129 .pm = &dw_pci_dev_pm_ops,
130 },
95}; 131};
96 132
97module_pci_driver(dw_pci_driver); 133module_pci_driver(dw_pci_driver);