Revert "cpufreq: ondemand: tweak sampling down factor and boost time DEF_SAMPLING_DOWN_FACTOR to 2, no need for such aggressive rate reduction now we have boostpulse. As CPU frequency is shoved to max everytime we interact, it negates the need to have aggressive ramping down of samples, doubling is enough."

This reverts commit 09d23de43bbaa74c1f8665f0cde2b15cfad0a3ce.
Revert "cpufreq: ondemand: Add hotplug_boostpulse() call"

This reverts commit e9ee740c9d7d49646b68d5808b2e2687eee0de1c.
Revert "cpufreq: Add a boostpulse interface to ondemand"

This reverts commit 07e8c8626b2223bc600b26eeb521de763ad82146.
cpufreq: Add a boostpulse interface to ondemand

For applications that require a one-shot increase in frequency,
the boostpulse interface would help to scale to max for the time
specified in boostime. This helps applications that currently
increases scaling_min_freq and resets later after a fixed duration.
Instead of changing scaling_min_freq applications can directly write
to boostpulse and governer resets during regular timer after the time
expires.

Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c
Revert "cpufreq: ondemand: Add boost interface"

Switching to the CodeAurora version.

This reverts commit 981815e70915fc31f713c69d06aeedc2787ac80b.

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c

Change-Id: I509befc0267be69a4f82b96d98f638c1b72e84bc
cpufreq: Add a boostpulse interface to ondemand

For applications that require a one-shot increase in frequency,
the boostpulse interface would help to scale to max for the time
specified in boostime. This helps applications that currently
increases scaling_min_freq and resets later after a fixed duration.
Instead of changing scaling_min_freq applications can directly write
to boostpulse and governer resets during regular timer after the time
expires.

Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: notify avg load for short sampling_rate

If the sampling rate is less than 50ms reporting
the actual load may lead to poor decision making
at user space. So, for sampling rates less than 50ms
report the average of load across two samples.

Change-Id: I0d1cf00801732bee8e4380158d7e892758226594
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: boost the sampling rate on touch event

For better Ux responsiveness ondemand sampling rate
needs to be 20ms. But, a 20ms sampling rate increases power
consumption. So, boost the sampling rate to 20ms on every
touch event for 2.5 ms and later reset to default rate.
Also, change sampling down factor proportional to the
sampling rate.

Change-Id: I111b1cf3b8ed133347149afc34d329d0384ecfcb
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: ondemand: Fix the boostpulse interface

 * Boostpulse was not working because no default frequency was set.
 * We don't need an input handler to push the freq to max, userspace
   does a better job with the Power HAL.
 * Tweak boost time to 500ms

Change-Id: Ib377e22fb4fbe5f41e85ac16806fdad9537a3077

Conflicts:
	drivers/input/touchscreen/mms_ts_144.c
cpufreq: Import latest cpufreq_interactive driver from Google

Change-Id: I504009cd0228b7b54d979ccbf7173aa09414657d

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
	include/trace/events/cpufreq_interactive.h
cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f
cpufreq: interactive: keep freezer happy when not current governor

Fix a problem where the hung task mechanism was deeming the interactive
clock boost thread as hung.  This was because the thread is created at
module init but never run/woken up until needed.  If the governor is not
being used this can be forever.  To workaround this explicitly wake up
the thread once all the necessary data structures are initialized.  The
latter required some minor code shuffle.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe
cpufreq: interactive: handle speed up and down in the realtime task

Not useful to have a separate, non-realtime workqueue for speed down
events, avoid priority inversion for speed up events.

Change-Id: Iddcd05545245c847aa1bbe0b8790092914c813d2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: remove input_boost handling

Now handled in userspace Power HAL instead.

Change-Id: I78a4a2fd471308bfcd785bbefcc65fede27314cf
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: fix interactive bug during hotplug

When a new cpu is added and if does not enter idle
for long, the interactive timer is not started and hence
the cpu remains at lowest frequecny, despite the system
load. This impacts mainly benchmarks. Starting a timer
at governor start to handle low frequency.

Change-Id: I8ac9705b9f166a95715c985efacd2ae8ef387cb7
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
power: bq27541_battery: Fix voltage_now output
Quiet debug messages

Conflicts:
	drivers/power/bq27541_battery.c

Change-Id: I4c1080c021e101f2ad716a4a821fe1f9472ffe4b
grouper: add grouper_wifi_prepower() as per enterprise
grouper: match enterprise upstream commit:
commit b50894e0224e344a7aacbeb04df9c5d7e5cfbd63
Author: Hao Tang <htang@nvidia.com>
Date:   Wed Mar 7 17:21:08 2012 +0800

    arm: tegra: Change DDC freq to 10KHz

    Bug 949759

    Reduce DDC freq. The original freq is 100KHz, but some edid communication
    at this rate on some monitors like acer H243HX may fail

    Change-Id: Ib087025a35ff085b4bf618b70100fe6670c3eaec
    Signed-off-by: Hao Tang <htang@nvidia.com>
    Reviewed-on: http://git-master/r/88261
    Reviewed-by: Simone Willett <swillett@nvidia.com>
    Tested-by: Simone Willett <swillett@nvidia.com>
tegra: powergate: Fix BUG: using smp_processor_id() in preemptible
caller is tegra_powergate_set+0x110/0x234

Conflicts:
	arch/arm/mach-tegra/powergate.c

Change-Id: I6219f9f824397a0640993282230a5273e6797b14
spi: tegra: correct directions when syncing buffer for device/dma.

The Tx buffer to be synced with the direction of DMA_TO_DEVICE and
Rx buffer should be synced with direction of DMA_FROM_DEVICE.

bug 959947

Change-Id: I490a93e05723e3114c8ae3c640bb7eff23bcc75d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/103095
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>