diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acpi.h | 30 | ||||
| -rw-r--r-- | include/linux/arch_topology.h | 17 | ||||
| -rw-r--r-- | include/linux/cpufreq.h | 3 | ||||
| -rw-r--r-- | include/linux/devfreq.h | 16 | ||||
| -rw-r--r-- | include/linux/device.h | 15 | ||||
| -rw-r--r-- | include/linux/freezer.h | 2 | ||||
| -rw-r--r-- | include/linux/pci.h | 7 | ||||
| -rw-r--r-- | include/linux/pm.h | 31 | ||||
| -rw-r--r-- | include/linux/pm_domain.h | 20 | ||||
| -rw-r--r-- | include/linux/pm_opp.h | 14 | ||||
| -rw-r--r-- | include/linux/pm_qos.h | 27 |
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) |
| 867 | int acpi_dev_runtime_suspend(struct device *dev); | 867 | int acpi_dev_suspend(struct device *dev, bool wakeup); |
| 868 | int acpi_dev_runtime_resume(struct device *dev); | 868 | int acpi_dev_resume(struct device *dev); |
| 869 | int acpi_subsys_runtime_suspend(struct device *dev); | 869 | int acpi_subsys_runtime_suspend(struct device *dev); |
| 870 | int acpi_subsys_runtime_resume(struct device *dev); | 870 | int acpi_subsys_runtime_resume(struct device *dev); |
| 871 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
| 872 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | 871 | int acpi_dev_pm_attach(struct device *dev, bool power_on); |
| 873 | #else | 872 | #else |
| 874 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } | 873 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } |
| 875 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } | 874 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } |
| 876 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | 875 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } |
| 877 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 876 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
| 878 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
| 879 | { | ||
| 880 | return NULL; | ||
| 881 | } | ||
| 882 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | 877 | static 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) |
| 889 | int acpi_dev_suspend_late(struct device *dev); | 884 | int acpi_dev_suspend_late(struct device *dev); |
| 890 | int acpi_dev_resume_early(struct device *dev); | ||
| 891 | int acpi_subsys_prepare(struct device *dev); | 885 | int acpi_subsys_prepare(struct device *dev); |
| 892 | void acpi_subsys_complete(struct device *dev); | 886 | void acpi_subsys_complete(struct device *dev); |
| 893 | int acpi_subsys_suspend_late(struct device *dev); | 887 | int acpi_subsys_suspend_late(struct device *dev); |
| 888 | int acpi_subsys_suspend_noirq(struct device *dev); | ||
| 889 | int acpi_subsys_resume_noirq(struct device *dev); | ||
| 894 | int acpi_subsys_resume_early(struct device *dev); | 890 | int acpi_subsys_resume_early(struct device *dev); |
| 895 | int acpi_subsys_suspend(struct device *dev); | 891 | int acpi_subsys_suspend(struct device *dev); |
| 896 | int acpi_subsys_freeze(struct device *dev); | 892 | int acpi_subsys_freeze(struct device *dev); |
| 893 | int acpi_subsys_freeze_late(struct device *dev); | ||
| 894 | int acpi_subsys_freeze_noirq(struct device *dev); | ||
| 895 | int acpi_subsys_thaw_noirq(struct device *dev); | ||
| 897 | #else | 896 | #else |
| 898 | static inline int acpi_dev_suspend_late(struct device *dev) { return 0; } | ||
| 899 | static inline int acpi_dev_resume_early(struct device *dev) { return 0; } | 897 | static inline int acpi_dev_resume_early(struct device *dev) { return 0; } |
| 900 | static inline int acpi_subsys_prepare(struct device *dev) { return 0; } | 898 | static inline int acpi_subsys_prepare(struct device *dev) { return 0; } |
| 901 | static inline void acpi_subsys_complete(struct device *dev) {} | 899 | static inline void acpi_subsys_complete(struct device *dev) {} |
| 902 | static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } | 900 | static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } |
| 901 | static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; } | ||
| 902 | static inline int acpi_subsys_resume_noirq(struct device *dev) { return 0; } | ||
| 903 | static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } | 903 | static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } |
| 904 | static inline int acpi_subsys_suspend(struct device *dev) { return 0; } | 904 | static inline int acpi_subsys_suspend(struct device *dev) { return 0; } |
| 905 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } | 905 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } |
| 906 | static inline int acpi_subsys_freeze_late(struct device *dev) { return 0; } | ||
| 907 | static inline int acpi_subsys_freeze_noirq(struct device *dev) { return 0; } | ||
| 908 | static 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 | ||
| 1261 | int lpit_read_residency_count_address(u64 *address); | ||
| 1262 | #else | ||
| 1263 | static 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 | ||
| 10 | void topology_normalize_cpu_scale(void); | 11 | void topology_normalize_cpu_scale(void); |
| 11 | 12 | ||
| 12 | struct device_node; | 13 | struct device_node; |
| 13 | bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); | 14 | bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); |
| 14 | 15 | ||
| 16 | DECLARE_PER_CPU(unsigned long, cpu_scale); | ||
| 17 | |||
| 15 | struct sched_domain; | 18 | struct sched_domain; |
| 16 | unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); | 19 | static inline |
| 20 | unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu) | ||
| 21 | { | ||
| 22 | return per_cpu(cpu_scale, cpu); | ||
| 23 | } | ||
| 17 | 24 | ||
| 18 | void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); | 25 | void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); |
| 19 | 26 | ||
| 27 | DECLARE_PER_CPU(unsigned long, freq_scale); | ||
| 28 | |||
| 29 | static inline | ||
| 30 | unsigned 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 | ||
| 920 | extern unsigned int arch_freq_get_on_cpu(int cpu); | 920 | extern unsigned int arch_freq_get_on_cpu(int cpu); |
| 921 | 921 | ||
| 922 | extern 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 */ |
| 923 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | 926 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; |
| 924 | extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs; | 927 | extern 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 | */ |
| 90 | struct devfreq_dev_profile { | 98 | struct 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; |
