Commit 2dc200fe authored by Dave Jones's avatar Dave Jones

[CPUFREQ] cpufreq stat output in sysfs

From:  "Zou, Nanhai" <nanhai.zou@intel.com>

Export cpufreq transition information for drivers using the freq-table helpers
via sysfs.

Two minor updates from Dominik Brodowski:
s/translation/transition
Kconfig re-ordering
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 53d36e36
...@@ -27,6 +27,22 @@ config CPU_FREQ_DEBUG ...@@ -27,6 +27,22 @@ config CPU_FREQ_DEBUG
2 to activate CPUfreq drivers debugging, and 2 to activate CPUfreq drivers debugging, and
4 to activate CPUfreq governor debugging 4 to activate CPUfreq governor debugging
config CPU_FREQ_STAT
tristate "CPU frequency translation statistics"
depends on CPU_FREQ && CPU_FREQ_TABLE
default y
help
This driver exports CPU frequency statistics information through sysfs
file system
config CPU_FREQ_STAT_DETAILS
bool "CPU frequency translation statistics details"
depends on CPU_FREQ && CPU_FREQ_STAT
default n
help
This will show detail CPU frequency translation table in sysfs file
system
config CPU_FREQ_PROC_INTF config CPU_FREQ_PROC_INTF
tristate "/proc/cpufreq interface (deprecated)" tristate "/proc/cpufreq interface (deprecated)"
depends on CPU_FREQ && PROC_FS depends on CPU_FREQ && PROC_FS
......
# CPUfreq core # CPUfreq core
obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o
# CPUfreq stats
obj-$(CONFIG_CPU_FREQ_STAT) += cpufreq_stats.o
# CPUfreq governors # CPUfreq governors
obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o
......
...@@ -63,7 +63,7 @@ static DECLARE_RWSEM (cpufreq_notifier_rwsem); ...@@ -63,7 +63,7 @@ static DECLARE_RWSEM (cpufreq_notifier_rwsem);
static LIST_HEAD(cpufreq_governor_list); static LIST_HEAD(cpufreq_governor_list);
static DECLARE_MUTEX (cpufreq_governor_sem); static DECLARE_MUTEX (cpufreq_governor_sem);
static struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu) struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu)
{ {
struct cpufreq_policy *data; struct cpufreq_policy *data;
unsigned long flags; unsigned long flags;
...@@ -102,12 +102,14 @@ static struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu) ...@@ -102,12 +102,14 @@ static struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu)
err_out: err_out:
return NULL; return NULL;
} }
EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
static void cpufreq_cpu_put(struct cpufreq_policy *data) void cpufreq_cpu_put(struct cpufreq_policy *data)
{ {
kobject_put(&data->kobj); kobject_put(&data->kobj);
module_put(cpufreq_driver->owner); module_put(cpufreq_driver->owner);
} }
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
/********************************************************************* /*********************************************************************
......
...@@ -214,6 +214,11 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu) ...@@ -214,6 +214,11 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu)
} }
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu)
{
return show_table[cpu];
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>"); MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>");
MODULE_DESCRIPTION ("CPUfreq frequency table helpers"); MODULE_DESCRIPTION ("CPUfreq frequency table helpers");
......
...@@ -351,6 +351,11 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, ...@@ -351,6 +351,11 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
unsigned int relation, unsigned int relation,
unsigned int *index); unsigned int *index);
/* the following 3 funtions are for cpufreq core use only */
struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
void cpufreq_cpu_put (struct cpufreq_policy *data);
/* the following are really really optional */ /* the following are really really optional */
extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment