Skip to content
  • Chanwoo Choi's avatar
    5f1a9066
    PM / devfreq: Add governor attribute flag for specifc sysfs nodes · 5f1a9066
    Chanwoo Choi authored
    
    
    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: default avatarDmitry Osipenko <digetx@gmail.com>
    Tested-by: default avatarDmitry Osipenko <digetx@gmail.com>
    Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
    5f1a9066
    PM / devfreq: Add governor attribute flag for specifc sysfs nodes
    Chanwoo Choi authored
    
    
    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: default avatarDmitry Osipenko <digetx@gmail.com>
    Tested-by: default avatarDmitry Osipenko <digetx@gmail.com>
    Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Loading