ASoC: msm: qdsp6v2: requeue read buffers in mmap device switch

When device switch happens, ASM might return a 0 length
buffer. For MMAP style capture cases, buffers need to be
re-queued at the event handler for this case, otherwise
ASM will have no buffers to read data into after the
device is over successful.

CRs-fixed: 700614
Change-Id: I2b8930a3058bbe3979405d5de04d3371291db42d
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: msm: audio-effects: improve logging

Make logs more meaningful by logging values where ever
applicable.

Change-Id: I0fd0e62e543480762096d64c7ee7c92eb1204126
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
ASoC: msm: qdsp6v2: Fix bit alignment in snd_codec params

Pointer member variables in snd_codec params break bit alignment and
causes data corruption. By changing these pointers to fixed size
array variables, the bit alignment is rectified. The size has been
set to max possible size. Also, remove params which are not required
anymore.

Change-Id: Ib87bbeb07b0df1ce8a81166b319976fe54c0f013
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
ASoC: msm: qdsp6v2: Add the matrix mixer call during ASM loopback

Add support for matrix mixer command. The render window start and
end are set up before RUN CMD for ASM loopback is issued. This
will ensure that audio data is not dropped and audio quality
is good.

CRs-fixed: 667925
Change-Id: I406d86e9805d9f57613c0349f11cfc729ef7a24c
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: qdsp6v2: Cleanup of audio drivers

Using the format strings will remove need for typecasting.
This change cleans up audio msm drivers to use the kernel
defined data types and format specifiers for printk.

Change-Id: Ie1b3d5c8dcf868aa1cc7407d3e679976dffafc76
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: msm: qdsp6v2: Cleanup of compress offload drivers

Clean up the format specifiers for compress offload drivers
and add compat ioctl support

Change-Id: I0829830336ec62c66658d6a5199d73b61249f791
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: qdsp6v2: update perf mode flag for LL capture cases

Read perf mode flag from platform data and update to the
audio client structure, so that the right settings can be
applied to ADM for Low-latency capture use-case.
Also, update the correct bit value for ASM perf mode flag
sent to DSP.

Change-Id: If1f8b9e657a409fd9d2af19ff004a797fd987788
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: msm: q6dspv2: add pause/resume support for audio record

Add support for pause/resume functionality for audio capture
path. When application calls stop()for for pausing, suspend
the ASM stream, so that hardware resources can be released.
Again when resuming capture streams with prepare()->start(),
ASM open and the routing call should not be called again.

CRs-fixed: 692084
Change-Id: I59e014696ab0a8c473b87361ac9b739adf538d32
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: wcd9320: Fix micbias setting for MAD

For Microphone Activity Detection (MAD) to work properly, it is required
to update the micbias setting correctly to indicate the micbias is
external or internal. Correct the MAD micbias settings to account for
type of micbias (internal or external).

CRs-fixed: 684818
Change-Id: If209f9e4ad971a25fd28848ba7ba297c4f3dbf06
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: msm: qdsp6v2: Change client names for ion alloc

ASM and AFE are using the same client name when requesting
ion alloc. This is making it harder to debug which client
requested the memory.  Changing the client names to more
descriptive names.

CRs-fixed: 714707
Change-Id: Id774ce06ff5300da1de5b653812a02a22a47147c
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: qdsp6v2: update int to size_t

Int aren't same size as size_t in 64bit kernel. This actually cause part of
the stack to be overwritten

Change-Id: I0ebff1fb9030fdb93a6889ee02329599ae2800fb
Signed-off-by: Fred Oh <fred@codeaurora.org>
msm: kgsl: Keep the GPU from going into a slumber after a touch event

If the GPU is on the tail end of the nap period when a new touch event
occurs the system could go into slumber before the first render which
increases the startup latency. If a touch event occurs while in nap
just kick the idle timer back out to the interval timeout - this should
keep the system from transitioning to the lower power state only to
come right back up.

Change-Id: Ic0dedbad07cac877d0a71c69516b7c01841be1bd
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: vidc: Bug fix in instance clean-up

When close is called directly without proper state operations,
then driver tries to clean all V4L2 framework memory. When driver
calls queue_release, it tries to call stream_off again. This
causes driver to re-enter the state operations. This change
prevents driver to re-enter the state diagram.

Change-Id: I6df248792fca78fe743bead311fa1cec61a6bb79
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
qpnp-adc-tm: change vadc channel for external pull-up usb_id

If usb_id is pulled up externally, vadc channel should be
changed to no pull channel for accurate otg cable detection.
Make changes to consider external pull up on usb_id pin.

Change-Id: I448e213ca584713146e99fd00c081a203845741e
Author: jude84.kim <jude84.kim@lge.com>
Signed-off-by: jude84.kim <jude84.kim@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
power: qpnp-adc-voltage: reset adc register to prevent lock-up.

VADC1_USR_INT_LATCHED_STS reg. is "1" which is indicating that the interrupt
has triggerd, not zero, after the specific warm reset scenarios as below
* adb reboot bootloader -> fastboot reboot

On that status, VADC irq does not occur and completion can not be changed
to complete state.  So qpnp_vadc_read func takes over 1 sec.

To solve that, write 0x0F to VADC1_USR_PERPH_RESET_CTL3 register
when v-adc driver shutdown, before starting warm reset.

Change-Id: I00b7083408e000230955c8667964fa1f201d3a12
Signed-off-by: Janghyun Baek <janghyun.baek@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
hwmon: qpnp-adc: fix logical error on parsing adcmap from dt

There is an logical error on parsing adcmap from dt. Due to
this, the calibrated adcmap is not applied and it makes
battery temperature inaccurately.

Change-Id: I210b2b28eea90b9beeea3f949aa2368fb7f43f0d
Signed-off-by: janghyun.baek <janghyun.baek@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
msm: pm: Fix cpu collapse timeout

Looks like caf mismerged. This may fix the following warning:

<4>[  124.983957] ------------[ cut here ]------------
<4>[  124.984381] WARNING: at arch/arm/mach-msm/msm-pm.c:837 msm_pm_wait_cpu_shu
tdown+0x9c/0xb0()
<4>[  124.984661] CPU2 didn't collapse in 2 ms
<4>[  124.984869] [<c010e10c>] (unwind_backtrace+0x0/0x144) from [<c0a1c68c>] (d
ump_stack+0x20/0x24)
<4>[  124.985170] [<c0a1c68c>] (dump_stack+0x20/0x24) from [<c019ab44>] (warn_sl
owpath_common+0x58/0x70)
<4>[  124.985464] [<c019ab44>] (warn_slowpath_common+0x58/0x70) from [<c019abd8>
] (warn_slowpath_fmt+0x40/0x48)
<4>[  124.985943] [<c019abd8>] (warn_slowpath_fmt+0x40/0x48) from [<c0179d30>] (
msm_pm_wait_cpu_shutdown+0x9c/0xb0)
<4>[  124.986287] [<c0179d30>] (msm_pm_wait_cpu_shutdown+0x9c/0xb0) from [<c0126
750>] (platform_cpu_kill+0x38/0x48)
<4>[  124.986591] [<c0126750>] (platform_cpu_kill+0x38/0x48) from [<c010c6fc>] (
__cpu_die+0x4c/0x98)
<4>[  124.986778] [<c010c6fc>] (__cpu_die+0x4c/0x98) from [<c09ee9cc>] (_cpu_dow
n+0xf8/0x2e0)
<4>[  124.987074] [<c09ee9cc>] (_cpu_down+0xf8/0x2e0) from [<c09eec58>] (cpu_dow
n+0x34/0x50)
<4>[  124.987383] [<c09eec58>] (cpu_down+0x34/0x50) from [<c0194250>] (cpu_down_
work+0xc4/0xd8)
<4>[  124.987564] [<c0194250>] (cpu_down_work+0xc4/0xd8) from [<c01b4e44>] (proc
ess_one_work+0x178/0x4f4)
<4>[  124.987861] [<c01b4e44>] (process_one_work+0x178/0x4f4) from [<c01b5540>]
(worker_thread+0x174/0x448)
<4>[  124.988152] [<c01b5540>] (worker_thread+0x174/0x448) from [<c01bb8ac>] (kt
hread+0xb4/0xc0)
<4>[  124.988450] [<c01bb8ac>] (kthread+0xb4/0xc0) from [<c0108060>] (kernel_thr
ead_exit+0x0/0x8)
<4>[  124.988725] ---[ end trace 77427e632785e345 ]---

Change-Id: I40ea4459f333d44b3f1f11ebcec85466a896d974
msm: vidc: avoid setting smoothstreaming for Q6

Smoothstreaming is not a tested functionality on Q6.
This change will return error to all clients trying
to configure Q6 in smoothstreaming mode.

Change-Id: If520d136cd29b3b37759d0fb179538e31b9b71d9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Revert "msm: vidc: Increase max buffers to VB2_MAX_FRAME (i.e. 64)"

This reverts commit 487c076d1d24c4f8dfb366a273286219ea52f584.
msm: vidc: change concealment color

0x8080 is gray color concealment, changing it to
black color, which is 0x8010.

Change-Id: I50897d771913ee33a5b2c2ea486996dfc0c294bf
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>