OSDN Git Service

thermal: cpu_cooling: merge frequency and power tables
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 25 Apr 2017 10:27:19 +0000 (15:57 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Sun, 28 May 2017 00:32:44 +0000 (17:32 -0700)
commit349d39dc57396e3e9f39170905ff8d626eea9e44
tree2c93a960db6a342014f91a39ee8f1aed2afce27e
parentba76dd9ddd4046ece873444c2256e09afbd5d32e
thermal: cpu_cooling: merge frequency and power tables

The cpu_cooling driver keeps two tables:

- freq_table: table of frequencies in descending order, built from
  policy->freq_table.

- power_table: table of frequencies and power in ascending order, built
  from OPP table.

If the OPPs are used for the CPU device then both these tables are
actually built using the OPP core and should have the same frequency
entries. And there is no need to keep separate tables for this.

Lets merge them both.

Note that the new table is in descending order of frequencies and so the
'for' loops were required to be fixed at few places to make it work.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/cpu_cooling.c