Revert "mmc: core: enable async suspend"

This reverts commit 2dfebf0d1e7197b9b0fb05fe9715889972f29422.
Slim_ngd: Don't create the device node per SSR

Observe the device crash due to the device node
gets created per ADSP SSR when the logical address
query succeeds at the first attempt.
This patch makes sure that the device node creation
happened only once  by declaring another variable to
track the logical address retry.

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
slim_ngd: notify slaves in some MDM restart scenarios

If MDM restarts when it had active framer, bus may lose sync.
Send device-down notification if that happens, and corresponding
reset-device and device-up notifications to slaves so that they
can act to restore their devices' communication over slimbus

Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm-slim-ngd: Read configurable external modem identifier

When an external modem is used, read the config from dt and use the
value in subsystem restart callback registration.

Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
slim_msm: Handle external-modem shutdown differently than restart

External modem may shutdown in cases other than subsystem-restart.
In that case, the power-up notification may not happen.
Handle such a scenario and make sure runtime-pm vote is not held
for more time than required, and that slave-device up/down/reset
notifications happen as expected if slimbus was down.

Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
slim_msm_ngd: Add IPC logging support

Add IPC logging support for improved debugging
per device, and in memory to avoid using kernel
dmesg logs.

Logs are captured in four levels.
1) error level ---> All fatal errors are logged
2) warn level  ---> error level logs +
Warning messages are logged
3) Info level  ---> Error level +
warn level + the required information
for debugging is logged
4) Debug level ----> error level + warn level +
info level logs + extra information
for debugging are logged

Procedure to change the debug level at runtime:
==============================================
cd sys/devices/ctrl_num(eg:1234).slim
echo <log_level> > debug_mask

Procedure to collect the logs at run time:
=========================================
adb shell cat sys/kernel/debug/ipc_logging/ctrl_num.slim/log_cont
|tee slimbus.txt

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@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.

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: WCD9306: Add AANC support to wcd9306

Send the DSP commands to inform the DSP about the slimbus
address, codec registers and AANC version. DSP will use
this information to write to adaptive gain that it
determines from the AANC algorithm to the correct
codec register.

Signed-off-by: Damir Didjusto <damird@codeaurora.org>
[neo: Only required parts for wcd9320]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Close MICB 4 leakage path

There is leakage from MICB 4 to CDC_IN_MBHC which has a weak pull up.
Therefore there is a possibility of having false interrupt when LDO is on.
Close this leakage path by pulling up micbias 4 to VDDIO to prevent false
IRQ.

Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm-hdmi-codec-rx: sync state with HDMI core

To keep the state of the HDMI core and HDMI audio
sessions congruent, audio checks the state of the
core on startup, then notifies the core of the
active audio session.  On shutdown, notifies the
core of the event.

Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm-hdmi-codec-rx: sync state with HDMI core

To keep the state of the HDMI core and HDMI audio
sessions congruent, audio checks the state of the
core on startup, then notifies the core of the
active audio session.  On shutdown, notifies the
core of the event.

Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx :Modify detection of Euro Headset

Detect the cable as EU Headset only if below conditions met.
1.Plug types for 1st, 2nd, 4th are consistent and equal to HEADSET.
2.Delta b/w 1st, 2nd, 4th is not more than WCD9XXX_CS_MEAS_DELTA_MAX_MV.
3.Plug type of the 3rd measurement is HEADPHONE.
4.Don't consider the status of HPHL.

Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm8x10-wcd: Enable impedance detection

Add support to compute impedance of the headphone left and right
impedance.  Once impedance is known the codec parameters can be adjusted
to increase the efficiency of audio output to headphones. Impedance
detection is disabled by default and can be enabled at runtime through
module parameter.

Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
[neo: Only the required parts for wcd9320]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: Added gpio for ddc mux selection

Added a gpio for Display Data Channel (ddc) mux selection.

Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: hdcp encryption enablement

For hdmi as primary case, enable encryption after
hdcp authentication passes. That is to avoid black
screen before authentication finishes.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: turn on DDC when turn on hdmi

When HDMI is primary and at display timeout, DDC is turned off.
When resume, there is no hpd interrupt, need turn on DDC
for HDCP and EDID when turning on HDMI.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: wait for power off

Fast plug out/in of HDMI cable may result in race condition
between power on and off of HDMI tx core when downstream device
or bridge device is connected. Wait for power off to complete,
if already underway, before power on.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: hdmi: HDMI cable connection status and vote

Add HDMI cable connection status functionality to be used by
audio driver before starting the audio session and vote for
hdmi tx core to remain power on until the audio has completed
its processing.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoc: msm: Always use MBHC detection

* Remove LGE workaround and make use of CAF implementation.
* Tested on hammerhead.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: vidc: Decrease the size of decoder compressed buffer

Currently decoder compressed input buffers are allocated for
4K YUV size. This needs lot of memory. In all other chipsets
compressed size is half of the maximum supported resolution.
This change make the size similar to all other targets.

Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>