aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h30
-rw-r--r--include/linux/arch_topology.h17
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/devfreq.h16
-rw-r--r--include/linux/device.h15
-rw-r--r--include/linux/freezer.h2
-rw-r--r--include/linux/pci.h7
-rw-r--r--include/linux/pm.h31
-rw-r--r--include/linux/pm_domain.h20
-rw-r--r--include/linux/pm_opp.h14
-rw-r--r--include/linux/pm_qos.h27
11 files changed, 142 insertions, 40 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 502af53ec012..dc1ebfeeb5ec 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -864,21 +864,16 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr,
864#endif 864#endif
865 865
866#if defined(CONFIG_ACPI) && defined(CONFIG_PM) 866#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
867int acpi_dev_runtime_suspend(struct device *dev); 867int acpi_dev_suspend(struct device *dev, bool wakeup);
868int acpi_dev_runtime_resume(struct device *dev); 868int acpi_dev_resume(struct device *dev);
869int acpi_subsys_runtime_suspend(struct device *dev); 869int acpi_subsys_runtime_suspend(struct device *dev);
870int acpi_subsys_runtime_resume(struct device *dev); 870int acpi_subsys_runtime_resume(struct device *dev);
871struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
872int acpi_dev_pm_attach(struct device *dev, bool power_on); 871int acpi_dev_pm_attach(struct device *dev, bool power_on);
873#else 872#else
874static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } 873static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
875static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } 874static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
876static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } 875static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
877static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } 876static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
878static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
879{
880 return NULL;
881}
882static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) 877static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
883{ 878{
884 return -ENODEV; 879 return -ENODEV;
@@ -887,22 +882,30 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
887 882
888#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) 883#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
889int acpi_dev_suspend_late(struct device *dev); 884int acpi_dev_suspend_late(struct device *dev);
890int acpi_dev_resume_early(struct device *dev);
891int acpi_subsys_prepare(struct device *dev); 885int acpi_subsys_prepare(struct device *dev);
892void acpi_subsys_complete(struct device *dev); 886void acpi_subsys_complete(struct device *dev);
893int acpi_subsys_suspend_late(struct device *dev); 887int acpi_subsys_suspend_late(struct device *dev);
888int acpi_subsys_suspend_noirq(struct device *dev);
889int acpi_subsys_resume_noirq(struct device *dev);
894int acpi_subsys_resume_early(struct device *dev); 890int acpi_subsys_resume_early(struct device *dev);
895int acpi_subsys_suspend(struct device *dev); 891int acpi_subsys_suspend(struct device *dev);
896int acpi_subsys_freeze(struct device *dev); 892int acpi_subsys_freeze(struct device *dev);
893int acpi_subsys_freeze_late(struct device *dev);
894int acpi_subsys_freeze_noirq(struct device *dev);
895int acpi_subsys_thaw_noirq(struct device *dev);
897#else 896#else
898static inline int acpi_dev_suspend_late(struct device *dev) { return 0; }
899static inline int acpi_dev_resume_early(struct device *dev) { return 0; } 897static inline int acpi_dev_resume_early(struct device *dev) { return 0; }
900static inline int acpi_subsys_prepare(struct device *dev) { return 0; } 898static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
901static inline void acpi_subsys_complete(struct device *dev) {} 899static inline void acpi_subsys_complete(struct device *dev) {}
902static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } 900static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; }
901static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; }
902static inline int acpi_subsys_resume_noirq(struct device *dev) { return 0; }
903static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } 903static inline int acpi_subsys_resume_early(struct device *dev) { return 0; }
904static inline int acpi_subsys_suspend(struct device *dev) { return 0; } 904static inline int acpi_subsys_suspend(struct device *dev) { return 0; }
905static inline int acpi_subsys_freeze(struct device *dev) { return 0; } 905static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
906static inline int acpi_subsys_freeze_late(struct device *dev) { return 0; }
907static inline int acpi_subsys_freeze_noirq(struct device *dev) { return 0; }
908static inline int acpi_subsys_thaw_noirq(struct device *dev) { return 0; }
906#endif 909#endif
907 910
908#ifdef CONFIG_ACPI 911#ifdef CONFIG_ACPI
@@ -1254,4 +1257,13 @@ int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *res)
1254} 1257}
1255#endif 1258#endif
1256 1259
1260#ifdef CONFIG_ACPI_LPIT
1261int lpit_read_residency_count_address(u64 *address);
1262#else
1263static inline int lpit_read_residency_count_address(u64 *address)
1264{
1265 return -EINVAL;
1266}
1267#endif
1268
1257#endif /*_LINUX_ACPI_H*/ 1269#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
index d4fcb0efb896..304511267c82 100644
--- a/include/linux/arch_topology.h
+++ b/include/linux/arch_topology.h
@@ -6,15 +6,30 @@
6#define _LINUX_ARCH_TOPOLOGY_H_ 6#define _LINUX_ARCH_TOPOLOGY_H_
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/percpu.h>
9 10
10void topology_normalize_cpu_scale(void); 11void topology_normalize_cpu_scale(void);
11 12
12struct device_node; 13struct device_node;
13bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); 14bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);
14 15
16DECLARE_PER_CPU(unsigned long, cpu_scale);
17
15struct sched_domain; 18struct sched_domain;
16unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); 19static inline
20unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu)
21{
22 return per_cpu(cpu_scale, cpu);
23}
17 24
18void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); 25void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity);
19 26
27DECLARE_PER_CPU(unsigned long, freq_scale);
28
29static inline
30unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu)
31{
32 return per_cpu(freq_scale, cpu);
33}
34
20#endif /* _LINUX_ARCH_TOPOLOGY_H_ */ 35#endif /* _LINUX_ARCH_TOPOLOGY_H_ */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 537ff842ff73..28734ee185a7 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -919,6 +919,9 @@ static inline bool policy_has_boost_freq(struct cpufreq_policy *policy)
919 919
920extern unsigned int arch_freq_get_on_cpu(int cpu); 920extern unsigned int arch_freq_get_on_cpu(int cpu);
921 921
922extern void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
923 unsigned long max_freq);
924
922/* the following are really really optional */ 925/* the following are really really optional */
923extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; 926extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
924extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs; 927extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs;
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 597294e0cc40..3aae5b3af87c 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -19,6 +19,13 @@
19 19
20#define DEVFREQ_NAME_LEN 16 20#define DEVFREQ_NAME_LEN 16
21 21
22/* DEVFREQ governor name */
23#define DEVFREQ_GOV_SIMPLE_ONDEMAND "simple_ondemand"
24#define DEVFREQ_GOV_PERFORMANCE "performance"
25#define DEVFREQ_GOV_POWERSAVE "powersave"
26#define DEVFREQ_GOV_USERSPACE "userspace"
27#define DEVFREQ_GOV_PASSIVE "passive"
28
22/* DEVFREQ notifier interface */ 29/* DEVFREQ notifier interface */
23#define DEVFREQ_TRANSITION_NOTIFIER (0) 30#define DEVFREQ_TRANSITION_NOTIFIER (0)
24 31
@@ -84,8 +91,9 @@ struct devfreq_dev_status {
84 * from devfreq_remove_device() call. If the user 91 * from devfreq_remove_device() call. If the user
85 * has registered devfreq->nb at a notifier-head, 92 * has registered devfreq->nb at a notifier-head,
86 * this is the time to unregister it. 93 * this is the time to unregister it.
87 * @freq_table: Optional list of frequencies to support statistics. 94 * @freq_table: Optional list of frequencies to support statistics
88 * @max_state: The size of freq_table. 95 * and freq_table must be generated in ascending order.
96 * @max_state: The size of freq_table.
89 */ 97 */
90struct devfreq_dev_profile { 98struct devfreq_dev_profile {
91 unsigned long initial_freq; 99 unsigned long initial_freq;
@@ -120,6 +128,8 @@ struct devfreq_dev_profile {
120 * touch this. 128 * touch this.
121 * @min_freq: Limit minimum frequency requested by user (0: none) 129 * @min_freq: Limit minimum frequency requested by user (0: none)
122 * @max_freq: Limit maximum frequency requested by user (0: none) 130 * @max_freq: Limit maximum frequency requested by user (0: none)
131 * @scaling_min_freq: Limit minimum frequency requested by OPP interface
132 * @scaling_max_freq: Limit maximum frequency requested by OPP interface
123 * @stop_polling: devfreq polling status of a device. 133 * @stop_polling: devfreq polling status of a device.
124 * @total_trans: Number of devfreq transitions 134 * @total_trans: Number of devfreq transitions
125 * @trans_table: Statistics of devfreq transitions 135 * @trans_table: Statistics of devfreq transitions
@@ -153,6 +163,8 @@ struct devfreq {
153 163
154 unsigned long min_freq; 164 unsigned long min_freq;
155 unsigned long max_freq; 165 unsigned long max_freq;