cpuidle: Fix finding state with min power_usage

Since cpuidle_state.power_usage is a signed value, use INT_MAX (instead
of -1) to init the local copies so that functions that tries to find
cpuidle states with minimum power usage works correctly even if they use
non-negative values.

Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: flar2 <asegaert@gmail.com>
cpuidle: remove the power_specified field in the driver

We realized that the power usage field is never filled and when it
is filled for tegra, the power_specified flag is not set causing all
of these values to be reset when the driver is initialized with
set_power_state().

However, the power_specified flag can be simply removed under the
assumption that the states are always backward sorted, which is the
case with the current code.

This change allows the menu governor select function and the
cpuidle_play_dead() to be simplified.  Moreover, the
set_power_states() function can removed as it does not make sense
any more.

Drop the power_specified flag from struct cpuidle_driver and make
the related changes as described above.

As a consequence, this also fixes the bug where on the dynamic
C-states system, the power fields are not initialized.

[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=42870
References: https://bugzilla.kernel.org/show_bug.cgi?id=43349
References: https://lkml.org/lkml/2012/10/16/518
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: flar2 <asegaert@gmail.com>

Conflicts:
	drivers/cpuidle/driver.c
	include/linux/cpuidle.h
cpuidle: Fix finding state with min power_usage

Since cpuidle_state.power_usage is a signed value, use INT_MAX (instead
of -1) to init the local copies so that functions that tries to find
cpuidle states with minimum power usage works correctly even if they use
non-negative values.

Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: flar2 <asegaert@gmail.com>

Conflicts:
	drivers/cpuidle/cpuidle.c
	drivers/cpuidle/governors/menu.c
cpuidle: remove the power_specified field in the driver

We realized that the power usage field is never filled and when it
is filled for tegra, the power_specified flag is not set causing all
of these values to be reset when the driver is initialized with
set_power_state().

However, the power_specified flag can be simply removed under the
assumption that the states are always backward sorted, which is the
case with the current code.

This change allows the menu governor select function and the
cpuidle_play_dead() to be simplified.  Moreover, the
set_power_states() function can removed as it does not make sense
any more.

Drop the power_specified flag from struct cpuidle_driver and make
the related changes as described above.

As a consequence, this also fixes the bug where on the dynamic
C-states system, the power fields are not initialized.

[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=42870
References: https://bugzilla.kernel.org/show_bug.cgi?id=43349
References: https://lkml.org/lkml/2012/10/16/518
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: flar2 <asegaert@gmail.com>
LCD_KCAL Colour Control for m8

Conflicts:
	arch/arm/mach-msm/Makefile
	arch/arm/mach-msm/devices_cmdline.c
fix compilation error
Overclocking and undervolting options

Conflicts:
	arch/arm/mach-msm/clock-krait-8974.c
Revert "block: account iowait time when waiting for completion of IO request"

This reverts commit 1531b5caf879bbb3cc1d22c459d4e8125b11649b.
Revert "exFAT support"

This reverts commit 95fd2255b3144b6a7a3c8baca22050c55a9430e6.
Revert "FS: import F2FS"

This reverts commit 0196eab4c0e333ce79087def55f7661b4fd36bbd.
Revert "sync: don't block the flusher thread waiting on IO"

This reverts commit 45064aa41609b4542b72fe1faac9816f1fd028c7.

Conflicts:
	fs/fs-writeback.c
	include/linux/writeback.h

Conflicts:
	fs/fs-writeback.c
	include/linux/writeback.h
Revert "sched: Implement smarter wake-affine logic"

This reverts commit 53637ba5c09fa3dd6eba92bb0f63b02b33c196fb.
Revert "allow moc-crypto modules to load"

This reverts commit f23f9b7b6aca33430f25529356c4692e07d931fe.
Show pvs in sysfs
msm-sleeper: limit max freq when screen is off

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/msm-sleeper.c
msm: cpufreq: Add API to allow limiting of min and max cpu frequencies

CPUFreq provides scaling sysfs nodes to set min and max frequencies, but
there are times when the operating range has to be controlled
irrespective of the scaling limits, to ensure the thermal stability of
the device.

The API allows kernel thermal safeguards to pitch in and limit the
frequencies.

Change-Id: I3dc7496747792e6223695131f1644dd87054b025
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/cpufreq.c
Signed-off-by: flar2 <asegaert@gmail.com>

Conflicts:
	arch/arm/mach-msm/cpufreq.c
	arch/arm/mach-msm/include/mach/cpufreq.h
Overclocking:  fix and add more steps
Add option to lower vibration
update defconfig

Conflicts:
	arch/arm/configs/elementalx_defconfig
[qpnp-vibrator] sysfs interface from GPE source

Conflicts:
	drivers/misc/qpnp-vibrator.c