Thermal: cpufreq cooling: fix parsing per_cpu cpufreq_frequency_table
authorZhang Rui <rui.zhang@intel.com>
Fri, 8 Feb 2013 05:09:32 +0000 (13:09 +0800)
committerZhang Rui <rui.zhang@intel.com>
Tue, 26 Mar 2013 06:33:43 +0000 (14:33 +0800)
cpufreq cooling uses different frequencies as different cooling states.

But the per_cpu cpufreq_frequency_table may contain duplicate,
invalid entries, and it may be in either ascending or descending order.
And currently, code for parsing the per_cpu cpufreq_frequency_table
is used in several places and inconsistent.

Now introduce new code to
1. get the maximum cooling states
2. translate cooling state to cpu frequency
3. translate cpu frequency to cooling state
in one place,
with the correct logic of handling per_cpu cpufreq_frequency_table.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Amit Daniel kachhap <amit.daniel@samsung.com>

No differences found