cpufreq: Optimize cpufreq_frequency_table_verify()

cpufreq_frequency_table_verify() is rewritten here to make it more logical
and efficient.
 - merge multiple lines for variable declarations together.
 - quit early if any frequency between min/max is found.
 - don't call cpufreq_verify_within_limits() in case any valid freq is
   found as it is of no use.
 - rename the count variable as found and change its type to boolean.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
cpufreq: add new routine cpufreq_verify_within_cpu_limits()

Most of the users of cpufreq_verify_within_limits() calls it for
limiting with min/max from policy->cpuinfo. We can make that code
simple by introducing another routine which will do this for them
automatically.

This patch adds another routine cpufreq_verify_within_cpu_limits()
and updates others to use it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Optimize hotplugging routines

- Power down the slowest cpu
- Move checks from callback to calling function
- Clean it up a bit

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Remove most suspend operations

Thanks to changes in the sound subsystem, cpu usage while listening to
audio streams in now greatly reduced (if supported by the audio HAL).

Before, the cpu was under severe load about half of the time. Now we're
idling along at minimum frequency. There is no need for most suspend
operations any more. We are now just shortly onlining all cpus to speed
up display resume operations.

Signed-off-by: Dan Trifan <jimsth@gmail.com>