msm_fb: HDMI-CEC: Line latch patch

The CEC hardware latches upon reading a corrupt bit
in bit 7 of any bytes due various timing issues. If
the driver detects this latch up then we call CEC reset
to release the lacthed up line.

Change-Id: Ia5a2e09372129a4358a46a623e6880095da4f0b4
CRs-Fixed: 329507
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
(cherry picked from commit 1573599adbb42c606d8b91854c76461b3f212c3e)
msm: audio: qdsp6v2: Fix memory leak and error handling

The error handling of apr_reset_workqueue and apr_reset_worker when
NULL should be two seperate checks and hence should have corresponding
appropriate log msgs.

Also there is no need to allocate memory for apr_reset_worker if
apr_reset_workqueue is NULL.

Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Change-Id: I220a23729d0fc6dadce144e476a8b2af727fc6b6
(cherry picked from commit 1abc51555a2b51614682cec1e0c8959d5ed47d8d)
ASoC: wcd9310: Fix memory leak and NULL dereferencing

Dereference of tabla structure's content without checking if tabla
is NULL will cause a crash.
Jumping to label fail will cause tabla to be not freed and hence
a memory leak.

Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Change-Id: I4ad10f5ef4d051dc2f881dc385ae2690c590d042
(cherry picked from commit ffc265213c4b83d944e3f04cb5933854a5c476fc)

Conflicts:

	drivers/mfd/wcd9310-core.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
ASoc: msm: Fix Null dereferencing and variable initialization

Dereferencing of elements stored in array 'buf' without checking if
buf is NULL will cause a crash.

Variable 'ret' should be intialized before use.

Change-Id: Ic927233009d12314251f2966ab5516ce4b2652d8
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
(cherry picked from commit 0f6c1dba6226742b7685bcdf08be72d07fcbbfab)
ASoc: msm: Fix array index out of bound issue

session_id is used as an array index in send_rtac_asm_apr() is not
checked for upper bound. Check for upper bound in order to avoid
array index out of bound issue.

Change-Id: I5016e03f86d2db4c0ebc097ae12b421266f8fce7
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
(cherry picked from commit a84982a54ca8deafcd3afc584c4a1a59c2c5f10d)
msm: spm-v2: Log SPM configuration.

Enable RTB logging of SPM_CTL and SPM_STS0 for all SPMs

Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit f351c8b727ba3b7fb62e8ee2d8efc23c2b4c3300)

Conflicts:

	arch/arm/mach-msm/spm-v2.c

Change-Id: Id21ab138666092c09d0b5120e7dccf99ffdfb6c4
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
diag: Release mutex in corner case

DIAG driver maintains a table for all registrations by remote
peripherals and user space applications. In certain cases, the
number of registrations can exceed table capacity. Thus, diag
re-allocates the table memory, to fit in all registrations.
This re-allocation stops at a threshold, even if requirement
is greater than threshold.

In such a corner case, if the requirement is greater than threshold,
then the mutex might remain locked after filling the table upto full
capacity. Adding unlocking condition to release mutex in such cases.

Change-Id: Ief412965eaaf1e1bdb1a132c03c37f43c58bc423
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
msm: kgsl: Dereference pagetable pointer after checking it's not NULL

The pt pointer was being checked against NULL value after it was
dereferenced

Change-Id: Ifbdeb7bec5e3f28396196d8f55356e5dbf1a2e55
CRs-Fixed: 336516
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit c0f21b6bc1fcb73900ea845e05a42a2de6fd8dde)
arm: use ticket spinlocks on KraitMP

Krait based systems could be vulnerable to livelock the same way
Scorpion based ones are. So, use ticket spinlocks to avoid this
possibility, and to ensure fairness among lock takers.

Change-Id: Ic806a56470805826bd31c05e79151fa0c2197eac
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
gpu: ion: Change from uncached to buffered mapping

PMEM uses buffered mappings when PMEM device is
opened with O_SYNC flag. ION should have the same
behavior as PMEM.

Change ION to provide buffered mappings instead
of uncached when the O_DSYNC flag is used when
opening the ION device.

CRs-fixed: 335827
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit de074a7d5ba87d1bd7ed2fe445da9a0f33cb9a30)

Change-Id: I429411ffd3a9681c5e394fa47f571845e87d1b04
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>
msm_fb: HDMI: Create hdmi_as_primary switch node

If HDMI is used as primary, rather than external, create a
switch node named "hdmi_as_primary".

Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
(cherry picked from commit 20bd54d7d64317f2c9e3b1384133a1c550454948)

Change-Id: Ibd0f6449e7e23563ff989d4e242121809ec1298b
Signed-off-by: Yen-Pin Hsiao <yphsiao@codeaurora.org>
hwmon: pm8xxx-adc: Fix error handling conditions

a) Fix returning error code back to clients when pa_therm
power enable fails and call regulator_get once at init for
pa_therm instead of every enable call.
b) Fix checking for the pm8xxx_adc probe has succeeded before
allowing clients of MPP configure and read to issue requests.

CRs-Fixed: 338187
Change-Id: I4c14d8e63429779b611d550ca699a0822c01d1c9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit 2c546d33b1d76c2647712f2c3f388dacff7d5eed)
msm: camera: Change S5K3L1YX register setting

Change coarse integration time of 60, 90 and 120 fps
according to frame length line for proper exposure

(cherry picked from commit 396a6a55732ed2136efb35be095452e92161021c)

Change-Id: Ib08301f1ac4d7a5c73f1ba5333aeaf8192bd3d87
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
ASoC: msm: Provide the audio sample rate for MI2S port to AFE

There is a bug in the MI2S hw_ param function which doesn't provide
the audio sample rate to AFE. The bug causes the QDSP watchdog bite.

(cherry picked from commit c70819f5eb786a035b6807b367e2c5184629da31)

Change-Id: I55eb366596d48edd23d8f020bd4a0e8b35a118db
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
video: msm: Adding CSC support for other MDP blocks

Adding support for VG1, VG2, DMA_S and Overlay Mixer 1.

Change-Id: I95a5832a70fd893970e82dadcec1e11ed608d79c
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit fa1de67dbadc084aa9fd6afa5ab4fae335089334)
msm_fb: Add support for Polynomial Color Correction (PCC)

Add support for programming Polynomial Color Correction (PCC)
parameters on MDP. PCC is used for enhancing colors on display panel by
programming the display panel calibration parameters

Tested using fbtest and dummy calibration data

Change-Id: I57dae828365f02d560e932ed0f26aa76c819fd31
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit 85153bdf335804c526746ab8d930087b658f3d50)
msm_fb: Add support for Area Reduced Gamma Correction (AR GC)

Provide API for programming Area Reduced Gamma Correction parameters.
AR GC is used for adjusting panel gamma behavior for R, G and B channels.

Tested using dummy AR-GC data from panel calibration and fbtest

Change-Id: I64e9f81510160ffaacb6927de1812dfd2a3e5436
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit c7a7cc6dc79a6f60b0468efd0fb3964b1ebc7a70)
msm: camera: Change sensor power up sequence

1) Currently same power up sequence is followed
for all sensors. This request has different power
up sequence for IMX074, OV2720 and MT9M114 sensors
as per vendor recommendation.
2) Remove compile time macro condition in
board file
3) Make sensor config independent of Kconfig

Change-Id: Icbe6da31a8cb510f1d0c73bf29eda74ad74050ac
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
(cherry picked from commit ec27a6e9f253ff94d6a6b1bf0bc506d5bcd8d28a)

Conflicts:

	drivers/media/video/msm/Kconfig
cfg80211: fix a crash in nl80211_send_station

mac80211 leaves sinfo->assoc_req_ies uninitialized, causing a random
pointer memory access in nl80211_send_station.
Instead of checking if the pointer is null, use sinfo->filled, like
the rest of the fields.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ASoC: wm8962: Fix sidetone enumeration texts

commit 31794bc37bf2db84f085da52b72bfba65739b2d2 upstream.

The sidetone enumeration texts have left and right swapped.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>