Staging: android: timed_gpio.c: improved logic of gpio_get_time()

This patch improves the logic of gpio_get_time() and, thereafter,
makes checkpatch.pl happy.

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
staging: android: logger: fixed checkpatch.pl warnings.

Signed-off-by: Jerry Stralko <gerb.stralko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
staging: android: fix a possible memory leak

Memory allocated by kstrdup should be freed.

CC: Brian Swetland <swetland@google.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Kernel 7.4
SOUND CONTROL: Set default Speaker gain to +1 on boot.
Merge branch 'LG-STOCK-KK' of https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel into merge
MSM THERMAL: make safety trigger for advanced users

If we set trigger to 0, we can set limit temp to (max) 85. But if we set another value, we can reach max 78. It can be useful for advanced users

Default value: 1
MSM THERMAL: reduce safety trigger temp to 83c
MSM THERMAL: Code Style Cleanup.
Merge Kexec Hardboot (Multy Kernel Boot code) Thanks to @PatrikKT

This is backported and modded from HTC for LG G2.

https://gist.github.com/PatrikKT/50faf32e8931d51c0c9a
Allow to use KEXEC address for all LG G2 Models.

http://forum.xda-developers.com/showpost.php?p=55340408&postcount=46
kthread_work: wake up worker only when the worker is idle

If the worker is already executing a work item when another is queued,
we can safely skip wakeup without worrying about stalling queue thus
avoiding waking up the busy worker spuriously.  Spurious wakeups
should be fine but still isn't nice and avoiding it is trivial here.

tj: Updated description.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Reduced i2c clock rate to 19.2 MHz

* Referenced CAF:
  https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/arch/arm/boot/dts/msm8974.dtsi?h=kk_3.5&id=2762366bdeb1d2d3bb43ffb21ad3a0908d51551e

Thanks @neobuddy89 for TIP :)
Revert "Allow to use KEXEC address for all LG G2 Models."

This reverts commit fd06269c4b17d570f7976d0d5f57c803e88767e9.
 Allow to use KEXEC address for all LG G2 Models. fixed.

http://forum.xda-developers.com/showpost.php?p=55340408&postcount=46
MSM RQ STATS: start enabled + auto suspend.

Then it's will be controlled by USER via STweaks. as it's needed
only for Default HotPlug.

And will be disabled again with any other hotplug driver.
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>
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>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>

Dorimanx note:
This is full commit for normal msm thermal removing all custom
Intelli thermal controls. and using STATIC values from DTS config.

Next commit will introduce all controls back to this driver and convert it
to Intelli Thermal once again :)
MSM THERMAL: Convert new msm thermal to Intelli Thermal :) works great.

*Added all needed controls, and start/stop mods.

Tested and it's working SUPERB! like atomic clock.
Sound Control: add line gain to cached and register lock

bump version to 3.6

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