hercules: Optimize jRCU

Conflicts:
	arch/arm/configs/hercules_defconfig
msm: kgsl: Fix for panic in z180 postmortem dumps

We were accessing z180 registers without holding
device mutex. This change ensures that we hold the
mutex before accessing z180's registers

CRs-Fixed: 644283
Change-Id: Ib6496c427fc6c9a3f97a6720adb80a390fe21b0d
Signed-off-by: Gaurav Gagrani <ggagrani@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: thermal: Update to speed up bootup time

Update KTM driver to remove flush_scheduled_work that
would introduce bootup delay. This patch replaces
cancel_delayed_work with cancel_delayed_work_sync
to cancel a delayed work.

CRs-Fixed: 647439
Change-Id: Ie81278ca3a7a58f8f46463f7149b512bd07cbcbc
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>

Conflicts:
	drivers/thermal/msm_thermal.c
msm: kgsl: Increase IDLE_TIMEOUT for 2D core to 20secs

Increasing the hang detection time for 2D core from
10 secs to 20 secs to avoid False GPU Hangs.
Some c2d test cases are taking more than 10 secs
to process which results in a False GPU Hang.

CRs-Fixed: 454439, 644283
Change-Id: Ice5e4b719adb44cd13fb8164bafedce1049416f7
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Fix GPU hang recovery logic

During new commands submission, if the write pointer
is ahead of read pointer fill ringbuffer data with
KGSL_NOP_DATA_FILLER after NOP command. This will
avoids getting incorrect context ID from the ringbuffer
extraction logic during GPU recovery.

CRs-Fixed: 620533
Change-Id: If4d25770b7288bc6fb618611c150e3876cc87c6f
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Reset VSC control registers

Configure the A2xx VSC register in context switch,
which helps GPU to recover from the bad state.

CRs-Fixed: 637288
Change-Id: I2000a579614c491a015c618a52808500541329c5
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
kgsl: Fix GPU freq being set to the max by default (320MHz)

Credit to SebastianFM: https://github.com/SebastianFM/SebastianFM-kernel/commit/831882790c5f09a4c9cf008322777f9aaa65d45b#diff-a20c5be16a95b59d8023e63f9ffa6523R987
kgsl: fix genalloc BUG when detroying pagetable.

kgsl allocs some memory (in map_global), but never free it.
Fixes that.
Only happens when on GPUMMU ..
sec_battery: Remove vbus_present wakelock

The vbus_present wakelock prevents the phone from going into deep sleep when the charger is connected; however, after charging the device with a cable type 6 (unknown cable type) charger, the wakelock is not destroyed after the cable is disconnected and instead remains, draining battery. The Nexus 5 goes into deep sleep while charging, so it's safe to assume that the vbus_present wakelock is unnecessary and can be removed completely.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
drivers: power: Increase AC max current from 900mA to 1200mA+

Signed-off-by: Sultanxda <sultanxda@gmail.com>
smb328a_charger: Remove CHG_MODE_UNKNOWN

CHG_MODE_UNKNOWN is detected as CHG_MODE_AC instead.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
drivers: power: Enable 1200mA+ max charge current over USB

Signed-off-by: Sultanxda <sultanxda@gmail.com>
sec_battery: Allow high-speed charging over USB up until 95% battery

Previously, high-speed charging over USB would stop at 90%, at which point the charging current would be lowered to 500mA.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
sec_battery: Use AC charging for unknown cable types

Unknown cable types are charger type 6. This fixes the very annoying issue described in this thread: http://forum.xda-developers.com/showthread.php?t=1759541

Signed-off-by: Sultanxda <sultanxda@gmail.com>
drivers: power: Determine charge mode from actual cable type

CHG_MODE_UNKNOWN is now detected as CHG_MODE_AC, so remove it.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
msm_fb: Port HTC MDP color enhancement feature

Ported from HTC One m7-kk-3.4.10-17db3b.

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:
	arch/arm/mach-msm/include/mach/board.h

Change-Id: I424ef1b8be48c4c8ab1d32d2fe441cf402e71d6a
vibetonz: Fix init when driver isn't built as a module

Signed-off-by: Sultanxda <sultanxda@gmail.com>
mach-msm: Kconfig: Remove deprecated BT_MGMT config
Revert "bluetooth: Fix race conditions in BT LPM"

This reverts commit 856da7272ab85b22bdc9940eba1d15e24b1af3b5.
Revert "bluetooth: Add low-power mode to support Bluedroid"

This reverts commit 1ff27478b48c6974b212a0d61ee068ef431cd95c.