ASoC: update drivers to handle errors correctly

Avoid logical conflicts seen while error handling.

Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: fix the hph and lineout concurrency

There was a noise observed during the concurrency of the
hph and the lineout usecase.
This is due to incorrect register value updates in the concurrencies.
Update the register values as per the hw/sw document.

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: spm-v2: Store voltage levels into PMIC_DATA3

On certain targets, where the SPM controls the power supply for each
core, the SPM power down sequence takes care of restoring the Voltage
level after a power collapse to the appropriate sleep level. The active
voltage level is stored in the PMIC_DATA_3 register and SPM state
machine uses the data in this register to restore the voltage to the
current active level.

Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: spm-v2: Flush the PMIC_DATA registers

Different versions of SAW use different PMIC_DATA registers to
save the current voltage, which is used to restore voltage when
exiting low power modes. Flush the appropriate PMIC_DATA registers
depending on the SAW versions.

Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: spm-v2: Use proper register offsets for SAW2_v3.0

Current code get the register offsets for SAW2 based
on hardcode macros. Use SAW2 major, minor numbers to
get the proper register offsets to different versions
of SAW2 controllers(i.e: SAW2_v2.1 and SAW2_v3.0) and
this patch remove the SAW2_v1.1 controller related code.

Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: spm: set pc mode bit for SAW2_3.0

Set the power collapse bitin SAW2_SPM_CTL register.
This bit is used to differentiate other low power modes
from power collapse mode. This information is used for
contolling DBGWRDUP input signal. If PC_MODE is set DBGPWRDUP
signal is de-asserted as soon as SPM_WAIT_ACK becomes HIGH.
When the PC mode is not set it will help in early exit from
clock gating.

Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: spm: Update msm_spm_turn_on_cpu_rail() to use new SAW2 base address

Update the msm_spm_turn_on_cpu_rail() to use SAW2 base addresses passed
from the release_secondary to turn on the cpu rail, before bringing back
the cpu online.

Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: ocmem: Add support for driver probe deferral

If a driver which needs to be probed before the ocmem
driver returns a EPROBE_DEFER, then the successive probe
of the ocmem driver will fail. Add support for probe
deferral in the ocmem driver.

Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: wfd: Add timeouts to completions

In the case of Venus going into a bad state and not returning buffers,
timeout of the completion so that the driver isn't stuck perpetually
waiting for a buffer.  This at least gives the driver a chance to clean
up and exit gracefully.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: wfd: Lock the state in vsg_start

Protect the state in vsg_start with a mutex as it can be accessed from
other threads.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: wfd: Modify enc_avg_latency to only measure the encode latency

Previously enc_avg_latency measured the time Video code took took to
encode a frame and the latency of the userspace client in picking up the
buffer.  Change the meaning just to measure encoder busy time.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: vidc: Free memory allocated to keep track of buffer ownership

Memory for free_output_indices and free_input_indices was never freed.
This commit kfrees the memory as part of venc_close().

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: wfd: paddr cannot be null

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: wfd:Wait for one more vsync cycle, if VSG running out of
 input frames

If VSG running out of input frames, it will re-encode previous frames.
With this change, instead of encoding pervious frame VSG will push timer to
half of capturing frame rate. If it find new frame, it will be encoded
Otherwise will re-encode previous frame.

Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
mmc: card: quirk: disable HPI for Kingston card

Certain Kingston eMMC 4.41 cards might get broken when HPI feature.
This quirk will disable the HPI feature for such buggy cards.

There are features depending on HPI, the change will disable them:
- BKOPS support
- stop transmission flow
- CACHE_CTRL

Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
MMC: Sync missing device_enable_async_suspend for MMC_BLOCK_DEFERRED_RESUME
MMC: After i have seen that deferred resume is working, no need to log.
Revert "crypto: msm: re-work qcrypto driver clk and bus management"

In recent report, qcrypto is failing to suspend due to this change.
Let's revert until more fixes are done by CAF.

This reverts commit e7133d4ada22831413f72566e0307aeff90a3219.
MMC: disable MMC_BLOCK_DEFERRED_RESUME, LG has other system.
Revert "mmc: sdhci-msm: add sdio wakeup support"

This reverts commit 4923313ef8e9ce0e4bb9d42f5a59e3d790fac56b.