* pm-cpufreq: (48 commits) cpufreq: kryo: Release OPP tables on module removal cpufreq: ap806: add missing of_node_put after of_device_is_available cpufreq: acpi-cpufreq: Report if CPU doesn't support boost technologies cpufreq: Pass updated policy to driver ->setpolicy() callback cpufreq: Fix two debug messages in cpufreq_set_policy() cpufreq: Reorder and simplify cpufreq_update_policy() cpufreq: Add kerneldoc comments for two core functions cpufreq: intel_pstate: Rework iowait boosting to be less aggressive cpufreq: intel_pstate: Eliminate intel_pstate_get_base_pstate() cpufreq: intel_pstate: Avoid redundant initialization of local vars cpufreq / cppc: Work around for Hisilicon CPPC cpufreq ACPI / CPPC: Add a helper to get desired performance cpufreq: davinci: move configuration to include/linux/platform_data cpufreq: speedstep: convert BUG() to BUG_ON() cpufreq: powernv: fix missing check of return value in init_powernv_pstates() cpufreq: longhaul: remove unneeded semicolon cpufreq: pcc-cpufreq: remove unneeded semicolon cpufreq: Replace double NOT (!!) with single NOT (!) cpufreq: intel_pstate: Add reasons for failure and debug messages cpufreq: dt: Implement online/offline() callbacks ...
Showing the changes to include/linux (3 of 36 files). Show all
Unified · Split
| @@ -151,6 +151,9 @@ struct cpufreq_policy { · 150 unmodified lines | ||
| 151 | 151 | |
| 152 | 152 | /* For cpufreq driver's internal use */ |
| 153 | 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 | 159 | /* Only for ACPI */ |
| @@ -254,20 +257,12 @@ __ATTR(_name, 0644, show_##_name, store_##_name) · 97 unmodified lines | ||
| 254 | 257 | static struct freq_attr _name = \ |
| 255 | 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 | 260 | #define define_one_global_ro(_name) \ |
| 266 | −static struct global_attr _name = \ | |
| 261 | +static struct kobj_attribute _name = \ | |
| 267 | 262 | __ATTR(_name, 0444, show_##_name, NULL) |
| 268 | 263 | |
| 269 | 264 | #define define_one_global_rw(_name) \ |
| 270 | −static struct global_attr _name = \ | |
| 265 | +static struct kobj_attribute _name = \ | |
| 271 | 266 | __ATTR(_name, 0644, show_##_name, store_##_name) |
| 272 | 267 | |
| 273 | 268 | |
| @@ -330,6 +325,8 @@ struct cpufreq_driver { · 56 unmodified lines | ||
| 330 | 325 | /* optional */ |
| 331 | 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 | 330 | int (*exit)(struct cpufreq_policy *policy); |
| 334 | 331 | void (*stop_cpu)(struct cpufreq_policy *policy); |
| 335 | 332 | int (*suspend)(struct cpufreq_policy *policy); |
| @@ -346,14 +343,15 @@ struct cpufreq_driver { · 10 unmodified lines | ||
| 346 | 343 | }; |
| 347 | 344 | |
| 348 | 345 | /* flags */ |
| 349 | −#define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if | |
| 350 | − all ->init() calls failed */ | |
| 351 | −#define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other | |
| 352 | − kernel "constants" aren't | |
| 353 | − affected by frequency | |
| 354 | − transitions */ | |
| 355 | −#define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume | |
| 356 | − speed mismatches */ | |
| 346 | + | |
| 347 | +/* driver isn't removed even if all ->init() calls failed */ | |
| 348 | +#define CPUFREQ_STICKY BIT(0) | |
| 349 | + | |
| 350 | +/* loops_per_jiffy or other kernel "constants" aren't affected by frequency transitions */ | |
| 351 | +#define CPUFREQ_CONST_LOOPS BIT(1) | |
| 352 | + | |
| 353 | +/* don't warn on suspend/resume speed mismatches */ | |
| 354 | +#define CPUFREQ_PM_NO_WARN BIT(2) | |
| 357 | 355 | |
| 358 | 356 | /* |
| 359 | 357 | * This should be set by platforms having multiple clock-domains, i.e. |
| @@ -361,14 +359,14 @@ struct cpufreq_driver { · 1 unmodified line | ||
| 361 | 359 | * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same |
| 362 | 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 | 365 | * Driver will do POSTCHANGE notifications from outside of their ->target() |
| 368 | 366 | * routine and so must set cpufreq_driver->flags with this flag, so that core |
| 369 | 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 | 372 | * Set by drivers which want cpufreq core to check if CPU is running at a |
| @@ -377,13 +375,19 @@ struct cpufreq_driver { · 2 unmodified lines | ||
| 377 | 375 | * from the table. And if that fails, we will stop further boot process by |
| 378 | 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 | 381 | * Set by drivers to disallow use of governors with "dynamic_switching" flag |
| 384 | 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 | 392 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
| 389 | 393 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
| @@ -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 */ | |
| @@ -327,6 +327,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpuma · 326 unmodified lines | ||
| 327 | 327 | struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); |
| 328 | 328 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); |
| 329 | 329 | int of_get_required_opp_performance_state(struct device_node *np, int index); |
| 330 | +void dev_pm_opp_of_register_em(struct cpumask *cpus); | |
| 330 | 331 | #else |
| 331 | 332 | static inline int dev_pm_opp_of_add_table(struct device *dev) |
| 332 | 333 | { |
| @@ -365,6 +366,11 @@ static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) · 32 unmodified lines | ||
| 365 | 366 | { |
| 366 | 367 | return NULL; |
| 367 | 368 | } |
| 369 | + | |
| 370 | +static inline void dev_pm_opp_of_register_em(struct cpumask *cpus) | |
| 371 | +{ | |
| 372 | +} | |
| 373 | + | |
| 368 | 374 | static inline int of_get_required_opp_performance_state(struct device_node *np, int index) |
| 369 | 375 | { |
| 370 | 376 | return -ENOTSUPP; |