aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-07 17:13:36 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-07 17:13:36 -0500
commitbf58cdffac931ff387c657395742a737837b93ca (patch)
tree8e5a16a2ece40502f700212220c23c866470d2ff
parent6b728f1a906976ec658827adc9c2d27608aa8517 (diff)
parent6dcdd8e3cadd8dfcfe63d231631d70e2670970f9 (diff)
Merge branch 'pm-devfreq'
* pm-devfreq: (23 commits) PM / devfreq: remove compiler error with module governors (2) PM / devfreq: Fix return value in devfreq_remove_governor() PM / devfreq: Fix incorrect argument in error message PM / devfreq: missing rcu_read_lock() added for find_device_opp() PM / devfreq: remove compiler error when a governor is module PM / devfreq: exynos4_bus.c: Fixed an alignment of the func call args. PM / devfreq: Add sysfs node to expose available governors PM / devfreq: allow sysfs governor node to switch governor PM / devfreq: governors: add GPL module license and allow module build PM / devfreq: map devfreq drivers to governor using name PM / devfreq: register governors with devfreq framework PM / devfreq: provide hooks for governors to be registered PM / devfreq: export update_devfreq PM / devfreq: Add sysfs node for representing frequency transition information. PM / devfreq: Add sysfs node to expose available frequencies PM / devfreq: documentation cleanups for devfreq header PM / devfreq: Use devm_* functions in exynos4_bus.c PM / devfreq: make devfreq_class static PM / devfreq: fix sscanf handling for writable sysfs entries PM / devfreq: kernel-doc typo corrections ...
-rw-r--r--Documentation/ABI/testing/sysfs-class-devfreq44
-rw-r--r--drivers/devfreq/Kconfig8
-rw-r--r--drivers/devfreq/devfreq.c917
-rw-r--r--drivers/devfreq/exynos4_bus.c45
-rw-r--r--drivers/devfreq/governor.h17
-rw-r--r--drivers/devfreq/governor_performance.c38
-rw-r--r--drivers/devfreq/governor_powersave.c38
-rw-r--r--drivers/devfreq/governor_simpleondemand.c55
-rw-r--r--drivers/devfreq/governor_userspace.c45
-rw-r--r--include/linux/devfreq.h136
10 files changed, 942 insertions, 401 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq
index 23d78b5aab11..0ba6ea2f89d9 100644
--- a/Documentation/ABI/testing/sysfs-class-devfreq
+++ b/Documentation/ABI/testing/sysfs-class-devfreq
@@ -11,7 +11,7 @@ What: /sys/class/devfreq/.../governor
11Date: September 2011 11Date: September 2011
12Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 12Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
13Description: 13Description:
14 The /sys/class/devfreq/.../governor shows the name of the 14 The /sys/class/devfreq/.../governor show or set the name of the
15 governor used by the corresponding devfreq object. 15 governor used by the corresponding devfreq object.
16 16
17What: /sys/class/devfreq/.../cur_freq 17What: /sys/class/devfreq/.../cur_freq
@@ -19,15 +19,16 @@ Date: September 2011
19Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 19Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
20Description: 20Description:
21 The /sys/class/devfreq/.../cur_freq shows the current 21 The /sys/class/devfreq/.../cur_freq shows the current
22 frequency of the corresponding devfreq object. 22 frequency of the corresponding devfreq object. Same as
23 target_freq when get_cur_freq() is not implemented by
24 devfreq driver.
23 25
24What: /sys/class/devfreq/.../central_polling 26What: /sys/class/devfreq/.../target_freq
25Date: September 2011 27Date: September 2012
26Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 28Contact: Rajagopal Venkat <rajagopal.venkat@linaro.org>
27Description: 29Description:
28 The /sys/class/devfreq/.../central_polling shows whether 30 The /sys/class/devfreq/.../target_freq shows the next governor
29 the devfreq ojbect is using devfreq-provided central 31 predicted target frequency of the corresponding devfreq object.
30 polling mechanism or not.
31 32
32What: /sys/class/devfreq/.../polling_interval 33What: /sys/class/devfreq/.../polling_interval
33Date: September 2011 34Date: September 2011
@@ -43,6 +44,17 @@ Description:
43 (/sys/class/devfreq/.../central_polling is 0), this value 44 (/sys/class/devfreq/.../central_polling is 0), this value
44 may be useless. 45 may be useless.
45 46
47What: /sys/class/devfreq/.../trans_stat
48Date: October 2012
49Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
50Descrtiption:
51 This ABI shows the statistics of devfreq behavior on a
52 specific device. It shows the time spent in each state and
53 the number of transitions between states.
54 In order to activate this ABI, the devfreq target device
55 driver should provide the list of available frequencies
56 with its profile.
57
46What: /sys/class/devfreq/.../userspace/set_freq 58What: /sys/class/devfreq/.../userspace/set_freq
47Date: September 2011 59Date: September 2011
48Contact: MyungJoo Ham <myungjoo.ham@samsung.com> 60Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
@@ -50,3 +62,19 @@ Description:
50 The /sys/class/devfreq/.../userspace/set_freq shows and 62 The /sys/class/devfreq/.../userspace/set_freq shows and
51 sets the requested frequency for the devfreq object if 63 sets the requested frequency for the devfreq object if
52 userspace governor is in effect. 64 userspace governor is in effect.
65
66What: /sys/class/devfreq/.../available_frequencies
67Date: October 2012
68Contact: Nishanth Menon <nm@ti.com>
69Description:
70 The /sys/class/devfreq/.../available_frequencies shows
71 the available frequencies of the corresponding devfreq object.
72 This is a snapshot of available frequencies and not limited
73 by the min/max frequency restrictions.
74
75What: /sys/class/devfreq/.../available_governors
76Date: October 2012
77Contact: Nishanth Menon <nm@ti.com>
78Description:
79 The /sys/class/devfreq/.../available_governors shows
80 currently available governors in the system.
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index f6b0a6e2ea50..0f079be13305 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -30,7 +30,7 @@ if PM_DEVFREQ
30comment "DEVFREQ Governors" 30comment "DEVFREQ Governors"
31 31
32config DEVFREQ_GOV_SIMPLE_ONDEMAND 32config DEVFREQ_GOV_SIMPLE_ONDEMAND
33 bool "Simple Ondemand" 33 tristate "Simple Ondemand"
34 help 34 help
35 Chooses frequency based on the recent load on the device. Works 35 Chooses frequency based on the recent load on the device. Works
36 similar as ONDEMAND governor of CPUFREQ does. A device with 36 similar as ONDEMAND governor of CPUFREQ does. A device with
@@ -39,7 +39,7 @@ config DEVFREQ_GOV_SIMPLE_ONDEMAND
39 values to the governor with data field at devfreq_add_device(). 39 values to the governor with data field at devfreq_add_device().
40 40
41config DEVFREQ_GOV_PERFORMANCE 41config DEVFREQ_GOV_PERFORMANCE
42 bool "Performance" 42 tristate "Performance"
43 help 43 help
44 Sets the frequency at the maximum available frequency. 44 Sets the frequency at the maximum available frequency.
45 This governor always returns UINT_MAX as frequency so that 45 This governor always returns UINT_MAX as frequency so that
@@ -47,7 +47,7 @@ config DEVFREQ_GOV_PERFORMANCE
47 at any time. 47 at any time.
48 48
49config DEVFREQ_GOV_POWERSAVE 49config DEVFREQ_GOV_POWERSAVE
50 bool "Powersave" 50 tristate "Powersave"
51 help 51 help
52 Sets the frequency at the minimum available frequency. 52 Sets the frequency at the minimum available frequency.
53 This governor always returns 0 as frequency so that 53 This governor always returns 0 as frequency so that
@@ -55,7 +55,7 @@ config DEVFREQ_GOV_POWERSAVE
55 at any time. 55 at any time.
56 56
57config DEVFREQ_GOV_USERSPACE 57config DEVFREQ_GOV_USERSPACE
58 bool "Userspace" 58 tristate "Userspace"
59 help 59 help
60 Sets the frequency at the user specified one. 60 Sets the frequency at the user specified one.
61 This governor returns the user configured frequency if there 61 This governor returns the user configured frequency if there
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 4fa1a22c55ea..53766f39aadd 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -27,21 +27,17 @@
27#include <linux/hrtimer.h> 27#include <linux/hrtimer.h>
28#include "governor.h" 28#include "governor.h"
29 29
30struct class *devfreq_class; 30static struct class *devfreq_class;
31 31
32/* 32/*
33 * devfreq_work periodically monitors every registered device. 33 * devfreq core provides delayed work based load monitoring helper
34 * The minimum polling interval is one jiffy. The polling interval is 34 * functions. Governors can use these or can implement their own
35 * determined by the minimum polling period among all polling devfreq 35 * monitoring mechanism.
36 * devices. The resolution of polling interval is one jiffy.
37 */ 36 */
38static bool polling;
39static struct workqueue_struct *devfreq_wq; 37static struct workqueue_struct *devfreq_wq;
40static struct delayed_work devfreq_work;
41
42/* wait removing if this is to be removed */
43static struct devfreq *wait_remove_device;
44 38
39/* The list of all device-devfreq governors */
40static LIST_HEAD(devfreq_governor_list);
45/* The list of all device-devfreq */ 41/* The list of all device-devfreq */
46static LIST_HEAD(devfreq_list); 42static LIST_HEAD(devfreq_list);
47static DEFINE_MUTEX(devfreq_list_lock); 43static DEFINE_MUTEX(devfreq_list_lock);
@@ -73,6 +69,79 @@ static struct devfreq *find_device_devfreq(struct device *dev)
73} 69}
74 70
75/**