msm:qdsp6v2: Check null pointer on userspace data argument in kernel

The null pointer check is required to ensure that userspace data
in kernalspace is not null.

Change-Id: I9e522c393ae643626a4bae03731a73f5d6db6458
CRs-Fixed: 563752
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoc: msm : update speaker gain control.

Configuring speaker max gain as 8 in the SPKR_DRV_GAIN register.
Other wise the gain setting when the invert flag is set will differ.

Change-Id: I18ae30c4035088fd439ae00bba2a34aa4e9385a9
CRs-Fixed: 593181
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
audio: ocmem: fix the ocmem driver crash during video playback

Triggering SSR during wait for client callback by the audio
ocmem driver causes de-reference of freed memory in ocmem_free
function. Fixed by assigning NULL to the ocmem buffer pointer after every
ocmem_free function call.

CRs-Fixed: 589762
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Change-Id: I53208de26a4d22f6b60d118e47d16a3ad29a8040
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: clear old memhandle list when SSR happens

When SSR triggers, ASM gets RESET_EVENT callback.
Clear custom topology related old memhandle list here.
Otherwise for next ASM session opened after SSR,
old memhandle is sent to DSP and result in no audio.
Also, for ASM session while unmap during SSR, APR
command fail is expected, even then go ahead and
clear old mem handles relating to session.
Add changes to clear it from list.

CRs-Fixed: 592823, 589762, 592580, 590719, 589450, 593497
Change-Id: I10fc8190e929c7a4a344b1d393233e6cbcfcee97
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: Parse the jack type property

Parse the property from device tree to check
the jack type.

Change-Id: I9d91745ae1faa07501a49e31773e21a11bfe9bd4
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: Add sample rates to PCM front-end

Add two additional sample rates to the PCM front-
end: 88200 KHz and 176400 KHz.

CRs-Fixed: 601715
Change-Id: If61fb034a60f41b5c63a00fd764da50db7333cb5
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: fix slow_talk not disabled issue

If slow talk is disabled from the settings menu after voice
call is ended, the command is not sent to dsp since the voc state
is not in VOC_RUN and on next call CVS still has slow talk property
enabled. Fix by disabling slow talk when voice call is ended.

CRs-Fixed: 607911
Change-Id: I2c312e41b14fca021f8d41380c3b5c8493710255
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: Add upper bounds check on index

Add upper bounds check for return value of
q6audio_get_port_index().

CRs-Fixed: 575227
Change-Id: I263fc6d759beffd2c2fecc7794c279939ab25401
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx: Do not use dapm to power up cdc-vdd-mic-bias

Do not use alsa dapm to power up cdc-vdd-mic-bias power supply.
Due to sound card is not initialized, powering up this dapm widget
would get delayed. This leads to wrong mbhc calibration values.

Change-Id: I4e1f3cf523ea9f771b9993317dfd515def2b0615
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: dapm: Unlock mutex in error cases

Dapm functions are not unlocking the mutex when an error
is encountered.This change fixes the mutex unlock issue.

Change-Id: Ia7ffaea9a30ae09a501f8f861c62c64d6c110d44
CRs-fixed: 613644
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx: Add support for 24-bit playback for WCD9306

Add support for playback of 24 bit sample and sample rates
upto 192 kHz in WCD9306 codec driver. This change sets codec
format control registers based on the PCM sample size played.

Change-Id: I97f6a8c598f37403a595fcc70ca89f4ebbe4d5c6
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: Check for null data pointer

Add check for null data pointer in
aprv2_core_fn_q() and log error message if
true.

CRs-Fixed: 575228
Change-Id: I0d02913ced422ff3f396375c70ad6929908ee58d
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9306: Fix the HPH and Lineout volume range

Fix the volume range for HPH and Lineout to be
0-20 as per specification.

CRs-fixed: 613189
Change-Id: Id468daa90f8cbc261d09472e60cddc745a2c7544
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6: Add support to configure ISO and ARIB coefficients

Add support for configuring ISO or ARIB stereo mixing
coefficients. This change introduces a function with which,
AAC multi-channel driver can configure ISO or ARIB coefficients
according to configuration done by the client.

CRs-Fixed: 623127
Change-Id: I00845bdef075631f93a0c65a335b7edb5d10497b
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: Update the correct channel count for dolby configuration

Wfd supports both 5.1 and stereo pcm playback. Add the dolby
configuration for 5.1 playback on wfd.

Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:

	sound/soc/msm/qdsp6v2/msm-dolby-dap-config.c

CRs-Fixed: 609429
Change-Id: I6727ca1a4825bf64e48f211ca9d270f661ceedf0
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ib96cb419ade042d21a1213f6d8c2ff339f5d1c56
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: apq8074: Add support for SVA Multisession

SVA is a feature used for voice recognition and
activation. SVA can support upto 8 sessions at
present. This change add FE DAI links in APQ8074
machine driver for SVA feature.

Change-Id: I3ed846aa9be8233d5fc1973b2b5b7273acd1ac6b
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: Fix the sync problem after SSR

After SSR default registers needs to be restored. Then
we need to sync all the registers with cache values. This
fixes the problem where register values got changed
after SSR causing AAC clip playback failure.

CRs-Fixed: 579574
Change-Id: Ibb99d69425dcb16ba09cfb131b5059f666f75012
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx: Distortion in HPH LO combo device

Follow Class H sequence for headset, lineout and ear concurrency as per
the class H HW design sequence to avoid signal clipping.

CRs-Fixed: 602408,618992
Change-Id: I517a5df98708f7292111e5cf71ffcf6ef8c4b870
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
ASoC: wcd9xxx: Set HPH PA register to volatile

Set HPH PA register to volatile to make sure the register will be
updated with proper bits during bringup.

CRs-Fixed: 625324
Change-Id: I5a0caec730a902d6f8f251d5d87f407f9c1777ac
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>