mmc: core: fix block request queue hang during data crc errors

When data CRC errors occur during write transactions, mmc
block layer queries the card for successful writes. If the card
reports bytes requested as bytes successfully written, the mmc
block layer will end the request with blk_end_request(). If there
is a following async request pending for execution, the request
is thrown away while handling CRC errors leading to hang in
request queue. The hang is visible when user issues a sync()
system call.

The sequence of events are as follows -

mmcqd -> fetch a request -> send it to host driver -> fetch another
request -> wait for previous request to complete -> previous request
is in error -> skip sending current request to host driver and
do error handling for previous request in error.

During the last step, after error handling is completed the mmc
block layer does not requeue the current request which is skipped
and hence the request is infinitely stuck in the driver.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mmc: card: quirk: disable cache for Hynix card

This change prevents enabling cache during card init for Hynix cards.
This change is workaround the problem of Hynix cards behavior for
adb reboot flow, when as a result of power cycle with cache enabled,
ext4 journal get aborted, because of meta data corruption.

Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mmc: core: Fix disabling of cache for Hynix cards

Commit f53e18514e11617c7111e0c8549a44077ab51e6c (mmc: card: quirk: disable cache for Hynix card)
claims to disable cache because of data corruption issues when cache
it is enabled. In reality, the patch allows enabling of cache during
card initialization but disallow flushing of cache during suspend or
file system sync operations. This is more dangerous than without
the commit. Move the fixups for disabling cache to mmc_fixups so as
to enable the quirk during initialization itself. Also, remove obvious
warnings everytime card is initialized during runtime resume.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mmc: core: get drive types supported by eMMC cards

Get the various drive types other than the default supported
by the card.

Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add routing controls from MM6 to MM8 to MI2S_RX_AUDIO

Add the routing between QUAT_MI2S_RX and Multimedia6-8 for
multi tunnel playback.

Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: update default channel mapping

- Update default 5.1 and 7.1 channel mapping in q6adm.c
  for compress offload multi-channel playback.
- Update default 5.1 and 7.1 channel mapping in q6asm.c
  for PCM format multi-channel playback.
- Channel mapping can be overwritten by mixer controls
  passed from user space/HAL.

Signed-off-by: Mingming Yin <mingming@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Fix for incall music delivery on VoLTE

Add support for incall music delivery on VoLTE.
VoLTE session will use the same pseudo port ID
as the voice session, so for port 8005 we start
playback on both voice and VoLTE session.

Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Destroy all CVD sessions after ending VoLTE call

MVM and CVS sessions are not destroyed after ending VoLTE or
CS call. Due to memory limitation on the DSP (only 2 sessions
can be pre-allocated), VoWLAN call will fail if attempted
after one CS call and one VoLTE call. To resolve this memory
limitation, changes made to destroy MVM and CVS sessions at
the end of VoLTE call.

Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add G711 media type support for Voip call

G711 is currently not supported in the Voip driver.
Add G711 media type to existing Voip driver.

Signed-off-by: Prashanth Reddy <pgreddy@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add new MultiMedia9 Frontend

Add a new frontend MultiMedia9 that can
be used by incall music delivery.

Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add FE DAI for QCHAT

Add a front-end DAI for QCHAT voice session. This is needed
to support exclusive voice session for QCHAT.

Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add support for Multisession ADSP SVA

SVA feature is used for user voice recognition and
activation. SVA can support multiple session on ADSP.
Curently upto 8 session are supported for SVA. This
change adds support for multiple sessions for SVA
in audio driver.

Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Add switch for primary mi2s hostless playback

Add switch widget to route hostless playback to primary mi2s
backend to support voip loopback test or FM.

Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: Add support for VoWLAN

Add a front-end DAI for VoWLAN voice session,
update routing driver to add support for voice
over WLAN.

Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: Remove constraints for MI2S interface

MI2S supports programming of serial data line to either Tx
or Rx direction. However, once MI2S is activated, sample
rate and bitwidth on all serial data lines must be the same.
Currently, constraint list is imposed once one direction of
MI2S is started to ensure the other direction is configured
with same sample rate and bitwidth. Unfortunately, it was
found that even though MI2S CPU DAIs are used as back-ends,
the constraint list is also applied on the front-end. This
results in hardware parameter set failure when application
tries to enable front-end PCM device with different hardware
parameter. To avoid this problem, the decision is not to impose
constraint list but simply check for sample rate and bitwidth
on CPU DAI matching other running CPU DAI on the same MI2S.

Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdspv2: Add hw_free for mi2s backend

In the current driver we did not implement hw_free callback.
During stability test, hw_params is called twice without shutdown
and startup due to this there is mismatch in hw_params.
In this case hw_free is trigerred, so implement hw_free and if
hw_free is called take appropriate action in hw_params.

Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
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.

Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: add support for device mute

Add support for muting the RX and TX devices without affecting
the voice stream. This feature is added to aid in voice call
quality testing.

Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
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.

Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: add support for dynamic TTY mode change

DSP supports enabling/disabling and changing between TTY modes
while a call is already ongoing. Add support in voice drivers
to enable and switch between different TTY modes.

Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>