cpufreq: powernv: Replacing pstate_id with frequency table index
authorAkshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Thu, 30 Jun 2016 06:23:07 +0000 (11:53 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 12 Jul 2016 00:47:10 +0000 (02:47 +0200)
commit09ca4c9b5958403bf05482b365a67d88f10463e4
tree23ca25140a9f6ccac47ae85adbb30d9680fc0307
parent5fc8f707a2aa40c767c3a338738b9b6fcd151ac1
cpufreq: powernv: Replacing pstate_id with frequency table index

Refactoring code to use frequency table index instead of pstate_id.
This abstraction will make the code independent of the pstate values.

- No functional changes
- The highest frequency is at frequency table index 0 and the frequency
  decreases as the index increases.
- Macros pstates_to_idx() and idx_to_pstate() can be used for conversion
  between pstate_id and index.
- powernv_pstate_info now contains frequency table index to min, max and
  nominal frequency (instead of pstate_ids)
- global_pstate_info new stores index values instead pstate ids.
- variables renamed as *_idx which now store index instead of pstate

Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/powernv-cpufreq.c