diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/acpi/cppc_acpi.h | 1 | ||||
| -rw-r--r-- | include/linux/cpufreq.h | 48 | ||||
| -rw-r--r-- | include/linux/cpuidle.h | 8 | ||||
| -rw-r--r-- | include/linux/device.h | 10 | ||||
| -rw-r--r-- | include/linux/platform_data/davinci-cpufreq.h | 19 | ||||
| -rw-r--r-- | include/linux/pm.h | 7 | ||||
| -rw-r--r-- | include/linux/pm_domain.h | 8 | ||||
| -rw-r--r-- | include/linux/pm_opp.h | 6 | ||||
| -rw-r--r-- | include/linux/pm_runtime.h | 2 |
9 files changed, 75 insertions, 34 deletions
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 4f34734e7f36..ba6fd7202775 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h | |||
| @@ -137,6 +137,7 @@ struct cppc_cpudata { | |||
| 137 | cpumask_var_t shared_cpu_map; | 137 | cpumask_var_t shared_cpu_map; |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); | ||
| 140 | extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); | 141 | extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); |
| 141 | extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); | 142 | extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); |
| 142 | extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); | 143 | extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c86d6d8bdfed..b160e98076e3 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -151,6 +151,9 @@ struct cpufreq_policy { | |||
| 151 | 151 | ||
| 152 | /* For cpufreq driver's internal use */ | 152 | /* For cpufreq driver's internal use */ |
| 153 | void *driver_data; | 153 | void *driver_data; |
| 154 | |||
| 155 | /* Pointer to the cooling device if used for thermal mitigation */ | ||
| 156 | struct thermal_cooling_device *cdev; | ||
| 154 | }; | 157 | }; |
| 155 | 158 | ||
| 156 | /* Only for ACPI */ | 159 | /* Only for ACPI */ |
| @@ -254,20 +257,12 @@ __ATTR(_name, 0644, show_##_name, store_##_name) | |||
| 254 | static struct freq_attr _name = \ | 257 | static struct freq_attr _name = \ |
| 255 | __ATTR(_name, 0200, NULL, store_##_name) | 258 | __ATTR(_name, 0200, NULL, store_##_name) |
| 256 | 259 | ||
| 257 | struct global_attr { | ||
| 258 | struct attribute attr; | ||
| 259 | ssize_t (*show)(struct kobject *kobj, | ||
| 260 | struct attribute *attr, char *buf); | ||
| 261 | ssize_t (*store)(struct kobject *a, struct attribute *b, | ||
| 262 | const char *c, size_t count); | ||
| 263 | }; | ||
| 264 | |||
| 265 | #define define_one_global_ro(_name) \ | 260 | #define define_one_global_ro(_name) \ |
| 266 | static struct global_attr _name = \ | 261 | static struct kobj_attribute _name = \ |
| 267 | __ATTR(_name, 0444, show_##_name, NULL) | 262 | __ATTR(_name, 0444, show_##_name, NULL) |
| 268 | 263 | ||
| 269 | #define define_one_global_rw(_name) \ | 264 | #define define_one_global_rw(_name) \ |
| 270 | static struct global_attr _name = \ | 265 | static struct kobj_attribute _name = \ |
| 271 | __ATTR(_name, 0644, show_##_name, store_##_name) | 266 | __ATTR(_name, 0644, show_##_name, store_##_name) |
| 272 | 267 | ||
| 273 | 268 | ||
| @@ -330,6 +325,8 @@ struct cpufreq_driver { | |||
| 330 | /* optional */ | 325 | /* optional */ |
| 331 | int (*bios_limit)(int cpu, unsigned int *limit); | 326 | int (*bios_limit)(int cpu, unsigned int *limit); |
| 332 | 327 | ||
| 328 | int (*online)(struct cpufreq_policy *policy); | ||
| 329 | int (*offline)(struct cpufreq_policy *policy); | ||
| 333 | int (*exit)(struct cpufreq_policy *policy); | 330 | int (*exit)(struct cpufreq_policy *policy); |
| 334 | void (*stop_cpu)(struct cpufreq_policy *policy); | 331 | void (*stop_cpu)(struct cpufreq_policy *policy); |
| 335 | int (*suspend)(struct cpufreq_policy *policy); | 332 | int (*suspend)(struct cpufreq_policy *policy); |
| @@ -346,14 +343,15 @@ struct cpufreq_driver { | |||
| 346 | }; | 343 | }; |
| 347 | 344 | ||
| 348 | /* flags */ | 345 | /* flags */ |
| 349 | #define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if | 346 | |
| 350 | all ->init() calls failed */ | 347 | /* driver isn't removed even if all ->init() calls failed */ |
| 351 | #define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other | 348 | #define CPUFREQ_STICKY BIT(0) |
| 352 | kernel "constants" aren't | 349 | |
| 353 | affected by frequency | 350 | /* loops_per_jiffy or other kernel "constants" aren't affected by frequency transitions */ |
| 354 | transitions */ | 351 | #define CPUFREQ_CONST_LOOPS BIT(1) |
| 355 | #define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume | 352 | |
| 356 | speed mismatches */ | 353 | /* don't warn on suspend/resume speed mismatches */ |
| 354 | #define CPUFREQ_PM_NO_WARN BIT(2) | ||
| 357 | 355 | ||
| 358 | /* | 356 | /* |
| 359 | * This should be set by platforms having multiple clock-domains, i.e. | 357 | * This should be set by platforms having multiple clock-domains, i.e. |
| @@ -361,14 +359,14 @@ struct cpufreq_driver { | |||
| 361 | * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same | 359 | * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same |
| 362 | * governor with different tunables for different clusters. | 360 | * governor with different tunables for different clusters. |
| 363 | */ | 361 | */ |
| 364 | #define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) | 362 | #define CPUFREQ_HAVE_GOVERNOR_PER_POLICY BIT(3) |
| 365 | 363 | ||
| 366 | /* | 364 | /* |
| 367 | * Driver will do POSTCHANGE notifications from outside of their ->target() | 365 | * Driver will do POSTCHANGE notifications from outside of their ->target() |
| 368 | * routine and so must set cpufreq_driver->flags with this flag, so that core | 366 | * routine and so must set cpufreq_driver->flags with this flag, so that core |
| 369 | * can handle them specially. | 367 | * can handle them specially. |
| 370 | */ | 368 | */ |
| 371 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) | 369 | #define CPUFREQ_ASYNC_NOTIFICATION BIT(4) |
| 372 | 370 | ||
| 373 | /* | 371 | /* |
| 374 | * Set by drivers which want cpufreq core to check if CPU is running at a | 372 | * Set by drivers which want cpufreq core to check if CPU is running at a |
| @@ -377,13 +375,19 @@ struct cpufreq_driver { | |||
| 377 | * from the table. And if that fails, we will stop further boot process by | 375 | * from the table. And if that fails, we will stop further boot process by |
| 378 | * issuing a BUG_ON(). | 376 | * issuing a BUG_ON(). |
| 379 | */ | 377 | */ |
| 380 | #define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5) | 378 | #define CPUFREQ_NEED_INITIAL_FREQ_CHECK BIT(5) |
| 381 | 379 | ||
| 382 | /* | 380 | /* |
| 383 | * Set by drivers to disallow use of governors with "dynamic_switching" flag | 381 | * Set by drivers to disallow use of governors with "dynamic_switching" flag |
| 384 | * set. | 382 | * set. |
| 385 | */ | 383 | */ |
| 386 | #define CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING (1 << 6) | 384 | #define CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING BIT(6) |
| 385 | |||
| 386 | /* | ||
| 387 | * Set by drivers that want the core to automatically register the cpufreq | ||
| 388 | * driver as a thermal cooling device. | ||
| 389 | */ | ||
| 390 | #define CPUFREQ_IS_COOLING_DEV BIT(7) | ||
| 387 | 391 | ||
| 388 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 392 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
| 389 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 393 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 4dff74f48d4b..3b39472324a3 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -69,11 +69,9 @@ struct cpuidle_state { | |||
| 69 | 69 | ||
| 70 | /* Idle State Flags */ | 70 | /* Idle State Flags */ |
| 71 | #define CPUIDLE_FLAG_NONE (0x00) | 71 | #define CPUIDLE_FLAG_NONE (0x00) |
| 72 | #define CPUIDLE_FLAG_POLLING (0x01) /* polling state */ | 72 | #define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */ |
| 73 | #define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */ | 73 | #define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */ |
| 74 | #define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */ | 74 | #define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */ |
| 75 | |||
| 76 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | ||
| 77 | 75 | ||
| 78 | struct cpuidle_device_kobj; | 76 | struct cpuidle_device_kobj; |
| 79 | struct cpuidle_state_kobj; | 77 | struct cpuidle_state_kobj; |
diff --git a/include/linux/device.h b/include/linux/device.h index 4d2f13e8c540..d88d2362e8c3 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -1165,6 +1165,16 @@ static inline bool device_async_suspend_enabled(struct device *dev) | |||
| 1165 | return !!dev->power.async_suspend; | 1165 | return !!dev->power.async_suspend; |
| 1166 | } | 1166 | } |
| 1167 | 1167 | ||
| 1168 | static inline bool device_pm_not_required(struct device *dev) | ||
| 1169 | { | ||
| 1170 | return dev->power.no_pm; | ||
| 1171 | } | ||
| 1172 | |||
| 1173 | static inline void device_set_pm_not_required(struct device *dev) | ||
| 1174 | { | ||
| 1175 | dev->power.no_pm = true; | ||
| 1176 | } | ||
| 1177 | |||
| 1168 | static inline void dev_pm_syscore_device(struct device *dev, bool val) | 1178 | static inline void dev_pm_syscore_device(struct device *dev, bool val) |
| 1169 | { | 1179 | { |
| 1170 | #ifdef CONFIG_PM_SLEEP | 1180 | #ifdef CONFIG_PM_SLEEP |
diff --git a/include/linux/platform_data/davinci-cpufreq.h b/include/linux/platform_data/davinci-cpufreq.h new file mode 100644 index 000000000000..3fbf9f2793b5 --- /dev/null +++ b/include/linux/platform_data/davinci-cpufreq.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | /* | ||
| 3 | * TI DaVinci CPUFreq platform support. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2009 Texas Instruments, Inc. http://www.ti.com/ | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _MACH_DAVINCI_CPUFREQ_H | ||
| 9 | #define _MACH_DAVINCI_CPUFREQ_H | ||
| 10 | |||
| 11 | #include <linux/cpufreq.h> | ||
| 12 | |||
| 13 | struct davinci_cpufreq_config { | ||
| 14 | struct cpufreq_frequency_table *freq_table; | ||
| 15 | int (*set_voltage)(unsigned int index); | ||
| 16 | int (*init)(void); | ||
| 17 | }; | ||
| 18 | |||
| 19 | #endif /* _MACH_DAVINCI_CPUFREQ_H */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 0bd9de116826..06f7ed893928 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -592,6 +592,7 @@ struct dev_pm_info { | |||
| 592 | bool is_suspended:1; /* Ditto */ | 592 | bool is_suspended:1; /* Ditto */ |
| 593 | bool is_noirq_suspended:1; | 593 | bool is_noirq_suspended:1; |
| 594 | bool is_late_suspended:1; | 594 | bool is_late_suspended:1; |
| 595 | bool no_pm:1; | ||
| 595 | bool early_init:1; /* Owned by the PM core */ | 596 | bool early_init:1; /* Owned by the PM core */ |
| 596 | bool direct_complete:1; /* Owned by the PM core */ | 597 | bool direct_complete:1; /* Owned by the PM core */ |
| 597 | u32 driver_flags; | 598 | u32 driver_flags; |
| @@ -633,9 +634,9 @@ struct dev_pm_info { | |||
| 633 | int runtime_error; | 634 | int runtime_error; |
| 634 | int autosuspend_delay; | 635 | int autosuspend_delay; |
| 635 | u64 last_busy; | 636 | u64 last_busy; |
| 636 | unsigned long active_jiffies; | 637 | u64 active_time; |
| 637 | unsigned long suspended_jiffies; | 638 | u64 suspended_time; |
| 638 | unsigned long accounting_timestamp; | 639 | u64 accounting_timestamp; |
| 639 | #endif | 640 | #endif |
| 640 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ | 641 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
| 641 | void (*set_latency_tolerance)(struct device *, s32); | 642 | void (*set_latency_tolerance)(struct device *, s32); |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index dd364abb649a..1ed5874bcee0 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev); | |||
| 271 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, | 271 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, |
| 272 | unsigned int index); | 272 | unsigned int index); |
| 273 | struct device *genpd_dev_pm_attach_by_name(struct device *dev, | 273 | struct device *genpd_dev_pm_attach_by_name(struct device *dev, |
| 274 | char *name); | 274 | const char *name); |
| 275 | #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ | 275 | #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ |
| 276 | static inline int of_genpd_add_provider_simple(struct device_node *np, | 276 | static inline int of_genpd_add_provider_simple(struct device_node *np, |
| 277 | struct generic_pm_domain *genpd) | 277 | struct generic_pm_domain *genpd) |
| @@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev, | |||
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev, | 326 | static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev, |
| 327 | char *name) | 327 | const char *name) |
| 328 | { | 328 | { |
| 329 | return NULL; | 329 | return NULL; |
| 330 | } | 330 | } |
| @@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on); | |||
| 341 | struct device *dev_pm_domain_attach_by_id(struct device *dev, | 341 | struct device *dev_pm_domain_attach_by_id(struct device *dev, |
| 342 | unsigned int index); | 342 | unsigned int index); |
| 343 | struct device *dev_pm_domain_attach_by_name(struct device *dev, | 343 | struct device *dev_pm_domain_attach_by_name(struct device *dev, |
| 344 | char *name); | 344 | const char *name); |
| 345 | void dev_pm_domain_detach(struct device *dev, bool power_off); | 345 | void dev_pm_domain_detach(struct device *dev, bool power_off); |
| 346 | void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); | 346 | void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); |
| 347 | #else | 347 | #else |
| @@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev, | |||
| 355 | return NULL; | 355 | return NULL; |
| 356 | } | 356 | } |
| 357 | static inline struct device *dev_pm_domain_attach_by_name(struct device *dev, | 357 | static inline struct device *dev_pm_domain_attach_by_name(struct device *dev, |
| 358 | char *name) | 358 | const char *name) |
| 359 | { | 359 | { |
| 360 | return NULL; | 360 | return NULL; |
| 361 | } | 361 | } |
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 900359342965..24c757a32a7b 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h | |||
| @@ -334,6 +334,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpuma | |||
| 334 | struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); | 334 | struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); |
| 335 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); | 335 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); |
| 336 | int of_get_required_opp_performance_state(struct device_node *np, int index); | 336 | int of_get_required_opp_performance_state(struct device_node *np, int index); |
| 337 | void dev_pm_opp_of_register_em(struct cpumask *cpus); | ||
| 337 | #else | 338 | #else |
| 338 | static inline int dev_pm_opp_of_add_table(struct device *dev) | 339 | static inline int dev_pm_opp_of_add_table(struct device *dev) |
| 339 | { | 340 | { |
| @@ -372,6 +373,11 @@ static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) | |||
| 372 | { | 373 | { |
| 373 | return NULL; | 374 | return NULL; |
| 374 | } | 375 | } |
| 376 | |||
| 377 | static inline void dev_pm_opp_of_register_em(struct cpumask *cpus) | ||
| 378 | { | ||
| 379 | } | ||
| 380 | |||
| 375 | static inline int of_get_required_opp_performance_state(struct device_node *np, int index) | 381 | static inline int of_get_required_opp_performance_state(struct device_node *np, int index) |
| 376 | { | 382 | { |
| 377 | return -ENOTSUPP; | 383 | return -ENOTSUPP; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index fed5be706bc9..9dc6eebf62d2 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -113,6 +113,8 @@ static inline bool pm_runtime_is_irq_safe(struct device *dev) | |||
| 113 | return dev->power.irq_safe; | 113 | return dev->power.irq_safe; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | extern u64 pm_runtime_suspended_time(struct device *dev); | ||
| 117 | |||
| 116 | #else /* !CONFIG_PM */ | 118 | #else /* !CONFIG_PM */ |
| 117 | 119 | ||
| 118 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | 120 | static inline bool queue_pm_work(struct work_struct *work) { return false; } |
