diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-05-22 22:35:33 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-22 22:35:33 -0400 |
commit | 8ace5c4698ec8da53e69095596718d5a936433de (patch) | |
tree | 1f5959b3ac289e3bde420cc14109be0cc518a75a /arch/sh/kernel/cpu | |
parent | a375b15164dd9264f724ad941825e52c90145151 (diff) | |
parent | 71a8638480eb8fb6cfabe2ee9ca3fbc6e3453a14 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/sq.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/pm_runtime.c | 33 |
2 files changed, 23 insertions, 11 deletions
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index 14726eef1ce0..f0907995b4c9 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/prefetch.h> | ||
23 | #include <asm/page.h> | 24 | #include <asm/page.h> |
24 | #include <asm/cacheflush.h> | 25 | #include <asm/cacheflush.h> |
25 | #include <cpu/sq.h> | 26 | #include <cpu/sq.h> |
diff --git a/arch/sh/kernel/cpu/shmobile/pm_runtime.c b/arch/sh/kernel/cpu/shmobile/pm_runtime.c index 6dcb8166a64d..22db127afa7b 100644 --- a/arch/sh/kernel/cpu/shmobile/pm_runtime.c +++ b/arch/sh/kernel/cpu/shmobile/pm_runtime.c | |||
@@ -139,7 +139,7 @@ void platform_pm_runtime_suspend_idle(void) | |||
139 | queue_work(pm_wq, &hwblk_work); | 139 | queue_work(pm_wq, &hwblk_work); |
140 | } | 140 | } |
141 | 141 | ||
142 | int platform_pm_runtime_suspend(struct device *dev) | 142 | static int default_platform_runtime_suspend(struct device *dev) |
143 | { | 143 | { |
144 | struct platform_device *pdev = to_platform_device(dev); | 144 | struct platform_device *pdev = to_platform_device(dev); |
145 | struct pdev_archdata *ad = &pdev->archdata; | 145 | struct pdev_archdata *ad = &pdev->archdata; |
@@ -147,7 +147,7 @@ int platform_pm_runtime_suspend(struct device *dev) | |||
147 | int hwblk = ad->hwblk_id; | 147 | int hwblk = ad->hwblk_id; |
148 | int ret = 0; | 148 | int ret = 0; |
149 | 149 | ||
150 | dev_dbg(dev, "platform_pm_runtime_suspend() [%d]\n", hwblk); | 150 | dev_dbg(dev, "%s() [%d]\n", __func__, hwblk); |
151 | 151 | ||
152 | /* ignore off-chip platform devices */ | 152 | /* ignore off-chip platform devices */ |
153 | if (!hwblk) | 153 | if (!hwblk) |
@@ -183,20 +183,20 @@ int platform_pm_runtime_suspend(struct device *dev) | |||
183 | mutex_unlock(&ad->mutex); | 183 | mutex_unlock(&ad->mutex); |
184 | 184 | ||
185 | out: | 185 | out: |
186 | dev_dbg(dev, "platform_pm_runtime_suspend() [%d] returns %d\n", | 186 | dev_dbg(dev, "%s() [%d] returns %d\n", |
187 | hwblk, ret); | 187 | __func__, hwblk, ret); |
188 | 188 | ||
189 | return ret; | 189 | return ret; |
190 | } | 190 | } |
191 | 191 | ||
192 | int platform_pm_runtime_resume(struct device *dev) | 192 | static int default_platform_runtime_resume(struct device *dev) |
193 | { | 193 | { |
194 | struct platform_device *pdev = to_platform_device(dev); | 194 | struct platform_device *pdev = to_platform_device(dev); |
195 | struct pdev_archdata *ad = &pdev->archdata; | 195 | struct pdev_archdata *ad = &pdev->archdata; |
196 | int hwblk = ad->hwblk_id; | 196 | int hwblk = ad->hwblk_id; |
197 | int ret = 0; | 197 | int ret = 0; |
198 | 198 | ||
199 | dev_dbg(dev, "platform_pm_runtime_resume() [%d]\n", hwblk); | 199 | dev_dbg(dev, "%s() [%d]\n", __func__, hwblk); |
200 | 200 | ||
201 | /* ignore off-chip platform devices */ | 201 | /* ignore off-chip platform devices */ |
202 | if (!hwblk) | 202 | if (!hwblk) |
@@ -228,19 +228,19 @@ int platform_pm_runtime_resume(struct device *dev) | |||
228 | */ | 228 | */ |
229 | mutex_unlock(&ad->mutex); | 229 | mutex_unlock(&ad->mutex); |
230 | out: | 230 | out: |
231 | dev_dbg(dev, "platform_pm_runtime_resume() [%d] returns %d\n", | 231 | dev_dbg(dev, "%s() [%d] returns %d\n", |
232 | hwblk, ret); | 232 | __func__, hwblk, ret); |
233 | 233 | ||
234 | return ret; | 234 | return ret; |
235 | } | 235 | } |
236 | 236 | ||
237 | int platform_pm_runtime_idle(struct device *dev) | 237 | static int default_platform_runtime_idle(struct device *dev) |
238 | { | 238 | { |
239 | struct platform_device *pdev = to_platform_device(dev); | 239 | struct platform_device *pdev = to_platform_device(dev); |
240 | int hwblk = pdev->archdata.hwblk_id; | 240 | int hwblk = pdev->archdata.hwblk_id; |
241 | int ret = 0; | 241 | int ret = 0; |
242 | 242 | ||
243 | dev_dbg(dev, "platform_pm_runtime_idle() [%d]\n", hwblk); | 243 | dev_dbg(dev, "%s() [%d]\n", __func__, hwblk); |
244 | 244 | ||
245 | /* ignore off-chip platform devices */ | 245 | /* ignore off-chip platform devices */ |
246 | if (!hwblk) | 246 | if (!hwblk) |
@@ -252,10 +252,19 @@ int platform_pm_runtime_idle(struct device *dev) | |||
252 | /* suspend synchronously to disable clocks immediately */ | 252 | /* suspend synchronously to disable clocks immediately */ |
253 | ret = pm_runtime_suspend(dev); | 253 | ret = pm_runtime_suspend(dev); |
254 | out: | 254 | out: |
255 | dev_dbg(dev, "platform_pm_runtime_idle() [%d] done!\n", hwblk); | 255 | dev_dbg(dev, "%s() [%d] done!\n", __func__, hwblk); |
256 | return ret; | 256 | return ret; |
257 | } | 257 | } |
258 | 258 | ||
259 | static struct dev_power_domain default_power_domain = { | ||
260 | .ops = { | ||
261 | .runtime_suspend = default_platform_runtime_suspend, | ||
262 | .runtime_resume = default_platform_runtime_resume, | ||
263 | .runtime_idle = default_platform_runtime_idle, | ||
264 | USE_PLATFORM_PM_SLEEP_OPS | ||
265 | }, | ||
266 | }; | ||
267 | |||
259 | static int platform_bus_notify(struct notifier_block *nb, | 268 | static int platform_bus_notify(struct notifier_block *nb, |
260 | unsigned long action, void *data) | 269 | unsigned long action, void *data) |
261 | { | 270 | { |
@@ -276,6 +285,7 @@ static int platform_bus_notify(struct notifier_block *nb, | |||
276 | hwblk_disable(hwblk_info, hwblk); | 285 | hwblk_disable(hwblk_info, hwblk); |
277 | /* make sure driver re-inits itself once */ | 286 | /* make sure driver re-inits itself once */ |
278 | __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags); | 287 | __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags); |
288 | dev->pwr_domain = &default_power_domain; | ||
279 | break; | 289 | break; |
280 | /* TODO: add BUS_NOTIFY_BIND_DRIVER and increase idle count */ | 290 | /* TODO: add BUS_NOTIFY_BIND_DRIVER and increase idle count */ |
281 | case BUS_NOTIFY_BOUND_DRIVER: | 291 | case BUS_NOTIFY_BOUND_DRIVER: |
@@ -289,6 +299,7 @@ static int platform_bus_notify(struct notifier_block *nb, | |||
289 | __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags); | 299 | __set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags); |
290 | break; | 300 | break; |
291 | case BUS_NOTIFY_DEL_DEVICE: | 301 | case BUS_NOTIFY_DEL_DEVICE: |
302 | dev->pwr_domain = NULL; | ||
292 | break; | 303 | break; |
293 | } | 304 | } |
294 | return 0; | 305 | return 0; |