diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-25 17:43:11 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-25 17:43:11 -0500 |
| commit | 6d10463b2fa1b6b81091661c1917f26436b38c53 (patch) | |
| tree | 1fb5be10a08a3178fb644c9eb5a2a31423985cfa /include/linux | |
| parent | 0015afaa1f818d38ea9f8e81a84a6aeeca5fdaf0 (diff) | |
| parent | a8cf27bee7adc40d91956cf1b9e44d7001f93aba (diff) | |
Merge branch 'pm-domains' into pm-for-linus
* pm-domains:
PM / shmobile: Allow the A4R domain to be turned off at run time
PM / input / touchscreen: Make st1232 use device PM QoS constraints
PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
PM / shmobile: Remove the stay_on flag from SH7372's PM domains
PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
ARM: S3C64XX: Implement basic power domain support
PM / shmobile: Use common always on power domain governor
PM / Domains: Provide an always on power domain governor
PM / Domains: Fix default system suspend/resume operations
PM / Domains: Make it possible to assign names to generic PM domains
PM / Domains: fix compilation failure for CONFIG_PM_GENERIC_DOMAINS unset
PM / Domains: Automatically update overoptimistic latency information
PM / Domains: Add default power off governor function (v4)
PM / Domains: Add device stop governor function (v4)
PM / Domains: Rework system suspend callback routines (v2)
PM / Domains: Introduce "save/restore state" device callbacks
PM / Domains: Make it possible to use per-device domain callbacks
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pm_domain.h | 103 | ||||
| -rw-r--r-- | include/linux/pm_qos.h | 5 | ||||
| -rw-r--r-- | include/linux/sh_intc.h | 1 |
3 files changed, 102 insertions, 7 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 65633e5a2bc0..a03a0ad998b8 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _LINUX_PM_DOMAIN_H | 10 | #define _LINUX_PM_DOMAIN_H |
| 11 | 11 | ||
| 12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
| 13 | #include <linux/err.h> | ||
| 13 | 14 | ||
| 14 | enum gpd_status { | 15 | enum gpd_status { |
| 15 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 16 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
| @@ -21,6 +22,23 @@ enum gpd_status { | |||
| 21 | 22 | ||
| 22 | struct dev_power_governor { | 23 | struct dev_power_governor { |
| 23 | bool (*power_down_ok)(struct dev_pm_domain *domain); | 24 | bool (*power_down_ok)(struct dev_pm_domain *domain); |
| 25 | bool (*stop_ok)(struct device *dev); | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct gpd_dev_ops { | ||
| 29 | int (*start)(struct device *dev); | ||
| 30 | int (*stop)(struct device *dev); | ||
| 31 | int (*save_state)(struct device *dev); | ||
| 32 | int (*restore_state)(struct device *dev); | ||
| 33 | int (*suspend)(struct device *dev); | ||
| 34 | int (*suspend_late)(struct device *dev); | ||
| 35 | int (*resume_early)(struct device *dev); | ||
| 36 | int (*resume)(struct device *dev); | ||
| 37 | int (*freeze)(struct device *dev); | ||
| 38 | int (*freeze_late)(struct device *dev); | ||
| 39 | int (*thaw_early)(struct device *dev); | ||
| 40 | int (*thaw)(struct device *dev); | ||
| 41 | bool (*active_wakeup)(struct device *dev); | ||
| 24 | }; | 42 | }; |
| 25 | 43 | ||
| 26 | struct generic_pm_domain { | 44 | struct generic_pm_domain { |
| @@ -32,6 +50,7 @@ struct generic_pm_domain { | |||
| 32 | struct mutex lock; | 50 | struct mutex lock; |
| 33 | struct dev_power_governor *gov; | 51 | struct dev_power_governor *gov; |
| 34 | struct work_struct power_off_work; | 52 | struct work_struct power_off_work; |
| 53 | char *name; | ||
| 35 | unsigned int in_progress; /* Number of devices being suspended now */ | 54 | unsigned int in_progress; /* Number of devices being suspended now */ |
| 36 | atomic_t sd_count; /* Number of subdomains with power "on" */ | 55 | atomic_t sd_count; /* Number of subdomains with power "on" */ |
| 37 | enum gpd_status status; /* Current state of the domain */ | 56 | enum gpd_status status; /* Current state of the domain */ |
| @@ -44,10 +63,13 @@ struct generic_pm_domain { | |||
| 44 | bool suspend_power_off; /* Power status before system suspend */ | 63 | bool suspend_power_off; /* Power status before system suspend */ |
| 45 | bool dev_irq_safe; /* Device callbacks are IRQ-safe */ | 64 | bool dev_irq_safe; /* Device callbacks are IRQ-safe */ |
| 46 | int (*power_off)(struct generic_pm_domain *domain); | 65 | int (*power_off)(struct generic_pm_domain *domain); |
| 66 | s64 power_off_latency_ns; | ||
| 47 | int (*power_on)(struct generic_pm_domain *domain); | 67 | int (*power_on)(struct generic_pm_domain *domain); |
| 48 | int (*start_device)(struct device *dev); | 68 | s64 power_on_latency_ns; |
| 49 | int (*stop_device)(struct device *dev); | 69 | struct gpd_dev_ops dev_ops; |
| 50 | bool (*active_wakeup)(struct device *dev); | 70 | s64 break_even_ns; /* Power break even for the entire domain. */ |
| 71 | s64 max_off_time_ns; /* Maximum allowed "suspended" time. */ | ||
| 72 | ktime_t power_off_time; | ||
| 51 | }; | 73 | }; |
| 52 | 74 | ||
| 53 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | 75 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) |
| @@ -62,8 +84,18 @@ struct gpd_link { | |||
| 62 | struct list_head slave_node; | 84 | struct list_head slave_node; |
| 63 | }; | 85 | }; |
| 64 | 86 | ||
| 87 | struct gpd_timing_data { | ||
| 88 | s64 stop_latency_ns; | ||
| 89 | s64 start_latency_ns; | ||
| 90 | s64 save_state_latency_ns; | ||
| 91 | s64 restore_state_latency_ns; | ||
| 92 | s64 break_even_ns; | ||
| 93 | }; | ||
| 94 | |||
| 65 | struct generic_pm_domain_data { | 95 | struct generic_pm_domain_data { |
| 66 | struct pm_domain_data base; | 96 | struct pm_domain_data base; |
| 97 | struct gpd_dev_ops ops; | ||
| 98 | struct gpd_timing_data td; | ||
| 67 | bool need_restore; | 99 | bool need_restore; |
| 68 | }; | 100 | }; |
| 69 | 101 | ||
| @@ -73,18 +105,54 @@ static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data * | |||
| 73 | } | 105 | } |
| 74 | 106 | ||
| 75 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 107 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
| 76 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, | 108 | static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) |
| 77 | struct device *dev); | 109 | { |
| 110 | return to_gpd_data(dev->power.subsys_data->domain_data); | ||
| 111 | } | ||
| 112 | |||
| 113 | extern struct dev_power_governor simple_qos_governor; | ||
| 114 | |||
| 115 | extern struct generic_pm_domain *dev_to_genpd(struct device *dev); | ||
| 116 | extern int __pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
| 117 | struct device *dev, | ||
| 118 | struct gpd_timing_data *td); | ||
| 119 | |||
| 120 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
| 121 | struct device *dev) | ||
| 122 | { | ||
| 123 | return __pm_genpd_add_device(genpd, dev, NULL); | ||
| 124 | } | ||
| 125 | |||
| 78 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 126 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
| 79 | struct device *dev); | 127 | struct device *dev); |
| 80 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 128 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
| 81 | struct generic_pm_domain *new_subdomain); | 129 | struct generic_pm_domain *new_subdomain); |
| 82 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 130 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
| 83 | struct generic_pm_domain *target); | 131 | struct generic_pm_domain *target); |
| 132 | extern int pm_genpd_add_callbacks(struct device *dev, | ||
| 133 | struct gpd_dev_ops *ops, | ||
| 134 | struct gpd_timing_data *td); | ||
| 135 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | ||
| 84 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 136 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
| 85 | struct dev_power_governor *gov, bool is_off); | 137 | struct dev_power_governor *gov, bool is_off); |
| 138 | |||
| 86 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 139 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
| 140 | |||
| 141 | extern bool default_stop_ok(struct device *dev); | ||
| 142 | |||
| 143 | extern struct dev_power_governor pm_domain_always_on_gov; | ||
| 87 | #else | 144 | #else |
| 145 | |||
| 146 | static inline struct generic_pm_domain *dev_to_genpd(struct device *dev) | ||
| 147 | { | ||
| 148 | return ERR_PTR(-ENOSYS); | ||
| 149 | } | ||
| 150 | static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
| 151 | struct device *dev, | ||
| 152 | struct gpd_timing_data *td) | ||
| 153 | { | ||
| 154 | return -ENOSYS; | ||
| 155 | } | ||
| 88 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | 156 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, |
| 89 | struct device *dev) | 157 | struct device *dev) |
| 90 | { | 158 | { |
| @@ -105,14 +173,35 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | |||
| 105 | { | 173 | { |
| 106 | return -ENOSYS; | 174 | return -ENOSYS; |
| 107 | } | 175 | } |
| 108 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | 176 | static inline int pm_genpd_add_callbacks(struct device *dev, |
| 109 | struct dev_power_governor *gov, bool is_off) {} | 177 | struct gpd_dev_ops *ops, |
| 178 | struct gpd_timing_data *td) | ||
| 179 | { | ||
| 180 | return -ENOSYS; | ||
| 181 | } | ||
| 182 | static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | ||
| 183 | { | ||
| 184 | return -ENOSYS; | ||
| 185 | } | ||
| 186 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, bool is_off) | ||
| 187 | { | ||
| 188 | } | ||
| 110 | static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) | 189 | static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) |
| 111 | { | 190 | { |
| 112 | return -ENOSYS; | 191 | return -ENOSYS; |
| 113 | } | 192 | } |
| 193 | static inline bool default_stop_ok(struct device *dev) | ||
| 194 | { | ||
| 195 | return false; | ||
| 196 | } | ||
| 197 | #define pm_domain_always_on_gov NULL | ||
| 114 | #endif | 198 | #endif |
| 115 | 199 | ||
| 200 | static inline int pm_genpd_remove_callbacks(struct device *dev) | ||
| 201 | { | ||
| 202 | return __pm_genpd_remove_callbacks(dev, true); | ||
| 203 | } | ||
| 204 | |||
| 116 | #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME | 205 | #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME |
| 117 | extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd); | 206 | extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd); |
| 118 | extern void pm_genpd_poweroff_unused(void); | 207 | extern void pm_genpd_poweroff_unused(void); |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 775a3236343d..e5bbcbaa6f57 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
| @@ -92,6 +92,8 @@ int dev_pm_qos_add_global_notifier(struct notifier_block *notifier); | |||
| 92 | int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier); | 92 | int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier); |
| 93 | void dev_pm_qos_constraints_init(struct device *dev); | 93 | void dev_pm_qos_constraints_init(struct device *dev); |
| 94 | void dev_pm_qos_constraints_destroy(struct device *dev); | 94 | void dev_pm_qos_constraints_destroy(struct device *dev); |
| 95 | int dev_pm_qos_add_ancestor_request(struct device *dev, | ||
| 96 | struct dev_pm_qos_request *req, s32 value); | ||
| 95 | #else | 97 | #else |
| 96 | static inline int pm_qos_update_target(struct pm_qos_constraints *c, | 98 | static inline int pm_qos_update_target(struct pm_qos_constraints *c, |
| 97 | struct plist_node *node, | 99 | struct plist_node *node, |
| @@ -153,6 +155,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev) | |||
| 153 | { | 155 | { |
| 154 | dev->power.power_state = PMSG_INVALID; | 156 | dev->power.power_state = PMSG_INVALID; |
| 155 | } | 157 | } |
| 158 | static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | ||
| 159 | struct dev_pm_qos_request *req, s32 value) | ||
| 160 | { return 0; } | ||
| 156 | #endif | 161 | #endif |
| 157 | 162 | ||
| 158 | #endif | 163 | #endif |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 5812fefbcedf..b160645f5599 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -95,6 +95,7 @@ struct intc_desc { | |||
| 95 | unsigned int num_resources; | 95 | unsigned int num_resources; |
| 96 | intc_enum force_enable; | 96 | intc_enum force_enable; |
| 97 | intc_enum force_disable; | 97 | intc_enum force_disable; |
| 98 | bool skip_syscore_suspend; | ||
| 98 | struct intc_hw_desc hw; | 99 | struct intc_hw_desc hw; |
| 99 | }; | 100 | }; |
| 100 | 101 | ||
