thermal: qpnp-adc: add tm channel irq disable feature

The tm channel interrupt disable feature was not implemented.
So add this feature to qpnp_adc_tm_channel_configure().

Change-Id: I9b4b708fbaef5db0e5cfc3bf1eaaa400ac2585e5
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
msm: thermal: add wakelock for prevent repeat suspend

when device enters suspend after heating,
device will wake up by low threshold. and send notify
to userspace. however, sometimes It enters into suspend
before setting new threshold value by userspace.
It may cause to repeat suspend/resume cycle.
So, add wakelock for preventing it.

Change-Id: I4a90a74eb0ef8514ec4ee6b3c7bb1cb58372c53a
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
ASoC: msm: qdsp6v2: Ignore unexpected events from dsp

If dsp responds with an unexpected event, audio driver
should ignore the response and continue. Change removes
the BUG_ON and handles error gracefully.

Change-Id: Ie7bbf1ea9b47630dae38e89887e53883f8f1dc12
CRs-fixed: 512784
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: msm: Ignore unexpected events from dsp

If dsp responds with an expected event, audio driver
should ignore the response and continue. Change removes
the BUG_ON and handles the error gracefully.

Change-Id: I9ae067c4ffbbcac3b2a3ad4c63fe882854348df8
CRs-fixed: 495205
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
SoC: msm: qdsp6v2: return DEFER code when probe is not done

Probe may not be done when first alloc api is called. Need to return
DEFER error so that client can try later.

Change-Id: I4aa8da928aa2b9f6d22ad9aaae9a8cb27b93d424
Signed-off-by: Fred Oh <fred@codeaurora.org>
Soc: msm: qdsp6v2: Fix invalid params handling

Alloc and free apis should sanity check all input params.
If allocation fails set client and ion handle to NULL.

Change-Id: Ide3bd782eb90ee8b033e39de232929a1ca7174b7
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: audio: qdsp6v2: Change acdb_mmap size variable to unsigned

The acdb_mmap fuction does a size calculation but
stores the result in an int which makes negitive
numbers possible. Changing the variable to unsigned
ensures that the size used is never out of bounds.

Change-Id: Iffd9c1440d2f28b703a77993fdbb3ccd18f30694
CRs-fixed: 548145
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
msm: audio: qdsp6v2: Zero the cfg stack var

Write zeroes into the stack variable cfg to ensure
no previously written stack data is sent to
user-space.

Change-Id: Ie571949e3613c9e5a916b23e1dc19605496d9dbf
CRs-Fixed: 551574
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
msm: audio: qdsp6v2: memeset msm_audio_stats to zero

memeset msm_audio_stats to zero before copying to user space.

Change-Id: I5f47bf85e36d46f726dddae68962a3d1cd06213b
CRs-fixed: 549307
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
ASOC: qdsp6: Add pause/resume support for AAC encoder

-  If session is stopped, AUDIO_START should
   trigger session to be started again. This way
   pause/resume becomes stop/start for AAC encoder.

Change-Id: Id44a5342bb90b049d9c617ede60bf41a5289c581
Signed-off-by: Sharad Sangle <assangle@codeaurora.org>
msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: I20e56ee32d3b9d1eecc4fa7761ff164a210fbbde
CRs-Fixed: 561611
CRs-Fixed: 561615
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: qdsp6v2: Deleting kernel driver from arch/arm/mach-msm

Drivers are registering under misc driver but exists under arch/arm/mach

Change-Id: I6210ed2ffbc38608914fb765b8e50ac6d97950ff
CRs-Fixed: 554492
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoc: msm: qdsp6v2: add vm page offset validation

Lack of range validation can lead wrong mapping or expose arbitrary
memory page to userspace

Change-Id: I8c6eb1b7255d444bffd9d3748ca4815b11bdf16a
Signed-off-by: Fred Oh <fred@codeaurora.org>
Soc: msm: qdsp6v2: Fix invalid params handling

when ion_import_legacy api fails then we should not
call ion_free as the handle returned is not proper to
dereference so instead just destroy the ion client and
bail out.Sanity checks for all the input params is also
added.

Change-Id: I6c51986bf2ce334ff7405e38a12c1c1db50e2417
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
msm: qdsp6v2: Deleting kernel driver from arch/arm/mach-msm/qdsp6v2

Driver is registering under misc driver but exists under arch/arm/mach

Change-Id: I0930d3f56767569edefa1af3c7d45a724a219ce3
CRs-Fixed: 548017
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC: usb: change uevent value to digital USB HEADSET

The uevent of usb_audio has two components - analog, digital.
When usb_audio is set to 1, uevent is set to analog.
But, this is incorrect type. The usb audio interface should be
digital. So, it changed to 2 - digital.

Change-Id: I646301a15a8b3badd9f1794d98c451b2d9f42293
Signed-off-by: sangwoo <sangwoo2.park@lge.com>
ASoC: wcd9320: Add support for notification of codec events

Add Support for machine driver to register for codec event. Machine
driver needs do one time ADSP AFE configuration after codec
initialization after ADSP SSR. So add support for machine driver to
register for codec initialization event.

CRs-Fixed: 487983
Change-Id: I3e4a392659ae8c88d845f5337760fda3af94a117
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>

Conflicts:

	sound/soc/codecs/wcd9320.h

Signed-off-by: Ajay Dudani <adudani@codeaurora.org>

Conflicts:
	sound/soc/codecs/wcd9320.h
ASoC: msm8x10-wcd: Add the internal bias for mic1

Add codec internal bias for mic1
in order for compatible hardware mic design

Change-Id: Ie90d449fd629ebe034673df49c4e2cd0917c8ada
Signed-off-by: Walter Yang <quic_yandongy@codeaurora.org>
ASoC: wcd9xxx: don't wait for mic volage to settle

When electrical mbhc runs removal irq shouldn't run mic voltage settle
logic as it can mean actual headset removal.
Fix to report plug type removal immediately to avoid delay.

CRs-fixed: 482885
Change-Id: I01779cb9b8031613c8b9f2377ff723101700c6b9
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9320: Update headphone static gain in companding mode

Depending on the buik voltage, the static gain for headphone path
are different when compander is enabled. -3dB static gain is required
if the buik voltage is 1.8V and 0dB gain is required while the buik
voltage is 2.15V. Update the codec driver to match the requirement.

Change-Id: Ia21c8732362176d20956a817058ede3c4a472c52
CRs-Fixed: 500280
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>