mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 19:53:59 +08:00
6a93dde1e8
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>
29 lines
604 B
C
29 lines
604 B
C
/*
|
|
* Arch specific extensions to struct device
|
|
*
|
|
* This file is released under the GPLv2
|
|
*/
|
|
|
|
struct dev_archdata {
|
|
};
|
|
|
|
struct platform_device;
|
|
/* allocate contiguous memory chunk and fill in struct resource */
|
|
int platform_resource_setup_memory(struct platform_device *pdev,
|
|
char *name, unsigned long memsize);
|
|
|
|
void plat_early_device_setup(void);
|
|
|
|
#define PDEV_ARCHDATA_FLAG_INIT 0
|
|
#define PDEV_ARCHDATA_FLAG_IDLE 1
|
|
#define PDEV_ARCHDATA_FLAG_SUSP 2
|
|
|
|
struct pdev_archdata {
|
|
int hwblk_id;
|
|
#ifdef CONFIG_PM_RUNTIME
|
|
unsigned long flags;
|
|
struct list_head entry;
|
|
struct mutex mutex;
|
|
#endif
|
|
};
|