diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-12-07 17:13:36 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-12-07 17:13:36 -0500 |
| commit | bf58cdffac931ff387c657395742a737837b93ca (patch) | |
| tree | 8e5a16a2ece40502f700212220c23c866470d2ff | |
| parent | 6b728f1a906976ec658827adc9c2d27608aa8517 (diff) | |
| parent | 6dcdd8e3cadd8dfcfe63d231631d70e2670970f9 (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-devfreq | 44 | ||||
| -rw-r--r-- | drivers/devfreq/Kconfig | 8 | ||||
| -rw-r--r-- | drivers/devfreq/devfreq.c | 917 | ||||
| -rw-r--r-- | drivers/devfreq/exynos4_bus.c | 45 | ||||
| -rw-r--r-- | drivers/devfreq/governor.h | 17 | ||||
| -rw-r--r-- | drivers/devfreq/governor_performance.c | 38 | ||||
| -rw-r--r-- | drivers/devfreq/governor_powersave.c | 38 | ||||
| -rw-r--r-- | drivers/devfreq/governor_simpleondemand.c | 55 | ||||
| -rw-r--r-- | drivers/devfreq/governor_userspace.c | 45 | ||||
| -rw-r--r-- | include/linux/devfreq.h | 136 |
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 | |||
| 11 | Date: September 2011 | 11 | Date: September 2011 |
| 12 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | 12 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 13 | Description: | 13 | Description: |
| 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 | ||
| 17 | What: /sys/class/devfreq/.../cur_freq | 17 | What: /sys/class/devfreq/.../cur_freq |
| @@ -19,15 +19,16 @@ Date: September 2011 | |||
| 19 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | 19 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 20 | Description: | 20 | Description: |
| 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 | ||
| 24 | What: /sys/class/devfreq/.../central_polling | 26 | What: /sys/class/devfreq/.../target_freq |
| 25 | Date: September 2011 | 27 | Date: September 2012 |
| 26 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | 28 | Contact: Rajagopal Venkat <rajagopal.venkat@linaro.org> |
| 27 | Description: | 29 | Description: |
| 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 | ||
| 32 | What: /sys/class/devfreq/.../polling_interval | 33 | What: /sys/class/devfreq/.../polling_interval |
| 33 | Date: September 2011 | 34 | Date: 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 | ||
| 47 | What: /sys/class/devfreq/.../trans_stat | ||
| 48 | Date: October 2012 | ||
| 49 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
| 50 | Descrtiption: | ||
| 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 | |||
| 46 | What: /sys/class/devfreq/.../userspace/set_freq | 58 | What: /sys/class/devfreq/.../userspace/set_freq |
| 47 | Date: September 2011 | 59 | Date: September 2011 |
| 48 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | 60 | Contact: 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 | |||
| 66 | What: /sys/class/devfreq/.../available_frequencies | ||
| 67 | Date: October 2012 | ||
| 68 | Contact: Nishanth Menon <nm@ti.com> | ||
| 69 | Description: | ||
| 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 | |||
| 75 | What: /sys/class/devfreq/.../available_governors | ||
| 76 | Date: October 2012 | ||
| 77 | Contact: Nishanth Menon <nm@ti.com> | ||
| 78 | Description: | ||
| 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 | |||
| 30 | comment "DEVFREQ Governors" | 30 | comment "DEVFREQ Governors" |
| 31 | 31 | ||
| 32 | config DEVFREQ_GOV_SIMPLE_ONDEMAND | 32 | config 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 | ||
| 41 | config DEVFREQ_GOV_PERFORMANCE | 41 | config 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 | ||
| 49 | config DEVFREQ_GOV_POWERSAVE | 49 | config 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 | ||
| 57 | config DEVFREQ_GOV_USERSPACE | 57 | config 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 | ||
| 30 | struct class *devfreq_class; | 30 | static 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 | */ |
| 38 | static bool polling; | ||
| 39 | static struct workqueue_struct *devfreq_wq; | 37 | static struct workqueue_struct *devfreq_wq; |
| 40 | static struct delayed_work devfreq_work; | ||
| 41 | |||
| 42 | /* wait removing if this is to be removed */ | ||
| 43 | static struct devfreq *wait_remove_device; | ||
| 44 | 38 | ||
| 39 | /* The list of all device-devfreq governors */ | ||
| 40 | static LIST_HEAD(devfreq_governor_list); | ||
| 45 | /* The list of all device-devfreq */ | 41 | /* The list of all device-devfreq */ |
| 46 | static LIST_HEAD(devfreq_list); | 42 | static LIST_HEAD(devfreq_list); |
| 47 | static DEFINE_MUTEX(devfreq_list_lock); | 43 | static DEFINE_MUTEX(devfreq_list_lock); |
| @@ -73,6 +69,79 @@ static struct devfreq *find_device_devfreq(struct device *dev) | |||
| 73 | } | 69 | } |
| 74 | 70 | ||
| 75 | /** | ||
