cpufreq: add yankdemand governor

Full stock (JB) ondemand governor with changed default tunable values aimed at lower battery consumption
kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.2 (Yank555.lu)

- make kernel / userspace mode switchable

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.1 (Yank555.lu)

- make powersuspend not depend on a userspace initiator anymore, but use a hook in autosleep instead.

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend (faux123)

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signen-off-by: Paul Reioux <reioux@gmail.com>
TouchWake implementation v1.4 (Yank555.lu)

- Finger and Pen working
- Call detection working through proxy detection
- use of wakelock is optional (sysfs switchable)
- fixed for CM11 ROMs
- reviewed digitizer handling

SysFs interface :

 * /sys/class/misc/touchwake/enabled (rw) : 1 - on / 0 - off
 *
 *     Enable / Disable TouchWake (default = disabled)
 *
 *     NB: Turning the device off with the power key will disable touchwake
 *
 * /sys/class/misc/touchwake/delay (rw) :
 *
 *     Sets the delay in ms to keep touchscreen / pen actively listening for touch after screen goes off
 *
 *     NB: A value of 0 equals "infinite", will drain battery !
 *
 * /sys/class/misc/touchwake/proximity_threshold (rw) :
 *
 *     Sets the threshold from which to consider the proxy triggered (which will disable touchwake)
 *
 *     NB: This serves as a kind of in-call detection to not turn the screen on during a call when placing
 *         the device to the ear
 *
 * /sys/class/misc/touchwake/use_wakelock (rw) : 1 - on / 0 - off
 *
 *     Enable / Disable using a wakelock to keep device awake while TouchWake is active (default = enabled)
 *
 * /sys/class/misc/touchwake/version (ro) :
 *
 *     Display the current version of the eXtended ConTRoLs
 *
 * /sys/class/misc/touchwake/debug (ro) :
 *
 *     Display debugging info (only if debugging is active at compilation time)

TouchWake implementation v1.3 (Yank555.lu)

- Finger and Pen working
- Call detection working through proxy detection
- use of wakelock is optional (sysfs switchable)
- fixed for CM11 ROMs

Issues left to resolve :

- Finger detection only works after screen is off for 1-2 seconds (though looks better on CM)

wacom: always disable digitizer when the pen is inserted

Inspired from CM11's, adapted Touchwake :

hlte: power enhancement for wacom hardware.

* always disable digitizer when the pen is inserted

Change-Id: I6c9798682f9f6349b37cb452353bd0c0e6958401

TouchWake implementation v1.2 (Yank555.lu)

- Finger and Pen working
- Call detection working through proxy detection
- use of wakelock is optional (sysfs switchable)

Issues left to resolve :

- Finger detection only works after screen is off for 1-2 seconds

TouchWake implementation v1.1 (Yank555.lu)

- Finger and Pen working
- Call detection working through proxy detection

Issues left to resolve :

- Finger detection only works after screen is off for 1-2 seconds

TouchWake implementation v1.0 (Yank555.lu)

- Finger and Pen working

Issues :

- Finger detection only works after screen is off for 1-2 seconds
- Call detection missing to avoid turning the screen on when placing the device close to the ear
TouchWake implementation v1.4a (Yank555.lu)

- finger and pen working
- call detection working through proximity sensor detection
- use of wakelock is optional (sysfs switchable)
- fixed for CM11 ROMs
- reviewed digitizer handling

What's new :

- reduces proximity sensor detection default threshold
- added debug output to dmesg of proximity sensor reading

SysFs interface :

 * /sys/class/misc/touchwake/enabled (rw) : 1 - on / 0 - off
 *
 *     Enable / Disable TouchWake (default = disabled)
 *
 *     NB: Turning the device off with the power key will disable touchwake
 *
 * /sys/class/misc/touchwake/delay (rw) :
 *
 *     Sets the delay in ms to keep touchscreen / pen actively listening for touch after screen goes off
 *
 *     NB: A value of 0 equals "infinite", will drain battery !
 *
 * /sys/class/misc/touchwake/proximity_threshold (rw) :
 *
 *     Sets the threshold from which to consider the proximity sensor triggered (which will disable touchwake)
 *
 *     NB: This serves as a kind of in-call detection to not turn the screen on during a call when placing
 *         the device to the ear
 *
 * /sys/class/misc/touchwake/use_wakelock (rw) : 1 - on / 0 - off
 *
 *     Enable / Disable using a wakelock to keep device awake while TouchWake is active (default = enabled)
 *
 * /sys/class/misc/touchwake/version (ro) :
 *
 *     Display the current version of TouchWake
 *
 * /sys/class/misc/touchwake/debug (ro) :
 *
 *     Display debugging info (only if debugging is active at compilation time)
Cpufreq: create/remove percpu sysfs nodes once

On cpu hotplug on/off, percpu "cpufreq" sysfs node and it's
sub nodes are freshly created and removed. This increases
cpu up/down latency.

Create percpu "cpufreq" sysfs node and it's sub nodes in driver
registration and remove it in unregistration. This decreases
cpu up/down latency significantly.

Change-Id: I5c2b02e74de0ae4fe08dedc959bd7402cd9b7aa5
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: http://git-master/r/146812
(cherry picked from commit 298382285677fa791098d117ccc0a0a3d9ab0f9a)
Reviewed-on: http://git-master/r/219379
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

modified for use on Mako by faux123

Signed-off-by: Paul Reioux <reioux@gmail.com>
Asynchronous Fsync: initial extraction of Async Fsync from HTC

Signed-off-by: Paul Reioux <reioux@gmail.com>
Forced Fast Charge for Samsung Note 3 v1.1 by Yank555.lu

- redone fast charge for new KK kernel sourcedrop

SysFS interface :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB
 *   2 - use custom mA configured through sysfs interface (see below)
 *
 * /sys/kernel/fast_charge/ac_charge_level (rw)
 *
 *   rate at which to charge when on AC (1.0A/h to 2.1A/h)
 *
 * /sys/kernel/fast_charge/usb_charge_level (r/w)
 *
 *   rate at which to charge when on USB (0.460A/h to 1.0A/h)
 *
 * /sys/kernel/fast_charge/failsafe (rw)
 *
 *   0 - disabled - allow anything up to 2.1A/h to be used as AC / USB custom current
 *   1 - enabled  - behaviour as described above (default)
 *
 * /sys/kernel/fast_charge/ac_levels (ro)
 *
 *   display available levels for AC (for failsafe enabled mode)
 *
 * /sys/kernel/fast_charge/usb_levels (ro)
 *
 *   display available levels for USB (for failsafe enabled mode)
 *
 * /sys/kernel/fast_charge/version (ro)
 *
 *   display fast charge version information
 *
 * /sys/kernel/fast_charge/info (ro)
 *
 *   display complete fast charge configuration in human readable format

Credits to Chad Froebel <chadfroebel@gmail.com> for the base idea.
Sound Control : WCD9320 Audio Codec aka. "FauxSound" v3.2

sound control: add register cache

bump to version 3.2

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: (OPTIONAL) add power amp registers access control as well

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: (Optional) work around for WCD93xx audio issues

(Use this only for devices with audio reset issues)

Also bump version to 3.1

Signed-off-by: Paul Reioux <reioux@gmail.com>

wcd9xxx-core: add register write without mutex protection

This is assuming the calling function will take care of the mutex.

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:

	include/linux/mfd/wcd9xxx/core.h
	sound/soc/codecs/wcd9320.c

sound control: WCD9320: update speaker gain control for Z1

Signed-off-by: Paul Reioux <reioux@gmail.com>

sound control 3.x: Initial GPL release for WCD9320 Audio Codec

This is first official GPL release based on my private implementation.

This release has been tested for xperia Z officially.  It may work
with other devices using the same WCD9320 Audio Codec as well, but not tested

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:

	sound/soc/codecs/Makefile

Sound Control: WCD9320: expose additional controls

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.3 (Yank555.lu)

- add an alternative hook for screen on / off detection in the display pannel driver
  (sleeps  ~0.1s sooner, wakes up ~1s later then autosleep)

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.2 (Yank555.lu)

- make kernel / userspace mode switchable

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.1 (Yank555.lu)

- make powersuspend not depend on a userspace initiator anymore, but use a hook in autosleep instead.

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend (faux123)

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signen-off-by: Paul Reioux <reioux@gmail.com>;
cpufreq_limit: OC up to 2.5GHz (Yank555.lu)

- define MAX_FREQ_LIMIT at 2.5GHz as well
cpufreq: add yankactive governor

Interactive governor with, fow now :

- hispeed_freq defaulting to lower than policy_max (~1.5GHz)
- target_loads increased to 95
- min_sampling time reduced to 20ms
- timer_rate increased to 60ms
- above_hispeed_delay increased to 80ms
TouchWake implementation v1.4b (Yank555.lu)

- finger and pen working
- call detection working through proximity sensor detection
- use of wakelock is optional (sysfs switchable)
- fixed for CM11 ROMs
- reviewed digitizer handling

What's new :

- don't use proxy sensor state when suspending to decide whether or not to enable touchwake & small fixes

SysFs interface :

* /sys/class/misc/touchwake/enabled (rw) : 1 - on / 0 - off
*
* Enable / Disable TouchWake (default = disabled)
*
* NB: Turning the device off with the power key will disable touchwake
*
* /sys/class/misc/touchwake/delay (rw) :
*
* Sets the delay in ms to keep touchscreen / pen actively listening for touch after screen goes off
*
* NB: A value of 0 equals "infinite", will drain battery !
*
* /sys/class/misc/touchwake/proximity_threshold (rw) :
*
* Sets the threshold from which to consider the proximity sensor triggered (which will disable touchwake)
*
* NB: This serves as a kind of in-call detection to not turn the screen on during a call when placing
* the device to the ear
*
* /sys/class/misc/touchwake/use_wakelock (rw) : 1 - on / 0 - off
*
* Enable / Disable using a wakelock to keep device awake while TouchWake is active (default = enabled)
*
* /sys/class/misc/touchwake/version (ro) :
*
* Display the current version of TouchWake
*
* /sys/class/misc/touchwake/debug (ro) :
*
* Display debugging info (only if debugging is active at compilation time)
kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.3 (Yank555.lu)

- fix stupid typo

- add an alternative hook for screen on / off detection in the display panel driver
(sleeps ~0.1s sooner, wakes up ~1s later then autosleep)

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.2 (Yank555.lu)

- make kernel / userspace mode switchable

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.1 (Yank555.lu)

- make powersuspend not depend on a userspace initiator anymore, but use a hook in autosleep instead.

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend (faux123)

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signen-off-by: Paul Reioux <reioux@gmail.com>;
kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.4 (Yank555.lu)

- add hybrid-kernel mode (autosleep and panel, first wins)
- default to hybrid-kernel mode
- harmonize debug message with my other stuff
- include all 3 modes as default, so it's only commenting out to change

- add an alternative hook for screen on / off detection in the display panel driver
(sleeps ~0.1s sooner, wakes up ~1s later then autosleep)

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.2 (Yank555.lu)

- make kernel / userspace mode switchable

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.1 (Yank555.lu)

- make powersuspend not depend on a userspace initiator anymore, but use a hook in autosleep instead.

kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend (faux123)

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signen-off-by: Paul Reioux <reioux@gmail.com>;
sound control: Samsung Microphone compatibility fixup

Signed-off-by: Paul Reioux <reioux@gmail.com>
overall_stats: add overall stats for all available cores

this is much more accurate stats tracking than just displaying core 0's
stats from most other kernels

Signed-off-by: faux123 <reioux@gmail.com>
overall_stats: make dual/quad core stats configurable via meunconfig

Signed-off-by: faux123 <reioux@gmail.com>

Conflicts:
	drivers/cpufreq/Kconfig
overall_stats: forward port to kernel 3.4+

by replacing deprecated functions with native add/sub for 64bit data types

Signed-off-by: faux123 <reioux@gmail.com>
intelli/msm_thermal: initial coding for Qualcomm Snapdragon 800 devices

an intelligent MSM thermal throttling kernel driver designed to replace the
closed sourced thermald(aemon) from Qualcomm.

The current driver can throttle the SOC via core frequency scaling or via
core hotplug with user configurable sysfs entries to adjust the throttling
temperature thresholds for each.

Derived from Qualcomm's Open source repo.

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	arch/arm/mach-msm/lge/board-8974-hammerhead.c
	drivers/thermal/Makefile
msm: kgsl: show current power level for 8974 SOCs.

since 8974 uses duplicate frequencies in its table, it's not possible to tell
which of the duplicates is actually in use

Signed-off-by: Paul Reioux <reioux@gmail.com>