Commit Graph

9 Commits

Author SHA1 Message Date
Lucille Sylvester 944cc1fe9f PM / devfreq: Allow the governors to set the target flag
The devfreq framework calls a frequency targeting function with
a flag parameter.  Allow the governors to influence that parameter.

Change-Id: I4058bd9dcd027dd246ccdb90d25c68f1dc055901
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2013-11-15 16:29:25 -07:00
Vladimir Razgulin 2626967e34 PM / devfreq: predef governors update freq when device is resumed
The predefined performance and powersave governors set the device
frequency on their startup only. That's not enough because the
frequency might have changed after device suspend-resume. With this
fix the governors re-set the required device frequency every time
a device get resumed.

Change-Id: I47ac877fc9e2cfbfc4a46cc676d6f2f838cd41d6
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
2013-08-22 18:08:26 -07:00
Nishanth Menon eff607fdb1 PM / devfreq: governors: add GPL module license and allow module build
Add GPL module license and remove the static build
restrictions for building governors. This allows governors now
to be loaded on a need basis and reloaded independently of kernel
build

Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2012-11-20 18:46:23 +09:00
Nishanth Menon 1b5c1be2c8 PM / devfreq: map devfreq drivers to governor using name
Allow devfreq drivers to register a preferred governor name
and when the devfreq governor loads itself at a later point
required drivers are managed appropriately, at the time of
unload of a devfreq governor, stop managing those drivers
as well.

Since the governor structures do not need to be exposed
anymore, remove the definitions and make them static

NOTE: devfreq_list_lock is now used to protect governor
start and stop - as this allows us to protect governors and
devfreq with the proper dependencies as needed.

As part of this change, change the registration of exynos
bus driver to request for ondemand using the governor name.

Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Nishanth Menon <nm@ti.com>
[Merge conflict resolved by MyungJoo Ham]
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2012-11-20 18:46:22 +09:00
Nishanth Menon 83116e66a2 PM / devfreq: register governors with devfreq framework
With the new registration functions, governors can be now
registered with devfreq framework.

NOTE: generates 'discards qualifiers from pointer target type'
build warnings, which the next patche in this series fixes

Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2012-11-20 18:46:22 +09:00
Rajagopal Venkat 7e6fdd4bad PM / devfreq: Core updates to support devices which can idle
Prepare devfreq core framework to support devices which
can idle. When device idleness is detected perhaps through
runtime-pm, need some mechanism to suspend devfreq load
monitoring and resume back when device is online. Present
code continues monitoring unless device is removed from
devfreq core.

This patch introduces following design changes,

 - use per device work instead of global work to monitor device
   load. This enables suspend/resume of device devfreq and
   reduces monitoring code complexity.
 - decouple delayed work based load monitoring logic from core
   by introducing helpers functions to be used by governors. This
   provides flexibility for governors either to use delayed work
   based monitoring functions or to implement their own mechanism.
 - devfreq core interacts with governors via events to perform
   specific actions. These events include start/stop devfreq.
   This sets ground for adding suspend/resume events.

The devfreq apis are not modified and are kept intact.

Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-15 00:35:04 +01:00
Xiaoguang Chen 0b7c328fd3 PM: devfreq: init performance/powersave governor
Performance and powersave governor's get_target_freq
is not called if driver chooses one of these two governors.
Add init function in governor profile to call update_devfreq
which will call get_target_freq subsequently.

Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-05-01 21:23:50 +02:00
MyungJoo Ham 6530b9dea1 PM / devfreq: add min/max_freq limit requested by users.
The frequency requested to devfreq device driver from devfreq governors
is restricted by min_freq and max_freq input.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-01-20 10:12:38 +09:00
MyungJoo Ham ce26c5bb95 PM / devfreq: Add basic governors
Four cpufreq-like governors are provided as examples.

powersave: use the lowest frequency possible. The user (device) should
set the polling_ms as 0 because polling is useless for this governor.

performance: use the highest freqeuncy possible. The user (device)
should set the polling_ms as 0 because polling is useless for this
governor.

userspace: use the user specified frequency stored at
devfreq.user_set_freq. With sysfs support in the following patch, a user
may set the value with the sysfs interface.

simple_ondemand: simplified version of cpufreq's ondemand governor.

When a user updates OPP entries (enable/disable/add), OPP framework
automatically notifies devfreq to update operating frequency
accordingly. Thus, devfreq users (device drivers) do not need to update
devfreq manually with OPP entry updates or set polling_ms for powersave
, performance, userspace, or any other "static" governors.

Note that these are given only as basic examples for governors and any
devices with devfreq may implement their own governors with the drivers
and use them.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mike Turquette <mturquette@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-10-02 00:19:34 +02:00