aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-19 20:41:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-19 20:41:31 -0700
commit009884f384dcc71909f2b861c317da7242979f31 (patch)
tree72b79236ccc5162c48ac5f9678a20f30caa47133 /include/linux
parentMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux (diff)
parentMerge branch 'acpi-bus' (diff)
downloadlinux-dev-009884f384dcc71909f2b861c317da7242979f31.tar.xz
linux-dev-009884f384dcc71909f2b861c317da7242979f31.zip
Merge tag 'pm+acpi-4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI updates from Rafael Wysocki: "Included are: a somewhat late devfreq update which however is mostly fixes and cleanups with one new thing only (the PPMUv2 support on Exynos5433), an ACPI cpufreq driver fixup and two ACPI core cleanups related to preprocessor directives. Specifics: - Fix a memory allocation size in the devfreq core (Xiaolong Ye). - Fix a mistake in the exynos-ppmu DT binding (Javier Martinez Canillas). - Add support for PPMUv2 ((Platform Performance Monitoring Unit version 2.0) on the Exynos5433 SoCs (Chanwoo Choi). - Fix a type casting bug in the Exynos PPMU code (MyungJoo Ham). - Assorted devfreq code cleanups and optimizations (Javi Merino, MyungJoo Ham, Viresh Kumar). - Fix up the ACPI cpufreq driver to use a more lightweight way to get to its private data in the ->get() callback (Rafael J Wysocki). - Fix a CONFIG_ prefix bug in one of the ACPI drivers and make the ACPI subsystem use IS_ENABLED() instead of #ifdefs in function bodies (Sudeep Holla)" * tag 'pm+acpi-4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: acpi-cpufreq: Use cpufreq_cpu_get_raw() in ->get() ACPI: Eliminate CONFIG_.*{, _MODULE} #ifdef in favor of IS_ENABLED() ACPI: int340x_thermal: add missing CONFIG_ prefix PM / devfreq: Fix incorrect type issue. PM / devfreq: tegra: Update governor to use devfreq_update_stats() PM / devfreq: comments for get_dev_status usage updated PM / devfreq: drop comment about thermal setting max_freq PM / devfreq: cache the last call to get_dev_status() PM / devfreq: Drop unlikely before IS_ERR(_OR_NULL) PM / devfreq: exynos-ppmu: bit-wise operation bugfix. PM / devfreq: exynos-ppmu: Update documentation to support PPMUv2 PM / devfreq: exynos-ppmu: Add the support of PPMUv2 for Exynos5433 PM / devfreq: event: Remove incorrect property in exynos-ppmu DT binding
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/devfreq.h24
2 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 430efcbea48e..dca22de98d94 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -127,9 +127,14 @@ struct cpufreq_policy {
#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
#ifdef CONFIG_CPU_FREQ
+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);
struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
void cpufreq_cpu_put(struct cpufreq_policy *policy);
#else
+static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
+{
+ return NULL;
+}
static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
{
return NULL;
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index ce447f0f1bad..68030e22af35 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -65,7 +65,10 @@ struct devfreq_dev_status {
* The "flags" parameter's possible values are
* explained above with "DEVFREQ_FLAG_*" macros.
* @get_dev_status: The device should provide the current performance
- * status to devfreq, which is used by governors.
+ * status to devfreq. Governors are recommended not to
+ * use this directly. Instead, governors are recommended
+ * to use devfreq_update_stats() along with
+ * devfreq.last_status.
* @get_cur_freq: The device should provide the current frequency
* at which it is operating.
* @exit: An optional callback that is called when devfreq
@@ -161,6 +164,7 @@ struct devfreq {
struct delayed_work work;
unsigned long previous_freq;
+ struct devfreq_dev_status last_status;
void *data; /* private data for governors */
@@ -204,6 +208,19 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev,
extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
struct devfreq *devfreq);
+/**
+ * devfreq_update_stats() - update the last_status pointer in struct devfreq
+ * @df: the devfreq instance whose status needs updating
+ *
+ * Governors are recommended to use this function along with last_status,
+ * which allows other entities to reuse the last_status without affecting
+ * the values fetched later by governors.
+ */
+static inline int devfreq_update_stats(struct devfreq *df)
+{
+ return df->profile->get_dev_status(df->dev.parent, &df->last_status);
+}
+
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
/**
* struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
@@ -289,6 +306,11 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,
struct devfreq *devfreq)
{
}
+
+static inline int devfreq_update_stats(struct devfreq *df)
+{
+ return -EINVAL;
+}
#endif /* CONFIG_PM_DEVFREQ */
#endif /* __LINUX_DEVFREQ_H__ */