PM / OPP: Remove cpufreq wrapper dependency on internal data organization
authorNishanth Menon <nm@ti.com>
Mon, 5 May 2014 13:33:49 +0000 (08:33 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 May 2014 22:35:51 +0000 (00:35 +0200)
commit0f5c890e9b9754d9aa5bf6ae2fc00cae65780d23
treee2621d55ce881e6478880a582e15bc37112dcf7c
parentca654dc3a93d3b47dddc0c24a98043060bbb256b
PM / OPP: Remove cpufreq wrapper dependency on internal data organization

CPUFREQ custom functions for OPP (Operating Performance Points)
currently exist inside the OPP library. These custom functions currently
depend on internal data structures to pick up OPP information to create
the cpufreq table.  For example, the cpufreq table is created precisely
in the same order of how OPP entries are stored inside the list implementation.

This kind of tight interdependency is purely artificial since the same
functionality can be achieved using the generic OPP functions
meant to do the same. This interdependency also limits the independent
modification of cpufreq and OPP library.

So use the generic dev_pm_opp_find_freq_ceil function that achieves the
table organization as we currently use.

As a result of this, we dont need to use the internal device_opp
structure anymore, and we hence we can switch over to rcu lock instead
of the mutex holding the internal list lock.

This breaking of dependency on internal data structure imposes no change
to usage of these.

NOTE: This change is a precursor to moving this cpufreq specific logic
out of the generic library into cpufreq.

Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp.c