aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInderpal Singh <inderpal.singh@linaro.org>2012-09-07 02:44:48 -0400
committerVinod Koul <vinod.koul@linux.intel.com>2012-09-17 23:29:52 -0400
commit7c71b8eb268ee38235f7e924d943ea9d90e59469 (patch)
tree879d110a58596a3c571506b97e4c5c827631fbae
parentfaf6fbc6f2ca3b34bf464a8bb079a998e571957c (diff)
DMA: PL330: Remove redundant runtime_suspend/resume functions
The driver's runtime_suspend/resume functions just disable/enable the clock which is already being managed at AMBA bus level runtime_suspend/resume functions. Hence, remove the driver's runtime_suspend/resume functions. Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org> Tested-by: Chander Kashyap <chander.kashyap@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-rw-r--r--drivers/dma/pl330.c61
1 files changed, 5 insertions, 56 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3a434c4b63e6..7e543698fa23 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -23,7 +23,6 @@
23#include <linux/dmaengine.h> 23#include <linux/dmaengine.h>
24#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
25#include <linux/amba/pl330.h> 25#include <linux/amba/pl330.h>
26#include <linux/pm_runtime.h>
27#include <linux/scatterlist.h> 26#include <linux/scatterlist.h>
28#include <linux/of.h> 27#include <linux/of.h>
29 28
@@ -586,8 +585,6 @@ struct dma_pl330_dmac {
586 585
587 /* Peripheral channels connected to this DMAC */ 586 /* Peripheral channels connected to this DMAC */
588 struct dma_pl330_chan *peripherals; /* keep at end */ 587 struct dma_pl330_chan *peripherals; /* keep at end */
589
590 struct clk *clk;
591}; 588};
592 589
593struct dma_pl330_desc { 590struct dma_pl330_desc {
@@ -2887,24 +2884,17 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
2887 goto probe_err1; 2884 goto probe_err1;
2888 } 2885 }
2889 2886
2890 pdmac->clk = clk_get(&adev->dev, "dma");
2891 if (IS_ERR(pdmac->clk)) {
2892 dev_err(&adev->dev, "Cannot get operation clock.\n");
2893 ret = -EINVAL;
2894 goto probe_err2;
2895 }
2896
2897 amba_set_drvdata(adev, pdmac); 2887 amba_set_drvdata(adev, pdmac);
2898 2888
2899 irq = adev->irq[0]; 2889 irq = adev->irq[0];
2900 ret = request_irq(irq, pl330_irq_handler, 0, 2890 ret = request_irq(irq, pl330_irq_handler, 0,
2901 dev_name(&adev->dev), pi); 2891 dev_name(&adev->dev), pi);
2902 if (ret) 2892 if (ret)
2903 goto probe_err3; 2893 goto probe_err2;
2904 2894
2905 ret = pl330_add(pi); 2895 ret = pl330_add(pi);
2906 if (ret) 2896 if (ret)
2907 goto probe_err4; 2897 goto probe_err3;
2908 2898
2909 INIT_LIST_HEAD(&pdmac->desc_pool); 2899 INIT_LIST_HEAD(&pdmac->desc_pool);
2910 spin_lock_init(&pdmac->pool_lock); 2900 spin_lock_init(&pdmac->pool_lock);
@@ -2965,7 +2955,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
2965 ret = dma_async_device_register(pd); 2955 ret = dma_async_device_register(pd);
2966 if (ret) { 2956 if (ret) {
2967 dev_err(&adev->dev, "unable to register DMAC\n"); 2957 dev_err(&adev->dev, "unable to register DMAC\n");
2968 goto probe_err5; 2958 goto probe_err4;
2969 } 2959 }
2970 2960
2971 dev_info(&adev->dev, 2961 dev_info(&adev->dev,
@@ -2978,12 +2968,10 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
2978 2968
2979 return 0; 2969 return 0;
2980 2970
2981probe_err5:
2982 pl330_del(pi);
2983probe_err4: 2971probe_err4:
2984 free_irq(irq, pi); 2972 pl330_del(pi);
2985probe_err3: 2973probe_err3:
2986 clk_put(pdmac->clk); 2974 free_irq(irq, pi);
2987probe_err2: 2975probe_err2:
2988 iounmap(pi->base); 2976 iounmap(pi->base);
2989probe_err1: 2977probe_err1:
@@ -3045,49 +3033,10 @@ static struct amba_id pl330_ids[] = {
3045 3033
3046MODULE_DEVICE_TABLE(amba, pl330_ids); 3034MODULE_DEVICE_TABLE(amba, pl330_ids);
3047 3035
3048#ifdef CONFIG_PM_RUNTIME
3049static int pl330_runtime_suspend(struct device *dev)
3050{
3051 struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev);
3052
3053 if (!pdmac) {
3054 dev_err(dev, "failed to get dmac\n");
3055 return -ENODEV;
3056 }
3057
3058 clk_disable(pdmac->clk);
3059
3060 return 0;
3061}
3062
3063static int pl330_runtime_resume(struct device *dev)
3064{
3065 struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev);
3066
3067 if (!pdmac) {
3068 dev_err(dev, "failed to get dmac\n");
3069 return -ENODEV;
3070 }
3071
3072 clk_enable(pdmac->clk);
3073
3074 return 0;
3075}
3076#else
3077#define pl330_runtime_suspend NULL
3078#define pl330_runtime_resume NULL
3079#endif /* CONFIG_PM_RUNTIME */
3080
3081static const struct dev_pm_ops pl330_pm_ops = {
3082 .runtime_suspend = pl330_runtime_suspend,
3083 .runtime_resume = pl330_runtime_resume,
3084};
3085
3086static struct amba_driver pl330_driver = { 3036static struct amba_driver pl330_driver = {
3087 .drv = { 3037 .drv = {
3088 .owner = THIS_MODULE, 3038 .owner = THIS_MODULE,
3089 .name = "dma-pl330", 3039 .name = "dma-pl330",
3090 .pm = &pl330_pm_ops,
3091 }, 3040 },
3092 .id_table = pl330_ids, 3041 .id_table = pl330_ids,
3093 .probe = pl330_probe, 3042 .probe = pl330_probe,