aboutsummaryrefslogtreecommitdiff
path: root/include/linux/devfreq.h
AgeCommit message (Collapse)AuthorFilesLines
2013-11-15Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual earth-shaking, news-breaking, rocket science pile from trivial.git" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits) doc: usb: Fix typo in Documentation/usb/gadget_configs.txt doc: add missing files to timers/00-INDEX timekeeping: Fix some trivial typos in comments mm: Fix some trivial typos in comments irq: Fix some trivial typos in comments NUMA: fix typos in Kconfig help text mm: update 00-INDEX doc: Documentation/DMA-attributes.txt fix typo DRM: comment: `halve' -> `half' Docs: Kconfig: `devlopers' -> `developers' doc: typo on word accounting in kprobes.c in mutliple architectures treewide: fix "usefull" typo treewide: fix "distingush" typo mm/Kconfig: Grammar s/an/a/ kexec: Typo s/the/then/ Documentation/kvm: Update cpuid documentation for steal time and pv eoi treewide: Fix common typo in "identify" __page_to_pfn: Fix typo in comment Correct some typos for word frequency clk: fixed-factor: Fix a trivial typo ...
2013-10-25PM / OPP: rename header to linux/pm_opp.hNishanth Menon1-1/+1
Since Operating Performance Points (OPP) functions are specific to device specific power management, be specific and rename opp.h to pm_opp.h Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-10-25PM / OPP: rename data structures to dev_pm equivalentsNishanth Menon1-2/+2
Since Operating Performance Points (OPP) data structures are specific to device specific power management, be specific and rename opp_* data structures in OPP library with dev_pm_opp_* equivalent. Affected structures are: struct opp enum opp_event Minor checkpatch warning resulting of this change was fixed as well. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-10-14Correct some typos for word frequencyLABBE Corentin1-1/+1
Signed-off-by: LABBE Corentin <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2013-06-03PM / devfreq: add comments and DocumentationMyungJoo Ham1-0/+2
- Added missing ABI documents - Added comments to clarify the objectives of functions Signed-off-by: MyungJoo Ham <[email protected]> Acked-by: Nishanth Menon <[email protected]> Acked-by: Rajagopal Venkat <[email protected]>
2013-04-02PM / devfreq: Fix compiler warnings for CONFIG_PM_DEVFREQ unsetRajagopal Venkat1-8/+8
Fix compiler warnings generated when devfreq is not enabled (CONFIG_PM_DEVFREQ is not set). Signed-off-by: Rajagopal Venkat <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-11-26PM / devfreq: remove compiler error when a governor is moduleMyungJoo Ham1-1/+1
With the intruction of patch, eff607fdb1f787da1fedf46ab6e64adc2afd1c5a, it became possible to include a governor as a module. Thus the #ifdef statement for a governor should become #if IS_ENABLED. Signed-off-by: MyungJoo Ham <[email protected]>
2012-11-20PM / devfreq: map devfreq drivers to governor using nameNishanth Menon1-17/+4
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 <[email protected]> Cc: MyungJoo Ham <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Nishanth Menon <[email protected]> [Merge conflict resolved by MyungJoo Ham] Signed-off-by: MyungJoo Ham <[email protected]>
2012-11-20PM / devfreq: provide hooks for governors to be registeredNishanth Menon1-0/+3
Add devfreq_add_governor and devfreq_remove_governor which can be invoked by governors to register with devfreq. This sets up the stage to dynamically switch governors and allow governors to be dynamically loaded as well. Cc: Rajagopal Venkat <[email protected]> Cc: MyungJoo Ham <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Nishanth Menon <[email protected]> Acked-by: MyungJoo Ham <[email protected]>
2012-11-20PM / devfreq: Add sysfs node for representing frequency transition information.Jonghwa Lee1-0/+15
This patch adds sysfs node which can be used to get information of frequency transition. It represents transition table which contains total number of transition of each freqeuncy state and time spent. It is inspired CPUFREQ's status driver. Signed-off-by: Jonghwa Lee <[email protected]> [Added Documentation/ABI entry, updated kernel-doc, and resolved merge conflict] Signed-off-by: MyungJoo Ham <[email protected]>
2012-11-20PM / devfreq: documentation cleanups for devfreq headerNishanth Menon1-27/+27
struct parameters need to have ':' in documentation for scripts/kernel-doc to parse appropriately. Fix the errors reported by: ./scripts/kernel-doc include/linux/devfreq.h >/dev/null Cc: Rajagopal Venkat <[email protected]> Cc: MyungJoo Ham <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Nishanth Menon <[email protected]> Acked-by: Randy Dunlap <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: MyungJoo Ham <[email protected]>
2012-11-15PM / devfreq: Add current freq callback in device profileRajagopal Venkat1-0/+3
Devfreq returns governor predicted frequency as current frequency via sysfs interface. But device may not support all frequencies that governor predicts. So add a callback in device profile to get current freq from driver. Also add a new sysfs node to expose governor predicted next target frequency. Signed-off-by: Rajagopal Venkat <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-11-15PM / devfreq: Add suspend and resume apisRajagopal Venkat1-0/+12
Add devfreq suspend/resume apis for devfreq users. This patch supports suspend and resume of devfreq load monitoring, required for devices which can idle. Signed-off-by: Rajagopal Venkat <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-11-15PM / devfreq: Core updates to support devices which can idleRajagopal Venkat1-24/+10
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 <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-03-17PM / devfreq: add relation of recommended frequency.MyungJoo Ham1-3/+13
The semantics of "target frequency" given to devfreq driver from devfreq framework has always been interpretted as "at least" or GLB (greatest lower bound). However, the framework might want the device driver to limit its max frequency (LUB: least upper bound), especially if it is given by thermal framework (it's too hot). Thus, the target fuction should have another parameter to express whether the framework wants GLB or LUB. And, the additional parameter, "u32 flags", does it. With the update, devfreq_recommended_opp() is also updated. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reviewed-by: Mike Turquette <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-01-20PM / devfreq: add min/max_freq limit requested by users.MyungJoo Ham1-0/+5
The frequency requested to devfreq device driver from devfreq governors is restricted by min_freq and max_freq input. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-01-20PM / devfreq: fixed syntax errors.MyungJoo Ham1-2/+2
If devfreq.h was included without CONFIG_PM_DEVFREQ, there has been a compiler error with an additional semicolon added. This patch removes that errorneous semicolon. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-11-07PM / devfreq: fix private_dataJonathan Corbet1-1/+1
The "private_date" field in struct devfreq_dev_status almost certainly wants to be "private_data"; since there are no in-tree users of this functionality, now seems like an easy time to make the fix. Signed-off-by: Jonathan Corbet <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2011-10-02PM / devfreq: Add basic governorsMyungJoo Ham1-0/+35
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 <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reviewed-by: Mike Turquette <[email protected]> Acked-by: Kevin Hilman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2011-10-02PM: Introduce devfreq: generic DVFS framework with device-specific OPPsMyungJoo Ham1-0/+203
With OPPs, a device may have multiple operable frequency and voltage sets. However, there can be multiple possible operable sets and a system will need to choose one from them. In order to reduce the power consumption (by reducing frequency and voltage) without affecting the performance too much, a Dynamic Voltage and Frequency Scaling (DVFS) scheme may be used. This patch introduces the DVFS capability to non-CPU devices with OPPs. DVFS is a techique whereby the frequency and supplied voltage of a device is adjusted on-the-fly. DVFS usually sets the frequency as low as possible with given conditions (such as QoS assurance) and adjusts voltage according to the chosen frequency in order to reduce power consumption and heat dissipation. The generic DVFS for devices, devfreq, may appear quite similar with /drivers/cpufreq. However, cpufreq does not allow to have multiple devices registered and is not suitable to have multiple heterogenous devices with different (but simple) governors. Normally, DVFS mechanism controls frequency based on the demand for the device, and then, chooses voltage based on the chosen frequency. devfreq also controls the frequency based on the governor's frequency recommendation and let OPP pick up the pair of frequency and voltage based on the recommended frequency. Then, the chosen OPP is passed to device driver's "target" callback. When PM QoS is going to be used with the devfreq device, the device driver should enable OPPs that are appropriate with the current PM QoS requests. In order to do so, the device driver may call opp_enable and opp_disable at the notifier callback of PM QoS so that PM QoS's update_target() call enables the appropriate OPPs. Note that at least one of OPPs should be enabled at any time; be careful when there is a transition. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reviewed-by: Mike Turquette <[email protected]> Acked-by: Kevin Hilman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>