msm: Increase start voice command timeout

Start voice command timeout is exceeding 300ms
on ADSP.BF.2.2. Increase it to 500ms to avoid
timeout errors.

CRs-fixed: 681025

Change-Id: I940a55a6cd8444ea3ff6fdba0576d7a1f7e8d98c
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
msm: mdss: DSI read support for more than 2 bytes

Support more than 2 bytes DSI read for DSI v2 driver.

Change-Id: Ie1b1a7990aed6944036ce82cf4202472604e8e87
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
NFC: Add error handling to i2c access

This patch adds error handling to each i2c access
Furthermore, the timeout for the wake status
register of the nfcc is increased to cover corner cases.

CRs-Fixed: 765256
Change-Id: Ia8f99a89ec2e107dde4256f4afb24b461b50540a
Signed-off-by: Nakul Kadannavar <nakulk@codeaurora.org>
msm: camera: add check for csid_cid to prevent of overwrite memory

add sanity check for csid cid to ensute that we never read or write
outside csid_dev->mem buffer

Change-Id: Ic8f0d689fa176720ae3a3316f2ad27556ae7bde5
Signed-off-by: Suman Mukherjee <sumam@codeaurora.org>
msm: mdss: refactor ping pong completion logic

Replace completion structures with waitq, and track the completion of
ping pong transfer with a single kickoff count variable. This prevents
race conditions when using completion structure and provides a cleaner
way to identify whether wait is required.

Change-Id: Iebb8077d520649db427470fc4963d892967a920c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@qti.qualcomm.com>
msm: mdss: Correct RGB order for LUT programming in mdp3

MDP3 LUT programming has incorrect RGB order as per HW. The
correct order is to have color0 for green, color1 for red
and color2 for blue. Correcting the order in mdp3.

Change-Id: Ie7b6ab7f83e18495e83a05102e288fee6841e3ab
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: disable read pointer interrupt during suspend always

During suspend, for command mode panels, we currently disable the
read pointer interrupt and set rdptr_enabled variable to '0' during
timeout cases only if panel is in bad state. We need to perform this
independent of panel state since the DSI clocks needs to be disabled
during suspend always.

Change-Id: I6363fa5a260d26c07b6eff508982c91c51713f29
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: add LP/HS mode DCS CMD support to MDP5 targets

LP/HS mode configuration for DCS Commands in currently not
supported on MDP5 targets. Add the required support to meet
all panel requirements.

Change-Id: Ib31ddc02f151033a59d6297c8f1a4f8897378947
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
 SoC: msm: Add Buffer overflow check

The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.

CRs-Fixed: 563086
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
(cherry picked from commit 7e09949355b2dac9aac8bb414037ccaca3c68d86)
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>

Change-Id: I4da774740c71b97dc2e4fd16c78bf065ad457690
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ASoC: msm: qdsp6v2: add check for NULL dereference

The asm loopback driver 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: I698d8fb75ce838635ed6dd70eedb6b509b9fcec6
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Signed-off-by: Pradosh Das <c_prados@qti.qualcomm.com>
ngd_slim: Fix return paths in transfer function

Return right away if resume fails when runtime-pm is not
enabled. Consolidate return paths if controller power-on
vote fails when runtime-pm is enabled.

CRs-Fixed: 677689
Change-Id: Ia8887dd87df6dba4f93638650794bfcdc7d1ff75
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_msm: support non-blocking writes from slimbus MSM controller

Provide non-blocking write support so that clients can queue multiple
writes, or larger transfers without performance implications.
TX buffer is created and descriptors out of this buffer
are submitted to HW to transmit data.
Descriptor is returned to 'available' pool of TX buffer when HW
interrupt for transmission status is recieved.

Change-Id: Icc2af6bf4f770c8cadb9bd2ef7be0f95eb22c5d8
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
ngd_slim: Ignore pm_runtime_get error when runtime-pm is not enabled

Controller power-up uses different code-path when runtime-pm is not
enabled.

Change-Id: Ibe2f119fd8f43edb657f8f623879dea4730811f4
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_ngd: Use DSP before-shutdown notification for DSP SSR

QMI_SERVER_EXIT notification comes too late (after the DSP has
shutdown). This can result in unclocked access by BAM if there was
in-flight transaction. Use BEFORE_SHUTDOWN notification of SSR
framework instead to make sure in-flight transaction is finished
before DSP turns off its resources.

CRs-Fixed: 730552
Change-Id: If3c2787c74ffa7743772e5e37eac2f768e239050
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
slim_ngd: Ensure device state consistency with runtime-pm during SSR

During ADSP SSR, client's thread calling runtime-pm resume will
fail since ADSP is unreachable. Make sure such power-up/resume attempt
is blocked until ADSP comes up by using mutex during device-state
transition.

Change-Id: Ie85e52bb2974aaee9654eb8fa1cc60fe37c61b75
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>