cpufreq: Initial CPU utilization should be 0

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: bail early if target_freq == current.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: Introduce new relation for freq selection

Introduce CPUFREQ_RELATION_C for frequency selection.
It selects the frequency with the minimum euclidean distance
to target. In case of equal distance between 2 frequencies,
it will select the greater freq.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	include/linux/cpufreq.h
cpufreq: Add cpu utilization statistics to aid decisions made by userspace

Understanding system load as seen by cpufreq can help userspace
algorithms make better decisions to improve system responsiveness.
One such example would be the MP decision algorithm which mines
various system info to make decisions on hotplugging in/out
the additional cores.

Change-Id: I277db7e1a7803a3822b61e7befa25131487cfe17
Signed-off-by: Anitha Anand <anithas@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
cpufreq: create a helper function to get CPU utilization. Picked from @stratosk

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: Always allow update of user policy

In the cases where the system boots up in a constraint with policy min and
max lower than cpuinfo min/max, and user tries to set a higher user
policy min, the value would be overridden during the verifying the
limits.

Once user initiates the sysfs write the previous user policy is
maintained in policy min and max thus changing the limits for verification
of the current policy. Once the verification is completed restore the
current user policy min/max with the updated values if any. This would take
care of cases uwhere user policy min/max input is higher/lesser than the
current min and max.

Change-Id: I5ad92ba05162cb5c32c3ba3fdae21d2e505493d3
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>