power: battery_current_limit: Add Battery Current Limit Driver.

Add Battery Current Limit Driver(BCL).
The BCL driver will poll battery monitor system
if thermal daemon enables BCL.
It will notify thermal daemon if IBat crosses Imax threshold.

Change-Id: Id2368e42cc372fbc57e8b03d1e7e4b9c492ed965
Signed-off-by: Binqiang Qiu <bqiu@codeaurora.org>
msm_fb: Set timeline threshold for command mode to 2

For command mode panel, timeline threshold is 1 and we return
commit ioctl on DMA_P interrupt. This causes fps to drop
since sometimes overlay is kickoff just after vsync interrupt
causing DMA_P wait time more than 1 vsync period. Hence, increase
timeline to 2 and return commit ioctl on vsync interrupt.

CRs-fixed: 457153
CRs-fixed: 452269
Change-Id: Ic7385631fdeb25f269306d284c94fdf43cade3d1
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
ASoC: msm8930: Update machine driver to support US/Euro headset

Add API to GND-MIC swap by toggle US-Euro GPIO.
Added callback function that triggers this API
during headset detection if US(Euro) type headset
is inserted into Euro(US) jack. On calling this API,
jack is changed back to US(Euro)type and headset is
detected.

Change-Id: Iec9a0f58a511c651ce6c516c77ffc86901767994
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
ASoC: wcd9304: Add MIC and GND swap headset dectect support

The European headsets have GND and MIC swapped jack from US headsets' view.
Detect European headset insertion on the US headset jack and vice versa,
report as headset insertion if there is a US/EURO select switch or report
as unsupported plug type.

Change-Id: I9947ff2aa84c72bac5e9d5f8c760d5a2e3743281
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: pm: Add regulator L9 for sglte support

Regulator L9 is used for audio in new sglte schematic.
Add regulator L9 support with 2.85V for audio.

Change-Id: Ia4b0c5bb95f9dbdaf65936ce55226552efbf8609
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: 8930: Add Audio GPIO changes for 8x30 sglte

Add support for headset detection GPIO and US/Euro GPIO.
8x30 SGLTE has different GPIO numbers.
For US/Euro switch, GPIO is added to toggle the GND
and MIC at run time headset detection.

Change-Id: I26983e7a4231bf419dfca52cf41bfdba633e3b72
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: vidc: Print clip information in the logs

This change prints the required information of
the clip being played.

CRs-Fixed: 459477
Change-Id: I2fd2271cbb540e5d57d82cfcbd83cf91f7c55c93
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm:rq_stats: Fix hotplug attribute during the suspend failure

If the system suspend fails, the hotplug_disable attribute remains
set. This prevents any change to core status from mpdecision. Reset
the value of this attribute if the module receives PM_POST_RESTORE
notification.

Change-Id: I22fd639134adbeb8f8f96603e285151480f537ec
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
msm: vidc: Free meta buffers during address table cleanup

This change frees the allocated meta buffers, if any
present, during video core address table cleanup.

Change-Id: Id8c42491040bc5be09f3bb59780d376e6921c76e
CRs-fixed: 459980
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
input: cyttsp-i2c-qc: Fix suspend/resume sequence

Check device wake up capability before entering into
suspend or resume. This makes sure touch works in proper
manner when the touch is configured as a wakeup source.

CRs-fixed: 432865
Change-Id: I215e69d3b03aa720049085ea2dbc02066efa157c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
gpu: ion: Add null-pointer check after allocation

Check for failed allocation and return appropritate
return code if memory allocation fails.

Change-Id: Iefb83b5e30c3cc581ccecaf6e59eae621be98083
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: timer: Use 32768Hz GPT and SCLK on 8064 family

On 8064 SOC family, a dedicated XO is derived to support
sleep clock at 32768Hz unlike 8960 SOC family where TCXO
divider was used with effective freq. of 32765Hz.

CRs-fixed: 462079
Change-Id: I79142703c4ffac209f4dedeefebc235eeb8b140d
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
msm: board-8930-pmic: Add haptics support for QRD8x30

Add haptics support for QRD8x30

Change-Id: Iebbf245593b7af15688381d5037c5db3554229dc
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
msm_fb: hdmi: Proper HPD state update

On switching off the HPD, we need to update the HPD state
after the polarity has been done to set the HPD state in
hardware properly.

CRs-Fixed: 465476
Change-Id: Ic0ba7fac72b8188c86a034ba9a45107689809028
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
arm: Remove no-longer-required RCU_NONIDLE wrapper

Commit 21111be8 "ARM: Fix negative idle stats for offline cpu" moved call
to cpu_die() to occur outside of rcu_idle_enter()/rcu_idle_exit() section.
As a result, the RCU_NONIDLE() wrapper to complete() call in
arch/arm/kernel/process.c:cpu_die() is no longer required (and is
technically incorrect to have). Removing RCU_NONIDLE() wrapper also removes
this warning seen during CPU offline:

[Note: Below message has been edited to fit 75-char per line limit.
Insignificant portions of warning message has been removed in each line.]

------------[ cut here ]------------
WARNING: at kernel/rcutree.c:456 rcu_idle_exit_common+0x4c/0xe0()
Modules linked in:
(unwind_backtrace+0x0/0x120) from (warn_slowpath_common+0x4c/0x64)
(warn_slowpath_common+0x4c/0x64) from (warn_slowpath_null+0x18/0x1c)
(warn_slowpath_null+0x18/0x1c) from (rcu_idle_exit_common+0x4c/0xe0)
(rcu_idle_exit_common+0x4c/0xe0) from (rcu_idle_exit+0xa8/0xc0)
(rcu_idle_exit+0xa8/0xc0) from (cpu_die+0x24/0x5c)
(cpu_die+0x24/0x5c) from (cpu_idle+0xdc/0xf0)
(cpu_idle+0xdc/0xf0) from (0x8160)
---[ end trace 61bf21937a496a37 ]---

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Change-Id: I721e6b20651674e6f6f584cf8d814af00b688c91
msm: sglte2: prevent early bootup of the external qsc modem

The gpio connection to the KPD_PWR_N pin of the external qsc modem
is not inverted as it was in previous sglte targets so configuring
the gpio LOW initially was causing the qsc modem to boot up too
early. Change the configuration to HIGH and set the platform data
flag that tells the mdm driver that this connection is not inverted.

Change-Id: I240f056443aa2eb2fb2bfa192894054b610e91ff
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: camera: Add proper camera close sequence

Update camera driver to handle closing sequence properly
when there is a crash in userspace threads to restart
camera again.

Change-Id: Ic1956975fd18d262e9cf503055fb09d391f8c7d7
CRs-Fixed: 467053
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Add NULL check for stats_buf

Return error in case stat_buf is NULL in the list

CRs-Fixed: 436229
Change-Id: I42b2f61dc8e6c9e9883d0bd5d7531d62b5f0fb99
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
msm: ipc: Security updates to IPC Router

In order to provide fine-grained access control to QMI services,
a security script from user-space will feed the security rules to
IPC Router. The security rule implies that in order to send a QMI
message to a service, a client process should belong to a specific
Linux/Android group. IPC Router, after receiving the security rules,
will enforce the access control rules.

Change-Id: I49f8d7c0067fc37cb0b4de2ccb46a575905ef64f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Allow QMI clients to send messages after IRSC is complete

Currently there exists a small time interval during initialization
where QMI clients in user-space can communicate with QMI services
before the IPC Router Security Configuration(IRSC) is complete.

Only allow clients to communicate after IRSC is complete.

Change-Id: I773ad5b3cb02c51a725cd60a77466876c1498b64
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>