Bluetooth: Disable Sniff on HID ACL(s) if SCO is active

This patch disables sniff support on HID ACL(s) if SCO is active by
updating Link Policy settings. Once SCO is disabled, link policy is
again updated to re-enable Sniff on HID ACL(s). Without this patch
it was seen in presence of SCO, disconnection was observed on HID
ACL(s).

Change-Id: I81e0b3725bdadffe06ddb345afb9de2e042d5f9a
CRs-Fixed: 509616
Signed-off-by: Hemant Gupta <hemantg@codeaurora.org>
Bluetooth: Fix for the l2cap layer crashes while turning OFF BT

-This patch fix a case where while turning OFF BT l2cap channel
 & l2cap conn get deleted in one process context, which preempted
 the another process, where l2cap con was being used while trying to
 disconnect l2cap.  As the result l2cap conn pointer become invalid.
 Later which is leading a crash.  L2cap conn should be guarded by
 spin lock while disconnecting l2cap to avoid preemption which will
 avoid  crash due invalid conn pointer.

-This patch fix list_add crash due to invalid skb pointer.
 & BUG sleep warning as well.

CRs-Fixed: 499732, 504054

Change-Id: I90c5d29cc8728566a420f0dedaf7075846b32d1a
Signed-off-by: Nitin Shivpure <nshivpur@codeaurora.org>
Apexq: USB OTG

This is a requirement for proper host/otg function.

Copied from jf kernel. Enabled for Apexq only.

d2 probably wants this as well, but needs to consider
the implications of it on their own.

Added a bit more jf code to filter out the otg control
of charging and power supply via pm8921, which is not
relevant.

More jf code and now it actually works on apexq.
Probably require some massaging to make it work with d2.

--cleanup leftovers in the apexq board file.
--revert unintended change to apexq board file.
--hybridize with preexisting msm_otg.c from d2 kernel.
--should work for d2 as before without intervention.
--tighten up

Change-Id: If2f9a3b7cbb63a84db891af069a760945a4eebcc
expressatt: add support for panel color shifting based on a sysfs interface

Also update panel color offset application.

Based on following commits from d2 and apexq:
https://github.com/CyanogenMod/android_kernel_samsung_d2/commit/48ed09fe4187e14c8702ed52ac8e5f323784a41b
https://github.com/CyanogenMod/android_kernel_samsung_d2/commit/90459ce34ecd1c31591feddfea4b3a1d88ca314e
https://github.com/CyanogenMod/android_kernel_samsung_d2/commit/41db8f4436b2c55bf9fe1932136e8cae3b04821f

Change-Id: I491434ed4db79d4aa0b2fb9c9b8d8b248d9de898
sec_jack: do G plus L detection before setting micbias

- Only affects devices with CONFIG_SAMSUNG_JACK_GNDLDET set
- Taken from stock Samsung source

Change-Id: I2774925442c9734f51136f7acb98499ebb08fbb1
Only enable vibrator sysfs for HAPTIC_PWM

Change-Id: Iddeb83bb57fa66641b964781ebe42172f35fde30
Merge remote-tracking branch 'github/cm-10.2' into update
Merge "sec_jack: do G plus L detection before setting micbias" into cm-10.2
Merge "expressatt: add support for panel color shifting based on a sysfs interface" into cm-10.2
Apexq: Re-enable full AVS.

There is a problem with some devices that are detected
as having ACPU PVS: 3 not handling the fast tables properly.

To compensate, we are reducing them to the nom tables.

AVS error on sec_pvs=fafa phones always happens at 1512 MHz.
Disable AVS for that specific frequency.

We initially overlooked a rather massive voltage bump that
was being given to apexq devices with sec_pvs=fafa. All
such units are expected to run on the slow table, with an
additional boost of 50 mV.

Change-Id: If5341bf3f0b93d53349a373013f290adc2049e1c
Merge changes If5341bf3,If2f9a3b7 into cm-10.2

* changes:
  Apexq: Re-enable full AVS.
  Apexq: USB OTG
Merge changes I90c5d29c,I81e0b372 into cm-10.2

* changes:
  Bluetooth: Fix for the l2cap layer crashes while turning OFF BT
  Bluetooth: Disable Sniff on HID ACL(s) if SCO is active
Merge remote-tracking branch 'github/cm-10.2' into update
msm: kgsl: Don't refer the NULL context

This fix ensure the BIRT test case will not
cause any device crash.

Change-Id: Ibbcdca293f4da05b21d16674f605aac729905959
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
qseecom: fix memory leak in qseecom_start_app()

Fixes the incorrect reurn path in qseecom_start_app() function with
proper clean-up. With out this patch, there are lot of memory leaks.

Change-Id: Ib9f7b08dd86952c1b0a1572d9a7d81517c3b2189
CRs-fixed: 509111
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Fix error handling path in receive_req()

This patch fixes the error handling path in receive_req() function
called from userspace. Issue seen if user is calling the receive_req
function without calling the listener registration. qseecom_find_svc()
should return NULL if there are no services found.

Change-Id: Id51d8f48d7266b5acbc845f7b9ac0068d16b1ede
CRs-fixed: 496927
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash

Fixes the kernel crash occuring with IOCTL_UNLOAD_EXTERNAL_ELF_REQ
ioctl by adding unavailable client type to qseecom_client_handle_type
enum, which is required in the driver during qseecom_release().

Change-Id: I73b817255149ffc4a808852feb2954a0ba3c317f
CRs-fixed: 508253
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>