diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-05-17 17:23:46 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-05-17 17:23:46 -0400 |
commit | 290c748725c170ed9a02522959ae67f528eefe98 (patch) | |
tree | a920190b75c7e054af24d850e79cc54f5cf53263 /arch/sh | |
parent | 2d2a9163bd4f3ba301f8138c32e4790edc30156c (diff) | |
parent | 72874daa5e9064c4e8d689e6a04b1e96f687f872 (diff) |
Merge branch 'power-domains' into for-linus
* power-domains:
PM: Fix build issue in clock_ops.c for CONFIG_PM_RUNTIME unset
PM: Revert "driver core: platform_bus: allow runtime override of dev_pm_ops"
OMAP1 / PM: Use generic clock manipulation routines for runtime PM
PM / Runtime: Generic clock manipulation rountines for runtime PM (v6)
PM / Runtime: Add subsystem data field to struct dev_pm_info
OMAP2+ / PM: move runtime PM implementation to use device power domains
PM / Platform: Use generic runtime PM callbacks directly
shmobile: Use power domains for platform runtime PM
PM: Export platform bus type's default PM callbacks
PM: Make power domain callbacks take precedence over subsystem ones
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/pm_runtime.c | 33 |
1 files changed, 22 insertions, 11 deletions
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; |