diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-08-14 06:48:16 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-23 05:03:17 -0400 |
commit | 6a93dde1e8216f7af9b2551a60fb1a5eeac4a89f (patch) | |
tree | 41a36d18a3f9441000f5658772f6263c17925279 /arch/sh/include | |
parent | 0858d9c0c591ce9baa1baf72eaf6f67823f3bc25 (diff) |
sh: Runtime PM for SuperH Mobile platform bus devices
This patch is V3 of the SuperH Mobile Runtime PM platform bus
implentation matching Rafael's Runtime PM v16.
The code gets invoked from the SuperH specific Runtime PM
platform bus functions that override the weak symbols for:
- platform_pm_runtime_suspend()
- platform_pm_runtime_resume()
- platform_pm_runtime_idle()
This Runtime PM implementation performs two levels of power
management. At the time of platform bus runtime suspend the
clock to the device is stopped instantly. Later on if all
devices within the power domain has their clocks stopped
then the device driver ->runtime_suspend() callbacks are
used to save hardware register state for each device.
Device driver ->runtime_suspend() calls are scheduled from
cpuidle context using platform_pm_runtime_suspend_idle().
When all devices have been fully suspended the processor
is allowed to enter deep sleep from cpuidle.
The runtime resume operation turns on clocks and also
restores registers if needed. It is worth noting that the
devices start in a suspended state and the device driver
is responsible for calling runtime resume before accessing
the actual hardware.
In this particular platform bus implementation runtime
resume is not allowed from interrupt context. Runtime
suspend is however allowed from interrupt context as
long as the synchronous functions are avoided.
[ updated for v17 -- PFM. ]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r-- | arch/sh/include/asm/device.h | 9 | ||||
-rw-r--r-- | arch/sh/include/asm/hwblk.h | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h index 783ecdc64e25..b16debfe8c1e 100644 --- a/arch/sh/include/asm/device.h +++ b/arch/sh/include/asm/device.h | |||
@@ -14,6 +14,15 @@ int platform_resource_setup_memory(struct platform_device *pdev, | |||
14 | 14 | ||
15 | void plat_early_device_setup(void); | 15 | void plat_early_device_setup(void); |
16 | 16 | ||
17 | #define PDEV_ARCHDATA_FLAG_INIT 0 | ||
18 | #define PDEV_ARCHDATA_FLAG_IDLE 1 | ||
19 | #define PDEV_ARCHDATA_FLAG_SUSP 2 | ||
20 | |||
17 | struct pdev_archdata { | 21 | struct pdev_archdata { |
18 | int hwblk_id; | 22 | int hwblk_id; |
23 | #ifdef CONFIG_PM_RUNTIME | ||
24 | unsigned long flags; | ||
25 | struct list_head entry; | ||
26 | struct mutex mutex; | ||
27 | #endif | ||
19 | }; | 28 | }; |
diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h index c01d72cb6757..5d3ccae4202b 100644 --- a/arch/sh/include/asm/hwblk.h +++ b/arch/sh/include/asm/hwblk.h | |||
@@ -5,7 +5,9 @@ | |||
5 | #include <asm/io.h> | 5 | #include <asm/io.h> |
6 | 6 | ||
7 | #define HWBLK_CNT_USAGE 0 | 7 | #define HWBLK_CNT_USAGE 0 |
8 | #define HWBLK_CNT_NR 1 | 8 | #define HWBLK_CNT_IDLE 1 |
9 | #define HWBLK_CNT_DEVICES 2 | ||
10 | #define HWBLK_CNT_NR 3 | ||
9 | 11 | ||
10 | #define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */ | 12 | #define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */ |
11 | 13 | ||