mdnie: HIJACK MDNIE Profile v1.0a (Yank555.lu)

- added WHATHUB's new control interface keeping the current interface at the same time (stay open)

mdnie lite control: revert back to stocklike disabled by default (Yank555.lu)

mdnie lite control: update single control for black level

- black is applied as a delta to actual black RGB values (-128 to +128)

mdnie lite control: add single control for black level

- slightly adapted to keep copy_mode (Yank555.lu)
- black kept at 0 by default as Natural is kept as base calibration (Yank555.lu)

mdnie lite control: override for all samsung scenarios and profiles (WhatHub)

- slightly adapted to keep copy_mode (Yank555.lu)

mdnie lite control: adjust calibration (WhatHub)

- slightly adapted to keep copy_mode (Yank555.lu)

Simple switchable mdnie lite control interface

- make hijacking STANDARD mode sysfs switchable, disabled by default (Yank555.lu)
- add copy curve information from existing mode
- add copy full mode from existing mode

Sysfs Interface : /sys/class/mdnie/mdnie/...

Simple mdnie lite control interface (WhatHub)

- mdnie lite control: use standard mode instead of movie mode
mdnie: HIJACK MDNIE Profile v1.0b (Yank555.lu)

- change sysfs filerights to 666 by default

mdnie: HIJACK MDNIE Profile v1.0a (Yank555.lu)

- added WHATHUB's new control interface keeping the current interface at the same time (stay open)

mdnie lite control: revert back to stocklike disabled by default (Yank555.lu)

mdnie lite control: update single control for black level

- black is applied as a delta to actual black RGB values (-128 to +128)

mdnie lite control: add single control for black level

- slightly adapted to keep copy_mode (Yank555.lu)
- black kept at 0 by default as Natural is kept as base calibration (Yank555.lu)

mdnie lite control: override for all samsung scenarios and profiles (WhatHub)

- slightly adapted to keep copy_mode (Yank555.lu)

mdnie lite control: adjust calibration (WhatHub)

- slightly adapted to keep copy_mode (Yank555.lu)

Simple switchable mdnie lite control interface

- make hijacking STANDARD mode sysfs switchable, disabled by default (Yank555.lu)
- add copy curve information from existing mode
- add copy full mode from existing mode

Sysfs Interface : /sys/class/mdnie/mdnie/...

Simple mdnie lite control interface (WhatHub)

- mdnie lite control: use standard mode instead of movie mode
drivers/gpu/msm/z180 : fix memory leak
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>
char-random: increase default entropy settings to (512,2048)
msm8974: Adapt memutils optimizations from msm8960pro

Preload farther to take advantage of the memory bus, and assume
64-byte cache lines.  Unroll some pairs of ldm/stm as well, for
unexplainable reasons.

Future enhancements should include,

- #define for how far to preload, possibly defined separately for
  memcpy, copy_*_user
- Tuning for misaligned buffers
- Tuning for memmove
- Tuning for small buffers
- Understanding mechanism behind ldm/stm unroll causing some gains
  in copy_to_user

BASELINE (msm8960pro):
======================================================================
memcpy 1000MB at 5MB       : took 808850 usec, bandwidth 1236.236 MB/s
copy_to_user 1000MB at 5MB : took 810071 usec, bandwidth 1234.234 MB/s
copy_from_user 1000MB at 5M: took 942926 usec, bandwidth 1060.060 MB/s
memmove 1000GB at 5MB      : took 848588 usec, bandwidth 1178.178 MB/s
copy_to_user 1000GB at 4kB : took 847916 usec, bandwidth 1179.179 MB/s
copy_from_user 1000GB at 4k: took 935113 usec, bandwidth 1069.069 MB/s
copy_page 1000GB at 4kB    : took 779459 usec, bandwidth 1282.282 MB/s

THIS PATCH:
======================================================================
memcpy 1000MB at 5MB       : took 346223 usec, bandwidth 2888.888 MB/s
copy_to_user 1000MB at 5MB : took 348084 usec, bandwidth 2872.872 MB/s
copy_from_user 1000MB at 5M: took 348176 usec, bandwidth 2872.872 MB/s
memmove 1000GB at 5MB      : took 348267 usec, bandwidth 2871.871 MB/s
copy_to_user 1000GB at 4kB : took 377018 usec, bandwidth 2652.652 MB/s
copy_from_user 1000GB at 4k: took 371829 usec, bandwidth 2689.689 MB/s
copy_page 1000GB at 4kB    : took 383763 usec, bandwidth 2605.605 MB/s

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm8974: Adapt memutils optimizations from msm8960pro (part 2)
fs/dyn_sync_cntrl: dynamic sync control

The dynamic sync control interface uses new power_suspend interface

While screen is on, file sync is disabled
when screen is off, a file sync is called to flush all outstanding writes
and restore file sync operation as normal.

updated for 8974 kernels

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

Conflicts:

	fs/Kconfig

Signed-off-by: DooMLoRD <metoo.mememe@gmail.com>
cpufreq: OC up to 2.5GHz (Yank555.lu)

- added 2.34GHz, 2.42 GHz and 2.50GHz step
- max. voltage increased from 1100000 to 1200000 microVolt
Asynchronous Fsync: initial extraction of Async Fsync from HTC

Signed-off-by: Paul Reioux <reioux@gmail.com>
Revert "cpufreq: OC up to 2.5GHz (Yank555.lu)"

This reverts commit 401fe34fd11bef42fb69d40a5462fe24f146043a.
cpufreq: mcm8974: raise all voltages by 25mV (back to JB kernel levels)
cpufreq: OC up to 2.5GHz (Yank555.lu)

- added 2.34GHz, 2.42 GHz and 2.50GHz step
- max. voltage increased from 1100000 to 1200000 microVolt
LED eXtended ConTRoLs v1.1 (Yank555.lu)

  - Fixes Samsung LED pattern not repecting the user changes

 * SysFs interface :
 *
 * /sys/class/sec/led/led_intensity : 0 - 255 (100 = stock)
 *
 *     Set the relative intensity of the LED respecting the userspace's request
 *
 * /sys/class/sec/led/led_speed_on  : 1 - 5 (1 = stock)
 *
 *     Devider for delayon  (1 - 5 times shorter than requested by userspace)
 *
 * /sys/class/sec/led/led_speed_off  : 1 - 5 (1 = stock)
 *
 *     Devider for delayoff (1 - 5 times shorter than requested by userspace)
 *
 * /sys/class/sec/led/led_xctrl_version :
 *
 *     Display the current version of the eXtended ConTRoLs
 *
 * /sys/class/sec/led/led_xctrl_info :
 *
 *     Display the current settings in human readable format

LED eXtended ConTRoLs v1.0 (Yank555.lu)

 - Allow for customized brightness and delayon / delayoff control by user

 * SysFs interface :
 * -----------------
 *
 * /sys/class/sec/led/led_intensity : 0 - 255 (100 = stock)
 *
 *     Set the relative intensity of the LED respecting the userspace's request
 *
 * /sys/class/sec/led/led_speed_on  : 1 - 5 (1 = stock)
 *
 *     Devider for delayon  (1 - 5 times shorter than requested by userspace)
 *
 * /sys/class/sec/led/led_speed_off  : 1 - 5 (1 = stock)
 *
 *     Devider for delayoff (1 - 5 times shorter than requested by userspace)
 *
 * /sys/class/sec/led/led_xctrl_version :
 *
 *     Display the current version of the eXtended ConTRoLs
 *
 * /sys/class/sec/led/led_xctrl_info :
 *
 *     Display the current settings in human readable format
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)
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)
TouchWake implementation v1.4b (Yank555.lu) - remove debug messages in dmesg
Revert "cpufreq_limit: enable hard limits"

This reverts commit baa962718365d42f9bc020e726743b8e52a733bf.
REVERT 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> (reverted from commit 398ccc34b686a675c1a961b5090d8592cbb970ee)