aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-03 18:04:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-03 18:04:25 -0400
commit1f3bd0f2ac870c9eb29590f193ee3d94e2d35514 (patch)
tree40a12bd6ac1fb2c0ef51e51265d773a9044c7281 /drivers
parentbb3d6bf1919a20c56b3257b4ec09e67a9226cfb2 (diff)
parenta1b2cc50679c1d2eed44e2885f6178ce907498b7 (diff)
Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: dmaengine: shdma: fix a regression: initialise DMA channels for memcpy dmaengine: shdma: Fix up fallout from runtime PM changes. Revert "clocksource: sh_cmt: Runtime PM support" Revert "clocksource: sh_tmu: Runtime PM support" sh: Fix up asm-generic/ptrace.h fallout. sh64: Move from P1SEG to CAC_ADDR for consistent sync. sh64: asm/pgtable.h needs asm/mmu.h sh: asm/tlb.h needs linux/swap.h sh: mark DMA slave ID 0 as invalid sh: Update shmin to reflect PIO dependency. sh: arch/sh/kernel/process_32.c needs linux/prefetch.h. sh: add MMCIF runtime PM support on ecovec sh: switch ap325rxa to dynamically manage the platform camera
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clocksource/sh_cmt.c12
-rw-r--r--drivers/clocksource/sh_tmu.c12
-rw-r--r--drivers/dma/shdma.c9
3 files changed, 11 insertions, 22 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 036e5865eb40..dc7c033ef587 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -24,7 +24,6 @@
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/pm_runtime.h>
28#include <linux/irq.h> 27#include <linux/irq.h>
29#include <linux/err.h> 28#include <linux/err.h>
30#include <linux/clocksource.h> 29#include <linux/clocksource.h>
@@ -153,12 +152,10 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate)
153{ 152{
154 int ret; 153 int ret;
155 154
156 /* wake up device and enable clock */ 155 /* enable clock */
157 pm_runtime_get_sync(&p->pdev->dev);
158 ret = clk_enable(p->clk); 156 ret = clk_enable(p->clk);
159 if (ret) { 157 if (ret) {
160 dev_err(&p->pdev->dev, "cannot enable clock\n"); 158 dev_err(&p->pdev->dev, "cannot enable clock\n");
161 pm_runtime_put_sync(&p->pdev->dev);
162 return ret; 159 return ret;
163 } 160 }
164 161
@@ -190,9 +187,8 @@ static void sh_cmt_disable(struct sh_cmt_priv *p)
190 /* disable interrupts in CMT block */ 187 /* disable interrupts in CMT block */
191 sh_cmt_write(p, CMCSR, 0); 188 sh_cmt_write(p, CMCSR, 0);
192 189
193 /* stop clock and mark device as idle */ 190 /* stop clock */
194 clk_disable(p->clk); 191 clk_disable(p->clk);
195 pm_runtime_put_sync(&p->pdev->dev);
196} 192}
197 193
198/* private flags */ 194/* private flags */
@@ -664,7 +660,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
664 660
665 if (p) { 661 if (p) {
666 dev_info(&pdev->dev, "kept as earlytimer\n"); 662 dev_info(&pdev->dev, "kept as earlytimer\n");
667 pm_runtime_enable(&pdev->dev);
668 return 0; 663 return 0;
669 } 664 }
670 665
@@ -679,9 +674,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
679 kfree(p); 674 kfree(p);
680 platform_set_drvdata(pdev, NULL); 675 platform_set_drvdata(pdev, NULL);
681 } 676 }
682
683 if (!is_early_platform_device(pdev))
684 pm_runtime_enable(&pdev->dev);
685 return ret; 677 return ret;
686} 678}
687 679
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 17296288a205..808135768617 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -25,7 +25,6 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/pm_runtime.h>
29#include <linux/irq.h> 28#include <linux/irq.h>
30#include <linux/err.h> 29#include <linux/err.h>
31#include <linux/clocksource.h> 30#include <linux/clocksource.h>
@@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p)
110{ 109{
111 int ret; 110 int ret;
112 111
113 /* wake up device and enable clock */ 112 /* enable clock */
114 pm_runtime_get_sync(&p->pdev->dev);
115 ret = clk_enable(p->clk); 113 ret = clk_enable(p->clk);
116 if (ret) { 114 if (ret) {
117 dev_err(&p->pdev->dev, "cannot enable clock\n"); 115 dev_err(&p->pdev->dev, "cannot enable clock\n");
118 pm_runtime_put_sync(&p->pdev->dev);
119 return ret; 116 return ret;
120 } 117 }
121 118
@@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p)
144 /* disable interrupts in TMU block */ 141 /* disable interrupts in TMU block */
145 sh_tmu_write(p, TCR, 0x0000); 142 sh_tmu_write(p, TCR, 0x0000);
146 143
147 /* stop clock and mark device as idle */ 144 /* stop clock */
148 clk_disable(p->clk); 145 clk_disable(p->clk);
149 pm_runtime_put_sync(&p->pdev->dev);
150} 146}
151 147
152static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, 148static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta,
@@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
415 411
416 if (p) { 412 if (p) {
417 dev_info(&pdev->dev, "kept as earlytimer\n"); 413 dev_info(&pdev->dev, "kept as earlytimer\n");
418 pm_runtime_enable(&pdev->dev);
419 return 0; 414 return 0;
420 } 415 }
421 416
@@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
430 kfree(p); 425 kfree(p);
431 platform_set_drvdata(pdev, NULL); 426 platform_set_drvdata(pdev, NULL);
432 } 427 }
433
434 if (!is_early_platform_device(pdev))
435 pm_runtime_enable(&pdev->dev);
436 return ret; 428 return ret;
437} 429}
438 430
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 636e40925b16..2a638f9f09a2 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -343,7 +343,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan)
343 343
344 dmae_set_dmars(sh_chan, cfg->mid_rid); 344 dmae_set_dmars(sh_chan, cfg->mid_rid);
345 dmae_set_chcr(sh_chan, cfg->chcr); 345 dmae_set_chcr(sh_chan, cfg->chcr);
346 } else if ((sh_dmae_readl(sh_chan, CHCR) & 0xf00) != 0x400) { 346 } else {
347 dmae_init(sh_chan); 347 dmae_init(sh_chan);
348 } 348 }
349 349
@@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
1144 /* platform data */ 1144 /* platform data */
1145 shdev->pdata = pdata; 1145 shdev->pdata = pdata;
1146 1146
1147 platform_set_drvdata(pdev, shdev);
1148
1147 pm_runtime_enable(&pdev->dev); 1149 pm_runtime_enable(&pdev->dev);
1148 pm_runtime_get_sync(&pdev->dev); 1150 pm_runtime_get_sync(&pdev->dev);
1149 1151
@@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
1256 1258
1257 pm_runtime_put(&pdev->dev); 1259 pm_runtime_put(&pdev->dev);
1258 1260
1259 platform_set_drvdata(pdev, shdev);
1260 dma_async_device_register(&shdev->common); 1261 dma_async_device_register(&shdev->common);
1261 1262
1262 return err; 1263 return err;
@@ -1278,6 +1279,8 @@ rst_err:
1278 1279
1279 if (dmars) 1280 if (dmars)
1280 iounmap(shdev->dmars); 1281 iounmap(shdev->dmars);
1282
1283 platform_set_drvdata(pdev, NULL);
1281emapdmars: 1284emapdmars:
1282 iounmap(shdev->chan_reg); 1285 iounmap(shdev->chan_reg);
1283 synchronize_rcu(); 1286 synchronize_rcu();
@@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
1316 iounmap(shdev->dmars); 1319 iounmap(shdev->dmars);
1317 iounmap(shdev->chan_reg); 1320 iounmap(shdev->chan_reg);
1318 1321
1322 platform_set_drvdata(pdev, NULL);
1323
1319 synchronize_rcu(); 1324 synchronize_rcu();
1320 kfree(shdev); 1325 kfree(shdev);
1321 1326