PM / devfreq: Add governor feature flag
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 5 Oct 2020 05:48:01 +0000 (14:48 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 26 Oct 2020 01:54:41 +0000 (10:54 +0900)
commit0dd25a0d12a134cd2ba950d8c0530d4ece05c63b
tree2e2a3b99a7f47fb5b195233604a8aa96a0656ec1
parentcab477d0d4fbae1ed68d3db0b52cb5449a3c5868
PM / devfreq: Add governor feature flag

The devfreq governor is able to have the specific flag as follows
in order to implement the specific feature. For example, devfreq allows
user to change the governors on runtime via sysfs interface.
But, if devfreq device uses 'passive' governor, don't allow user to change
the governor. For this case, define the DEVFREQ_GOV_FLAG_IMMUTABLE
and set it to flag of passive governor.

[Definition for governor flag]
- DEVFREQ_GOV_FLAG_IMMUTABLE
  : If immutable flag is set, governor is never changeable to other governors.
- DEVFREQ_GOV_FLAG_IRQ_DRIVEN
  : Devfreq core won't schedule polling work for this governor if value is set.

[Table of governor flag for devfreq governors]
------------------------------------------------------------------------------
                      | simple    | perfor | power | user | passive | tegra30
      | ondemand  | mance  | save  | space|         |
------------------------------------------------------------------------------
immutable             | X         | X      | X     | X    | O       | O
interrupt_driven      | X(polling)| X      | X     | X    | X       | O (irq)
------------------------------------------------------------------------------

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/devfreq.c
drivers/devfreq/governor.h
drivers/devfreq/governor_passive.c
drivers/devfreq/tegra30-devfreq.c