aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-09-23 10:18:13 -0400
committerVinod Koul <vinod.koul@intel.com>2014-10-15 11:01:04 -0400
commit2540f74b187e3ec0fe106b7427c4a84c955dc140 (patch)
treeea301843ba8ea9d3a56439854082f9b96c7b52da /drivers/dma
parent7a83c045435e896db6c689145d752d28b8b99b7b (diff)
dmaengine: dw: always export dw_dma_{en,dis}able
Instead of conditional exporing of dw_dma_suspend() / dw_dma_resume() let's export dw_dma_disable() / dw_dma_enable(). Since dw_dma_shutdown() repeats dw_dma_disable() we may safely remove it at all. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/dw/core.c20
-rw-r--r--drivers/dma/dw/internal.h10
-rw-r--r--drivers/dma/dw/pci.c4
-rw-r--r--drivers/dma/dw/platform.c8
4 files changed, 12 insertions, 30 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index e94de0045aaf..48126380e036 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1687,35 +1687,23 @@ int dw_dma_remove(struct dw_dma_chip *chip)
1687} 1687}
1688EXPORT_SYMBOL_GPL(dw_dma_remove); 1688EXPORT_SYMBOL_GPL(dw_dma_remove);
1689 1689
1690void dw_dma_shutdown(struct dw_dma_chip *chip) 1690int dw_dma_disable(struct dw_dma_chip *chip)
1691{
1692 struct dw_dma *dw = chip->dw;
1693
1694 dw_dma_off(dw);
1695}
1696EXPORT_SYMBOL_GPL(dw_dma_shutdown);
1697
1698#ifdef CONFIG_PM_SLEEP
1699
1700int dw_dma_suspend(struct dw_dma_chip *chip)
1701{ 1691{
1702 struct dw_dma *dw = chip->dw; 1692 struct dw_dma *dw = chip->dw;
1703 1693
1704 dw_dma_off(dw); 1694 dw_dma_off(dw);
1705 return 0; 1695 return 0;
1706} 1696}
1707EXPORT_SYMBOL_GPL(dw_dma_suspend); 1697EXPORT_SYMBOL_GPL(dw_dma_disable);
1708 1698
1709int dw_dma_resume(struct dw_dma_chip *chip) 1699int dw_dma_enable(struct dw_dma_chip *chip)
1710{ 1700{
1711 struct dw_dma *dw = chip->dw; 1701 struct dw_dma *dw = chip->dw;
1712 1702
1713 dw_dma_on(dw); 1703 dw_dma_on(dw);
1714 return 0; 1704 return 0;
1715} 1705}
1716EXPORT_SYMBOL_GPL(dw_dma_resume); 1706EXPORT_SYMBOL_GPL(dw_dma_enable);
1717
1718#endif /* CONFIG_PM_SLEEP */
1719 1707
1720MODULE_LICENSE("GPL v2"); 1708MODULE_LICENSE("GPL v2");
1721MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller core driver"); 1709MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller core driver");
diff --git a/drivers/dma/dw/internal.h b/drivers/dma/dw/internal.h
index 9a886e3c31d3..c55c3e0bf1fe 100644
--- a/drivers/dma/dw/internal.h
+++ b/drivers/dma/dw/internal.h
@@ -38,14 +38,8 @@ struct dw_dma_chip {
38int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata); 38int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata);
39int dw_dma_remove(struct dw_dma_chip *chip); 39int dw_dma_remove(struct dw_dma_chip *chip);
40 40
41void dw_dma_shutdown(struct dw_dma_chip *chip); 41int dw_dma_disable(struct dw_dma_chip *chip);
42 42int dw_dma_enable(struct dw_dma_chip *chip);
43#ifdef CONFIG_PM_SLEEP
44
45int dw_dma_suspend(struct dw_dma_chip *chip);
46int dw_dma_resume(struct dw_dma_chip *chip);
47
48#endif /* CONFIG_PM_SLEEP */
49 43
50extern bool dw_dma_filter(struct dma_chan *chan, void *param); 44extern bool dw_dma_filter(struct dma_chan *chan, void *param);
51 45
diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
index 9c8882842689..b144706b3d85 100644
--- a/drivers/dma/dw/pci.c
+++ b/drivers/dma/dw/pci.c
@@ -82,7 +82,7 @@ static int dw_pci_suspend_late(struct device *dev)
82 struct pci_dev *pci = to_pci_dev(dev); 82 struct pci_dev *pci = to_pci_dev(dev);
83 struct dw_dma_chip *chip = pci_get_drvdata(pci); 83 struct dw_dma_chip *chip = pci_get_drvdata(pci);
84 84
85 return dw_dma_suspend(chip); 85 return dw_dma_disable(chip);
86}; 86};
87 87
88static int dw_pci_resume_early(struct device *dev) 88static int dw_pci_resume_early(struct device *dev)
@@ -90,7 +90,7 @@ static int dw_pci_resume_early(struct device *dev)
90 struct pci_dev *pci = to_pci_dev(dev); 90 struct pci_dev *pci = to_pci_dev(dev);
91 struct dw_dma_chip *chip = pci_get_drvdata(pci); 91 struct dw_dma_chip *chip = pci_get_drvdata(pci);
92 92
93 return dw_dma_resume(chip); 93 return dw_dma_enable(chip);
94}; 94};
95 95
96#endif /* CONFIG_PM_SLEEP */ 96#endif /* CONFIG_PM_SLEEP */
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index d50077e48187..a630161473a4 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -226,7 +226,7 @@ static void dw_shutdown(struct platform_device *pdev)
226{ 226{
227 struct dw_dma_chip *chip = platform_get_drvdata(pdev); 227 struct dw_dma_chip *chip = platform_get_drvdata(pdev);
228 228
229 dw_dma_shutdown(chip); 229 dw_dma_disable(chip);
230 clk_disable_unprepare(chip->clk); 230 clk_disable_unprepare(chip->clk);
231} 231}
232 232
@@ -253,7 +253,7 @@ static int dw_suspend_late(struct device *dev)
253 struct platform_device *pdev = to_platform_device(dev); 253 struct platform_device *pdev = to_platform_device(dev);
254 struct dw_dma_chip *chip = platform_get_drvdata(pdev); 254 struct dw_dma_chip *chip = platform_get_drvdata(pdev);
255 255
256 dw_dma_suspend(chip); 256 dw_dma_disable(chip);
257 clk_disable_unprepare(chip->clk); 257 clk_disable_unprepare(chip->clk);
258 258
259 return 0; 259 return 0;
@@ -265,7 +265,7 @@ static int dw_resume_early(struct device *dev)
265 struct dw_dma_chip *chip = platform_get_drvdata(pdev); 265 struct dw_dma_chip *chip = platform_get_drvdata(pdev);
266 266
267 clk_prepare_enable(chip->clk); 267 clk_prepare_enable(chip->clk);
268 return dw_dma_resume(chip); 268 return dw_dma_enable(chip);
269} 269}
270 270
271#endif /* CONFIG_PM_SLEEP */ 271#endif /* CONFIG_PM_SLEEP */
@@ -277,7 +277,7 @@ static const struct dev_pm_ops dw_dev_pm_ops = {
277static struct platform_driver dw_driver = { 277static struct platform_driver dw_driver = {
278 .probe = dw_probe, 278 .probe = dw_probe,
279 .remove = dw_remove, 279 .remove = dw_remove,
280 .shutdown = dw_shutdown, 280 .shutdown = dw_shutdown,
281 .driver = { 281 .driver = {
282 .name = "dw_dmac", 282 .name = "dw_dmac",
283 .pm = &dw_dev_pm_ops, 283 .pm = &dw_dev_pm_ops,