omni bringup

Change-Id: I534f281dae7fc84488d78b6091ab6a8be0ca11e3
Revert a bunch of sound commits causing audio issues

This reverts commit 841ff1361f277e887fb46b164076df21d2ad4fbc.

Revert "ASoC: msm: Add 24 bit support to Primary MI2S TX"

This reverts commit fc817e67d35067303f9785f1a6a0ebcce98aa13a.

Revert "ALSA: core: Expose sound card online/offline state"

This reverts commit c530ec81947b9da7c77064aae35bcbe1fa0be63b.

Revert "ALSA: core: free card runtime memory"

This reverts commit 4d14402dca30893f78c36cf62b4f5ece02dfc0e2.

Revert "ASoC: core: Use driver core probe deferral"

This reverts commit f669baf8c6f02c0e2c7963ec436345a0e9e2f594.

Revert "ASoC: pcm: Protect FE dai list during dai open/close"

This reverts commit 3dc886b569535aba9bb75aaa7d28194109711189.

Revert "ASoC: wcd9xxx: reinitialize codec irq after subsystem restart"

This reverts commit 883ba8ca055c30bb0b64c40eae27a5d581613307.

Revert "ASoC: wcd9xxx: Update sound card's online/offline state"

This reverts commit a090bd773aa437e1c5a42147caaf61a346ee3520.

Revert "ASoC: wcd9xxx: don't change clock frequency while bandgap/clock are on"

This reverts commit 191382a51cc5ffa2d76913796845f197f44c3c14.

Revert "ASoC: wcd9xxx: don't acquire BCL from codec driver"

This reverts commit 6a6be79074fa494d0b53f7e65be5587564d8552f.

Revert "ASoC: wcd9xxx: don't clear pending mbhc interrupt"

This reverts commit 7b37bab8cffc9540d2e44e14dc7ff897c57cb406.

Revert "ASoC: wcd9xxx: Reset Tapan codec post adsp subsystem restart"

This reverts commit 5d83d83aa03fccb20fa84ea1b87dafcef81e9cbc.

Revert "ASoC: wcd9xxx: use separate mutex for bandgap and clock get/put"

This reverts commit 58504973a54b0d217dc6321384ab7df088008fb3.

Revert "ASoC: wcd9320: Update headphone static gain in companding mode"

This reverts commit 6282d8e40572ac0d3cd15728c67a101bb9807058.

Revert "ASoC: wcd9xxx: don't wait for mic volage to settle"

This reverts commit 7f426aed8d772055473ff9c005201dfa917ad11b.

Revert "ASoC: msm8x10-wcd: Add the internal bias for mic1"

This reverts commit 3e5c7fdbe36ea5d8d4b4645835c630162707f566.

Revert "gcc 4.7 cleanups"

This reverts commit cecf57151c2d99581feab4be7942e318c028cfe2.

Revert "ASoC: wcd9320: Add support for notification of codec events"

This reverts commit cd0bfae320842598b2791549f918b043e84ae237.

Revert "ASoC: usb: change uevent value to digital USB HEADSET"

This reverts commit 713f7ff9b84a4aaf2c0b2bc0d3cad5bb49dd1bd0.

Revert "mdss: hdmi: Dynamic Audio re-configuration"

This reverts commit 94489edae9b9e696d63ca9f8d989cd0302a49904.

Revert "ASoC: msm: Route low latency frontend to in-call music backend"

This reverts commit 7bde214931e2490353f049908e9f867cbe128c99.

Revert "ASoC: msm: change to enable audio"

This reverts commit ef79d9e7d4f5b61adccce089b2f5f014a881dc55.

Revert "ASoC: msm: flush if prior and current backends rate not matching"

This reverts commit ba4f87b3e77d5dae0e65614a09c025736cd0775c.

Revert "ASoC: msm: Add support for ASM loopback"

This reverts commit 7346f08577be678315377da8db1de526fe925994.

Revert "ASoC: msm: Add support for RTAC version 1.1"

This reverts commit 57f3efe6b539f2dcf4ffd076a71255b56f7881bb.

Revert "ASoC: msm: qdsp6v2: Fix APR de-register issues during session close"

This reverts commit 2a8300a992b54bfbcc2ed80be264b3aa510244d4.

Revert "ASoC: msm: qdsp6v2: Handle SSR for audio playback over BT usecase"

This reverts commit 2d7f3afbad042a5e6ff877d8341533fee97eb7b9.

Revert "msm: qdsp6v2: Buffer address for Record and playback is 32-byte aligned."

This reverts commit 5ab0fb9c59227fffcf6c3b0c7d892a1c7c667b4e.

Revert "ASoC: msm: qdsp6v2: Set ADM channel to max supported for ULL"

This reverts commit 9ed77b1ea4ec29580b0a0a345ebf1608ba569eab.

Revert "ASoC: msm: qdsp6v2: Don't update state variables for no-wait commands"

This reverts commit b45aa557c8fe5fbd95f925e1aaf4a4015a604339.

Revert "ASoC: msm: qdsp6v2: Set ADM sample rate to 48Khz for ULL"

This reverts commit 9fd10f615637a96f625337109d82fedcab548fc8.

Revert "ASoC: msm: Fix playback failure on device switch during ULL playback"

This reverts commit 4f689e8249bb33f0520ffcd31b650cbc78677cee.

Revert "ASoC :msm: Increase Proxy buffering"

This reverts commit 635e0978af4ca0b76286bfe99c44a32ff3719416.

Revert "ASoC: Compress: Check and set pcm_new driver op"

This reverts commit 96140beb6ab697a48bd9b66baa3103c9df000c5c.

Revert "msm: usbaudio: Add check for NULL before dereferencing"

This reverts commit e1ecd03281446c72f4bbb51a0a1a700934a01a85.

Revert "ALSA: core: Fix crash by avoiding appl_ptr crossing 32-bit boundary"

This reverts commit 8705c7ce5bf7a5f7e634f65cdda967cd64f2f98c.

Revert "ALSA: pcm: check for integer overflow during multiplication"

This reverts commit 17e3d611b2878637f6e6bc8e969712bb1955c7cf.

Revert "ALSA: compress: Memset timestamp structure to zero."

This reverts commit 38b643a639666279192cf50fb0b37d3f7ed384c3.

Revert "ASoC: msm: Do not allow commands during gapless transition."

This reverts commit cc653438662a01b3778a29d003732d763c911ccd.

Revert "ASoC: msm: Disable gapless offload playback by default"

This reverts commit 3e090061506268bb221afb0edbf947c2737abe97.

Revert "ASoC: msm: Handle RESET_EVENTS in compress driver"

This reverts commit bf5a831722aad767eb1f4fdd1f02b7700c6b9136.

Revert "ASoC: msm: Enable initial/trailing silence removal"

This reverts commit cb9277527405b88329225b928f7287dc3fdc8fd0.

Revert "ASoC: msm: Add playback support for AC3/EC3 in compress driver"

This reverts commit 0e9f942f9b7d6e87f2f6af130207240eadd28cb4.

Revert "ASoC: msm: Add support to enable audio post processing in DSP"

This reverts commit d3f921035fee5de8b59771bc23b54e65c8e9a581.

Revert "ASoC: qdsp6: Add support for audio post processing effects"

This reverts commit e240da274e4118611cde97e2cba7cc2323f8f05a.

Revert "ASoC: qdsp6: Add support for custom topology"

This reverts commit 3b15103c4e9fd7a0b19f34a87cce593a2d785505.

Revert "ASoC: msm: Add support for gapless audio playback"

This reverts commit e1a4aed5148f625e2a0861a40541b43ae9889ab9.

Revert "ASoc: msm: qdsp6: Add ultra low latency playback support"

This reverts commit 6a1e16ea828516b686a5a0c27bb8aa5de1c94119.

ASoC: msm: qdsp6v2: fix the crash issues due to NULL pointer

If adsp subsystem restart happens, ac and apr handles are not valid
any more. While recovering subsystem restart and reassign proper
handles protection from accessing NULL pointer is required.

CRs-fixed: 513414
Change-Id: Idb60d3504a37c0de708846a4f8517f9d75eb9078
Signed-off-by: Fred Oh <fred@codeaurora.org>

audio: Remove sound upstream, fix build, clean some leftovers

Change-Id: I38a199600604bf5bf394555a76b551d82cc6674a
msm8974: make it omni

Change-Id: I8ab311c6679541b61d29b9c7e912c7279e2b2c19
msm: pil-q6v5-mss: Set the force stop bit and wait for ack when necessary

The force stop bit can be used to indicate to the modem to dump its memory
and stop execution. The dumped memory can then be used for debugging
purposes.

This should be done under the following circumstances:

1. When the application processor panics, we need the modem image to stop
execution and dump its memory for future analysis. Setting the force stop
bit achieves this. But in this scenario use a timeout and do not wait for
the acknowledgement from the modem because all interrupts would be disabled
in the application processor.

2. When an SSR is being performed on the modem as part of a group of
subsystems where the SSR is not a direct result of the modem crashing but
because of any other subsystem in the group. In this case, dumping the
modem memory can help debug if there were any interdependencies between
the subsystems in the group which led to the SSR.

3. When an independent SSR is being performed where the modem doesn't
detect an error (and hence doesn't flush its buffer on its own) but a
client running on the application processor detects an error. The memory
dump then could lead to finding the cause of the error.

In cases 2 and 3, wait for the force stop acknowledgement from the modem
before proceeding further.

Change-Id: I816b53fb961adf93943893793e38254cb8bfcde1
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
wcnss: Add API to expose the IRIS XO mode set

IRIS XO mode can be configured thru module parameter; and it can also
be auto detected. Add an API to expose the IRIS XO mode set. WLAN driver
can use this API for it's XO specific operation.

Change-Id: If40ae715f5e400e13a6fc9588d2bd144958ee8c2
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: pil: Proxy unvote after pil_shutdown() when using IRQs

Subsystems might use an IRQ for removal of proxy votes via the
power/clock ready interrupt. So, if a peripheral shutdown is triggered
before the power/clock ready interrupt is received, remove the proxy
votes and bypass the unvoting in the power/clock ready interrupt handler.
Conversely, if the power/clock interrupt is received before shutdown is
triggered, bypass the unvoting during pil shutdown.

Also, remove the hack to proxy unvote directly from the pil-q6v5-mss
driver.

Change-Id: I254ab5a1595ceb27a2cfcac99c4c1d2f2443b7c7
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil-q6v5-mss: Factor out PIL code into a separate library.

pil-q6v5-mss.c contains code for both the PIL and subsystem
implementations. Factor out the PIL specific code into a
pil-msa.c library so it can be reused by other subsystems
which use the same/similar self-authentication mechanisms.

Change-Id: I7e27eafbd2c89c2747482f1162e7b28d9e5f7bca
Acked-by: Jennifer Zenner <jzenner@qti.qualcomm.com>
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil-q6v5-mss: Get smem reason buffer without taking remote spinlock

During a subsystem restart the modem might have crashed after taking the
remote spinlock. In such a case, when application processor tries to get
the smem entry for the SFR log, it would wait indefinitely for the remote
spinlock to be released. To solve this problem, use the smem API that
gets the entry buffer without taking the remote spinlock.

Change-Id: I00e77472bc88e276afb20835bdc24c5da09b9e86
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil-q6v5-mss: Do not generate redundant smem ramdump

When the device crashes, smem ramdump is already generated by the smem
driver. Therefore, the smem ramdump generated by pil-q6v5-mss is redundant
and the code responsible for it can be taken out.

CRs-fixed: 485208
Change-Id: I8b67ff9f54663b68268b7b87e9cb1f3930219afa
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil-q6v5-mss: Initialize the stop ack completion variable

In case of targets that don't use the PIL framework to boot the modem,
the stop_ack completion variable might remain in uninitialized state as
the initialization is currently being done only within PIL callbacks.
So, fix this my initializing the completion variable outside of PIL
by callbacks.

Change-Id: I204b0fbf461b1e1f1d4576dc43e33c7442eaf0e0
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
wcnss: pil-pronto: Add register dump to bite handler

Log a number of WCNSS registers when there is a bite from it; these
register dumps will help for root causing the bite at WCNSS. The
register dump will not be taken when common_ss is power collapsed, that
protection is already added to the dump routine.

Change-Id: I9cc6c539b0efe9d0dc3d51949f9c9557c746bd61
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: pil-q6v5-mss: Perform proxy voting/unvoting at mba bootup

Currently, both mba and q6 devices perform voting and unvoting during
bootup via pil. This is done because earlier the clock ready interrupt was
not provided by the modem booting up. But now that we have the clock ready
interrupt being sent by the modem, we can make the proxy votes for the PBL
while booting up. Later when the modem has finished booting up it would
send the clock ready interrupt and at that time we would remove the proxy
votes made for the PBL. So remove the PBL proxy votes after receiving the
clock ready interrupt from the modem.

Also, having IRQF_SHARED in the proxy unvote IRQ registration is
unnecessary because the the power/clock ready interrupt is not shared
among subsystems. So remove that as well.

Change-Id: Ie6ec27f6842c42c4240a9f09f8f49a190ab3c2f9
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: scm-pas: Flush the metadata buffer

In the near future, scm_call will no longer flush
the entire cache in order to ensure that the secure
world doesn't see stale data. Therefore, flush the
metadata buffer from the cache before invoking
scm_call.

Change-Id: I0896d1bac074b6a4b004edfc1cb0a9a8de57999b
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: socinfo: Add support for MSM8974PRO AA/AB/AC

Update the SoC ID mapping table and create cpu_is functions
to support the MSM8974PRO AA/AB/AC targets.

Change-Id: I0e9dfdb22462c68c7bc18edd5ef025f42760be06
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
msm: scm-pas: Remove cpu_is_* checks

The soc type check is included in scm_pas_init in order to assign
different source port IDs to the bus bandwidth voting vectors.
The check is removed by making scm_pas_init a function to which
the source port ID is passed in as a parameter. This change assumes
that the destination port remains the same across all SOCs. The
scm_pas_init function is invoked from individual pil drivers.

Change-Id: I7472d07ae560a16d2fd03b184e340e56a62985d2
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
msm: subsystem_restart: Move device tree parsing code into the framework

Every driver has to repeat the code for parsing device tree nodes for the
SMP2P gpios. So, move this parsing code into the framework level to avoid
this duplication of code.

Change-Id: Ie27a5f37ce2b9718a5cc0ccf11c7abda1c6cb1df
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil: Move device tree parsing code into the framework

Every driver has to repeat the code for parsing device tree nodes for the
proxy unvote IRQ. So, move this parsing code into the framework level to
avoid this duplication of code.

Change-Id: I8739af63f6f3bc95aaded74d60359256e5bd7a66
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
msm: pil-q6v5-mss: Correct kzalloc return path checking

devm_kzalloc returns NULL on failure, not an error code.
Fix the check done on mba_data after the allocation.

Change-Id: Ie7a75d8864889f0426a7f3fb54908e4869a719a8
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: pil-venus: Move the GDSC control out of PIL driver

The PIL driver has full control of the Venus GDSC. It turns
on the GDSC when booting up venus and leaves it on until
venus is shutdown.

In order to save more power during video playback, interframe
power collapse can be used. This requires that the GDSC can be
turned on/off during video playback.

In order to allow the Venus driver to turn on/off the GDSC, the
PIL driver should no longer hold the GDSC on throughout the time
Venus is booted up. It is safe to do so since the Venus driver
has already added GDSC control.

Note that the proxy voting of GDSC is still present solely for
the purpose of allowing standalone testing of the Venus PIL
driver.

Change-Id: I49b7331d4ec40c08b1eba0a72942564899ca4b8f
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
msm: pil-venus: Decrease the proxy time out value

A smaller value of proxy time out (2 sec) is good enough for venus
driver to take over the control of the proxy voting resources.

Making proxy time out smaller also has the advantage that the venus
driver can do power collapse of the core sooner if needed to save
power.

Change-Id: I9bc1824de4817a565c908d5d7b8b61356d38d168
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>