ASoC: msm: Add PCM support in compress driver

PCM playback support is added to compress driver so that application
can use the single audio hardware device to play both compressed
and PCM audio.

Change-Id: Ie7719be8d7435088a7e4cfb5b817d4557e25e4c5
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
ASoC: msm: qdsp6v2: Fix voice mute issue when EC ref is set

Function voc_set_ext_ec_ref returns 0 on success, handle the
return value of this function appropriately to avoid mute issue.

CRs-Fixed: 601078
Change-Id: I7226c088410bf4a2effe0d060f839dc7928359bf
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
ASoC: msm: qdsp6v2: Remove cmd_state from ASM header function

Cmd_state indicates whether the callback has been received
and whether the function should exit wait.
Remove setting of this variable in ASM header because
some functions such as get_session_time need ASM header
but do not need to modify this flag.

CRs-fixed: 613817
Change-Id: I6751cd89b3199c7350aaf1ebb70d7062ac65554f
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
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>
ASoC: msm: Null dereference check added

In asm_read function we should check buffer pointer
before it is dererferenced.

CRs-Fixed: 612682
Change-Id: I1968c038e1d35381bf174000287d542441e41092
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: msm: Fix the Listen calibration copy issue

This change fixes issue with listen calibration data
copied to the shared memory of correct size. A bug was
introduced during support for multisession listen support
on this branch. This changes address that issue of copying
calibration data of correct length.

Change-Id: I772ea7fc076c42ddd3629f6eba6eeb38313cbf88
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
ASoC: msm: Reset the stream open flag after CMD_CLOSE is sent to DSP

In case of gapless playback, driver does not wait for EOS. CMD_CLOSE
for stream one or two can be called from compress driver free before
EOS ACK for stream one is received. This can result in CMD_CLOSE to
be sent for already closed stream. Reset the stream open flag after
CMD_CLOSE is sent to DSP to prevent multiple CMD_CLOSE on same
stream.

CRs-Fixed: 611416
Change-Id: Ic186ae37a760a2996ebd7b9b5dc5d5846621ab66
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: msm: qdsp6v2: add path to support external EC reference

Addition of a routing path to connect VoLTE and VoIP
uplink with MI2S Tx port. This change is required if
external EC is to be used with external speaker.

CRs-Fixed: 622500
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
Change-Id: Ic3f7b7b43235623696fd610bc0b459633f0cd7c2
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
ASoC: msm: qdsp6v2: update rtac driver with asm handle

rtac driver uses the asm session handle to communicate with DSP
this handle is supplied to rtac driver in q6asm_audio_client_alloc
function. But the rtac driver is not updated when the asm session
is de-allocated. This change is about updating rtac driver with
asm session handle during q6asm_audio_client_free.

Change-Id: I10bab5830d8e29d17907511c757c4d2bcf09c0cc
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
ASoC: msm: ensure check before accessing session private data.

The compressed session needs to be active to set volume to dsp.
Ensure the check to see valid session exist before accessing
private data, else results in kernel panic.

The Memory allocation for driver data also needs to be freed
for failure in session open.

CRs-Fixed: 638817
Change-Id: Ifdce543aa55df420960e9eeff0564f18d9410060
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC: msm: qdsp6v2: Add check for NULL dereference

The asm loopback during close does not check
for NULL before closing the playback and capture
instances. The change ensures only the valid
playback/capture instances are closed.

CRs-Fixed: 643724
Change-Id: I3373f62a2413e1497b6f8a401158444cd2870b2a
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
ASoC: msm: Do not deregister APR mmap handle for ASM Custom Topology

Remove APR deregister call from ASM Custom Topology to
ensure that the RESET event is called during SSR to
signal that ASM custom topology needs to be sent.

Various error handling is also added so that reference
count for apr deregister and register also happens properly.

Change-Id: Ib127f20442dd457bc265d93c01ab0fb94beff2f3
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm: qdsp6v2: Avoid DS1 and SRS topology on low latency path

Currently, the low latency path go through tuning of the post
processing with the default as well as third party post
processing topologies such as DS1 and TruMedia topology. Avoid
enabling the DS1 and TruMedia topology on low latency path
retaining the tuning functionality on the default topology.

CRs-Fixed: 643857
Change-Id: I8ae6b4ecb0be530c8d72218d39498cff7f8a7fd9
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
power: qpnp-charger: Use simpler ifdefs

Change-Id: I1986826c5d2f30f04313b5ae4d7426ecfaac8053
qpnp-charger: Updates from oneplus kernel

Change-Id: Iecaf6aed8b8afa49a1ac7d80c4b59bc51fa5a493
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.

Conflicts:

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

CRs-Fixed: 609429
Change-Id: I6727ca1a4825bf64e48f211ca9d270f661ceedf0
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
1.fix severl bugs about TP hard reset
2.optimize the heating issue for VOOC charge
3.Solve the low probability blue screen.
4.solve the old IC aging test partial red,shining black issue
5.Solve the low probability blue screen.

Conflicts:
	arch/arm/boot/dts/dsi-panel-jdi-1440p-video.dtsi
	arch/arm/boot/dts/msm8974-cdp.dtsi
	arch/arm/boot/dts/msm8974-leds.dtsi
	arch/arm/boot/dts/msm8974.dtsi
	arch/arm/mach-msm/board-8974-gpiomux.c
	arch/arm/mach-msm/board-8974.c
	arch/arm/mach-msm/include/mach/qdsp6v2/rtac.h
	drivers/input/touchscreen/synaptics_dsx_i2c.c
	drivers/input/touchscreen/synaptics_test_rawdata.h
	drivers/input/touchscreen/synaptics_test_rawdata_14001.h
	drivers/leds/led-triggers.c
	drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
	drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c
	drivers/nfc/p61.c
	drivers/power/bq24196-charger.c
	drivers/power/bq27541_fuelgauger.c
	drivers/power/pic1503.c
	drivers/power/pic1508.c
	drivers/power/pic16F1503_fastcg.c
	drivers/power/pic16F1503_fastcg_firmware.h
	drivers/power/pic1823_adapter.c
	drivers/power/qpnp-charger.c
	drivers/slimbus/slim-msm-ngd.c
	drivers/slimbus/slimbus.c
	drivers/video/backlight/lm3630_bl.c
	drivers/video/msm/mdss/mdp3_ctrl.c
	drivers/video/msm/mdss/mdp3_dma.c
	drivers/video/msm/mdss/mdp3_hwio.h
	drivers/video/msm/mdss/mdss_dsi.c
	drivers/video/msm/mdss/mdss_dsi_panel.c
	drivers/video/msm/mdss/mdss_fb.c
	drivers/video/msm/mdss/mdss_mdp.h
	drivers/video/msm/mdss/mdss_mdp_ctl.c
	drivers/video/msm/mdss/mdss_mdp_overlay.c
	drivers/video/msm/mdss/mdss_mdp_pp.c
	drivers/video/msm/mdss/mdss_mdp_rotator.c
	fs/exfat/exfat_super.c
	include/linux/msm_mdp.h
	include/linux/qpnp-charger.h
	include/linux/slimbus/slimbus.h
	include/sound/q6adm-v2.h
	include/sound/q6asm-v2.h
	include/sound/q6audio-v2.h
	kernel/printk.c
	sound/soc/codecs/wcd9320.c
	sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h
	sound/soc/msm/qdsp6v2/q6adm.c
	sound/soc/msm/qdsp6v2/q6asm.c
	sound/soc/msm/qdsp6v2/q6voice.c
	sound/soc/msm/qdsp6v2/rtac.c

Change-Id: I762518d3d189eb383f08e3a2de124e3c21b85fb1
add new files

Conflicts:
	arch/arm/boot/dts/dsi-panel-jdi-dualmipi0-cmd.dtsi
	arch/arm/boot/dts/dsi-panel-jdi-dualmipi1-cmd.dtsi

Change-Id: I70740a998671c47915991530fdc5c8de63bade94
ARM: dts: msm: Update device tree node for audio

Rename properties and compatible strings to return to the old
naming convention.

Change-Id: Ia58df9c4084e4d570d487aff1138522d3b862a58
Signed-off-by: Kumar Gala <galak@codeaurora.org>
stereo call recording support

Patch that allows for call recording in
stereo (left channel: TX; right channel:
RX). Tested on Nexus 5 (MSM8974). Likely
works on other recent MSM chipsets as
well.

Change-Id: I3dd14f99f17106e0e16a8cdb4a951dc8a4aaea63