Sound Control: add line gain to cached and register lock

bump version to 3.6

Signed-off-by: Paul Reioux <reioux@gmail.com>
LCD_KCAL: Color Control driver for Nexus 5

Signed-off-by: Paul Reioux <reioux@gmail.com>
LCD KCAL: Fix Gamma max value issue

Major thanks to Yorici Vz for his tireless pursuit of perfection on Nexus 5
Color / Gamma :D

Signed-off-by: Paul Reioux <reioux@gmail.com>
msm: mdss: Display gamma control (myfluxi, faux123)

msm: mdss: Display gamma control

TODO: confirm rgb channels, identify other tunables, cleanup,
apply values without switching screen (off and) on.

sysfs: /sys/devices/qcom,mdss_dsi_jdi_command_ors.69/*
msm: mdss: Apply commands values without switching screen (off and) on
msm: mdss: Remove tunable for command 32

Even slight changes look ugly or distort the screen.
msm: mdss: distinguish between Gamma RGB polarity Positive/Negative

Signed-off-by: Paul Reioux <reioux@gmail.com>
msm: mdss: Remove sysfs for unused commands
msm: mdss: Identify white point in sysfs
msm: mdss: Add safety check for user input

Leave more checks either to the control app or the user's intelligence.
msm: mdss: Finalize gamma interface and cleanup

- Remove all sysfs files of unused commands
- Remove auto sync for negative polarities, these must be written separately
- Protect offset bit of white point command as well
- Apply white point bit 2 as duplicate of bit 1
msm: mdss: Send panel commands via separate function

Sending panel comnmands is very expensive, add a separate function to
accomplish this. Once all commands have been stored write anything to
the kgamma_send file.
msm: mdss: Add hardware revision check

Our gamma interface works with both current hardware revisions,
11 and 11j, although all testing was carried out on 11. As we
don't know about possible future revisions, let's bail out until
correct offsets for panel commands have been added.

Signed-off-by: Paul Reioux <reioux@gmail.com>
msm: mdss: Use workqueue to send panel commands

Sending panel commands is known to be expensive, honor this by
scheduling this task. Also check for panel state and send commands
only when we're actually awake.

These fixes adress bug reports regarding behaviour during boot.
msm: mdss: Find a stable sysfs node for the gamma interface

Move sysfs files to /sys/module/dsi_panel/*
msm: mdss: Reset panel to apply RGB gamma data

Writing to the reset gpios produces a short flicker. This however
appears to be the only reliable method to apply RGB gamma data
without switching the panel off and on again.
msm: thermal: Update thermal subsystem

This is a squash of the following commits:

4bc738d2 msm: thermal: Set vdd restriction initialize level to -1
5daeff0f msm: thermal: Clean up msm cpufreq function calls
6b21cae8 thermal: tsens: Fix invalid set temperature check
c473c9dd Revert "msm: thermal: Clean up msm cpufreq function calls"
bb646211 thermal: Add sensor API to allow any driver to set thresholds
718bf641 thermal: msm: tsens: Notify thermal framework on threshold cross
4ff40944 msm: thermal: Enable hotplug support in kernel
3af26db0 thermal: Fix sensor thresholds not accounted correctly
d8b1e1ec Revert "Revert "msm: thermal: Clean up msm cpufreq function calls""
b2f16712 thermal: Add Support for enabling and disabling tsens trip
81c1b0b7 msm: thermal: Don't initialize hotplug thread when not configured
89961312 msm: thermal: Add support for emergency frequency mitigation
6460392a msm: thermal: Add IOCTL interface support to Kernel Thermal Monitor

Bug: 14139855

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

Conflicts:
	drivers/thermal/msm_thermal.c
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>

Conflicts:
	drivers/thermal/Makefile
intelli_thermal: compatibility fix up with latest MSM Thermal drivers

Signed-off-by: Paul Reioux <reioux@gmail.com>
intelli-thermal v2: initial adaptation

Intellithermal 2.0 is based on the latest Qualcomm thermal driver adapted for
in-kernel use and control.  Newer MSM8974+ chipsets should use this driver
going forward

Signed-off-by: Paul Reioux <reioux@gmail.com>
Update i2c to save battery

ARM: dts: msm: i2c: change clock rate to 19.2 MHz

For standard  requirement, I2C source
speed of 50MHz causes high power usage, hence
this patch change the clock rate to 19.2 MHz
to save power.

CRs-Fixed: 552956
Change-Id: Ifb17fb79062a390a19881d247a2ac0ca5cc55d80
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: Paul Reioux <reioux@gmail.com>

i2c-qup: Verify that mem resource exists prior to redirection

Redirection may cause a system crush in the case of a missing
memory resource specification. Now when reading a memory
resource from platform data, the return value is checked
before doing redirection on the resource.

Change-Id: Id4ef9c293f65935d6e3bd311720a1e66a2da8f35
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: Handle scenario if runtime PM is disable

If  runtime PM is not supported, make sure
the I2C clock and GPIOs enabled at the start
of the transfer(RD/WR)
This is done by i2c_qup_pm_resume_runtime()

CRs-Fixed: 492194
Change-Id: Iaa901a0f0d0cd58318e3f6dd64e1db73c73b630f
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

 i2c_qup: Improve implementation of PM callbacks

Refactor PM callbacks and remove redundant variable.
Add support for configuration of clockcontrol event.
Now the clock's state may be set by pm calls (as before)
or by a transfer's begining and ending.
Runtime-PM is still used in autosuspend configuration for
expensive NoC voting/unvoting since that may go to remote
processor.

CRs-Fixed: 592435
Change-Id: I54f7c67f768336f66765a04006b4c8e4734ac277
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

i2c_qup: Fix for unhandled IRQ

I2C qup driver handle scenario where runtime
PM is not enabled and enables clocks explicitly.
But it checks runtime PM suspended state in ISR
routine before processing further which can lead to issue
of unhandled valid IRQ sometimes because I2C client
can initiate transaction very early after system
resume and runtime PM is not enabled.

Add atomic flag to synchronize between active transaction
request when clocks are enabled and ISR.

CRs-Fixed: 670480
Change-Id: I175bc29a7b5b6e713ab6ec28deb34b2b0d23fa8a
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>

qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Yank555.lu v1.1-beta1 config
ramfs: replace stock hammerhead 4.4.4 ramfs by SlimKAT 7.0 ramfs

- unsecure
- SELinux permissive
Yank555.lu v1.1-beta2 config
kernel/power/powersuspend: new PM kernel driver for Android w/o early_suspend v1.6 (faux123/Yank555.lu)

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

v1.2 - make kernel / userspace mode switchable

v1.3 - add a hook in display panel driver as alternative kernel trigger

v1.4 - add a hybrid-kernel mode, accepting both kernel hooks (first wins)

v1.5 - fix hybrid-kernel mode cannot be set through sysfs

v1.6 - replace display pannel hooks by lcd_notify
Yank555.lu v1.1-beta3 config