forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM / devfreq: Add governor attribute flag for specifc sysfs nodes
DEVFREQ supports the default governors like performance, simple_ondemand and also allows the devfreq driver to add their own governor like tegra30-devfreq.c according to their requirement. In result, some sysfs attributes are useful or not useful. Prior to that the user can access all sysfs attributes regardless of the available attributes. So, clarify the access permission of sysfs attributes according to governor. When adding the devfreq governor, can specify the available attribute information by using DEVFREQ_GOV_ATTR_* constant variable. The user can read or write the sysfs attributes in accordance to the specified attributes. When adding the governor, can add the following attributes according to the governor feature. [Definition for speific sysfs attributes] - DEVFREQ_GOV_ATTR_POLLING_INTERVAL to update polling interval for timer. : /sys/class/devfreq/[devfreq dev name]/polling_interval - DEVFREQ_GOV_ATTR_TIMER to change the type of timer on either deferrable or dealyed timer. : /sys/class/devfreq/[devfreq dev name]/timer And all devfreq governors have to support the following common attributes. The common attributes are added to devfreq class by default. - governor - available_governors - available_frequencies - cur_freq - target_freq - min_freq - max_freq - trans_stat [Table of governor attribute flags for devfreq governors] ------------------------------------------------------------------------------ | simple | perfor | power | user | passive | tegra30 | ondemand | mance | save | space| | ------------------------------------------------------------------------------ governor | O | O | O | O | O | O available_governors | O | O | O | O | O | O available_frequencies | O | O | O | O | O | O cur_freq | O | O | O | O | O | O target_freq | O | O | O | O | O | O min_freq | O | O | O | O | O | O max_freq | O | O | O | O | O | O trans_stat | O | O | O | O | O | O -------------------------------------------------------- polling_interval | O | X | X | X | X | O timer | O | X | X | X | X | X ------------------------------------------------------------------------------ Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
- Loading branch information
1 parent
0dd25a0
commit 5f1a906
Showing
5 changed files
with
159 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,20 +37,6 @@ Description: | |
The /sys/class/devfreq/.../target_freq shows the next governor | ||
predicted target frequency of the corresponding devfreq object. | ||
|
||
What: /sys/class/devfreq/.../polling_interval | ||
Date: September 2011 | ||
Contact: MyungJoo Ham <[email protected]> | ||
Description: | ||
The /sys/class/devfreq/.../polling_interval shows and sets | ||
the requested polling interval of the corresponding devfreq | ||
object. The values are represented in ms. If the value is | ||
less than 1 jiffy, it is considered to be 0, which means | ||
no polling. This value is meaningless if the governor is | ||
not polling; thus. If the governor is not using | ||
devfreq-provided central polling | ||
(/sys/class/devfreq/.../central_polling is 0), this value | ||
may be useless. | ||
|
||
What: /sys/class/devfreq/.../trans_stat | ||
Date: October 2012 | ||
Contact: MyungJoo Ham <[email protected]> | ||
|
@@ -65,14 +51,6 @@ Description: | |
as following: | ||
echo 0 > /sys/class/devfreq/.../trans_stat | ||
|
||
What: /sys/class/devfreq/.../userspace/set_freq | ||
Date: September 2011 | ||
Contact: MyungJoo Ham <[email protected]> | ||
Description: | ||
The /sys/class/devfreq/.../userspace/set_freq shows and | ||
sets the requested frequency for the devfreq object if | ||
userspace governor is in effect. | ||
|
||
What: /sys/class/devfreq/.../available_frequencies | ||
Date: October 2012 | ||
Contact: Nishanth Menon <[email protected]> | ||
|
@@ -109,6 +87,35 @@ Description: | |
The max_freq overrides min_freq because max_freq may be | ||
used to throttle devices to avoid overheating. | ||
|
||
What: /sys/class/devfreq/.../polling_interval | ||
Date: September 2011 | ||
Contact: MyungJoo Ham <[email protected]> | ||
Description: | ||
The /sys/class/devfreq/.../polling_interval shows and sets | ||
the requested polling interval of the corresponding devfreq | ||
object. The values are represented in ms. If the value is | ||
less than 1 jiffy, it is considered to be 0, which means | ||
no polling. This value is meaningless if the governor is | ||
not polling; thus. If the governor is not using | ||
devfreq-provided central polling | ||
(/sys/class/devfreq/.../central_polling is 0), this value | ||
may be useless. | ||
|
||
A list of governors that support the node: | ||
- simple_ondmenad | ||
- tegra_actmon | ||
|
||
What: /sys/class/devfreq/.../userspace/set_freq | ||
Date: September 2011 | ||
Contact: MyungJoo Ham <[email protected]> | ||
Description: | ||
The /sys/class/devfreq/.../userspace/set_freq shows and | ||
sets the requested frequency for the devfreq object if | ||
userspace governor is in effect. | ||
|
||
A list of governors that support the node: | ||
- userspace | ||
|
||
What: /sys/class/devfreq/.../timer | ||
Date: July 2020 | ||
Contact: Chanwoo Choi <[email protected]> | ||
|
@@ -120,3 +127,6 @@ Description: | |
as following: | ||
echo deferrable > /sys/class/devfreq/.../timer | ||
echo delayed > /sys/class/devfreq/.../timer | ||
|
||
A list of governors that support the node: | ||
- simple_ondemand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters