Fix SWR cmd FIFO overflow error.
In 5.4 kernel there are few additional register writes added in soundwire driver,
one of the register(SWRS_DP_SAMPLE_CONTROL_2_BANK) write is causing overflow error.
Change-Id: I31f4855af52b24ceac53f55010ce1935c3bc1ea6
Signed-off-by: Shuai Zhang <quic_shuzhan@quicinc.com>
snd_event_dlkm is loaded as the first module.
Add init function and place mark in it to indicate the
start time of audio driver initialization.
Change-Id: Ie0c85b9166686d91f71ff773224eca59d85a36e5
Signed-off-by: Hongtao Peng <hongtaop@codeaurora.org>
Both APSS and ADSP are accessing CPU-0 FIFO when CPS is enabled
during speaker playback. This causes underflow issue when accessing
wsa register from APSS. Move APSS to CPU-1 FIFO to resolve underflow
issue.
Change-Id: I5ed9143bc78757468fbe4bcc686196149ca521f2
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Add support to use 4p8MHz DAC rate for receiver
over WSA.
Change-Id: Ia0811670326be8131687fbdff70464da063902b2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Register SWRM_DP_PORT_CTRL_BANK only has sample interval low.
When disconnecting swr port, only update sampleinterval low for
active port.
Change-Id: Iec7c266fce76ce140a43f9e410126ad5560f5b81
Signed-off-by: Meng Wang <mengw@codeaurora.org>
When ext clk stop wakeup and slave_pending_irq come together
then interrupt at swrslave is cleared due to calling
enable_slave_irq. Do not clear interrupts for enable_slave_irq
when its called from clk stop wakeup.
Change-Id: Ia710030ab80306d6750bea7264f0d4c07053d701
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
SSR notification may not come to swr master control
in time and cause swrm_runtime_resume tries to access
SWR registers. Update the logic to return when requesting
hw vote fails.
Change-Id: Ia85e9ce540ff88d16e8e73c48bab26fb277b86bb
Signed-off-by: Meng Wang <mengw@codeaurora.org>
During SSR up event handler, if soundwire state is
already up or auto suspend jiffies is not completed,
ensure put in suspend/SSR state.
Change-Id: I853f42d125eb5a60e3f1f065a60516877e3a463c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
LV Platform use the same LVGVM cause Kbuild mismatch issue
Change-Id: Iad092ebcbd991e52daedb87406920055528e3a1c
Signed-off-by: Hongtao Peng <hongtaop@codeaurora.org>
Remove static definitions of rx swr slave physical addresses.
Add support to read swr slave physical addresses from device
tree and store it within respective master data structure.
Revert addition of slave device address for wcd937x in soundwire
master.
Change-Id: I0eb2597b8e40a54d476cd2662bbe4f2008af899a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Auto suspend timer for core vote is triggering before read write complete.
Move the auto suspend of core vote to post read write operation.
Change-Id: Ib0f6b026fe0e7fd3fbe052691db492915e436a78
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
Enable interrupt request only when the interrupt is
in disabled state.
Change-Id: I67795bf0ee344661e02b0fec3181cd7980d56652
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Underflow is observed sometimes with CPS spkr prot enabled.
Reduce no of retry count for wsa to 1 so as to optimize delay
between reads on wsa and prevent underflow.
Change-Id: I505fcf349b45bd6f2374e5cfee83473f032e4ad7
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Some soundwire register dump is skipped with current logic.
Update ppos logic to dump all soundwire registers correctly.
Change-Id: Id053e2b71705ca17caf2de2bb85f8c987790099a
Signed-off-by: Meng Wang <mengw@codeaurora.org>
At bootup device wakeup enable is called for all masters
causing issue for wsa on lahaina. This is because wsa
supports interrupts on lahaina. Thus enable device wakeup
only for tx master.
Change-Id: Ia53df31427e54d5fd981cd650e1b0f06cb2d47b5
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
When multiple slave ports are configured to a single master port,
the offset1 of master is the minimum of all slave port's offset1.
Change-Id: I102269806048ecf9982489164a7651a2cdd0661c
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
SWR overflow, underflow interrupts are seen sometimes on bootup.
Check whether devnum is 0 during fifo read and write. Also assign
read and write fifo depth before master init to resolve errors.
Change-Id: Id7b687985e320396d2f9dab69db56cc7f5426b04
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Check for fifo availability before writing slave registers
during swrm master bulk write so as to prevent swr
overflow, underflow errors.
Change-Id: I97a914cac289b3f1215ccf5c1abec88b959a9f21
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Update sample interval in 4.8MHZ port config table of soundwire
digital mic slave and TX1 soundwire master port.
Update the block offset of soundwire digital mics 0 and 3 to handle
voip/sva dmic concurrency in both handset and speaker mode.
Change-Id: I85480c3609a72d4be3c4643b0123f09d71b97fef
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Add ratelimit to supress the logs flooding at the
time of SSR.In all places defined ratelimit as,
in 1sec one debug msg prints.
Change-Id: I6dfe140848e5cecb1b311c432f8311cdf0615a58
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
- Skip audio hm voting during bootup.
- Vote and unvote audio hm vote during swrm_runtime_suspend
and swrm_runtime_resume
Change-Id: I7a9c20f62ba0d87779b26da218bfe7373132b565
When sound wire master suspend is called, it holds the mutex lock
and does lpi_gpio_write, which gets preempted during pr_err_ratelimited.
Any other calls to master suspend will be blocked waiting for the above
mutex lock resulting in timeouts.
Remove pr_err_ratelimited log when device is down.
Change-Id: I148263ddbb89d436b0ce27bdc4519f196d90679a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
in swrm_runtime_suspend, current_state is not updated and
causes audio_core_vote is not disabled. Update to check
swrm->state to resolve this issue.
Change-Id: I2c5be360fe5ddd964d7bc45696e254579aae5392
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Update Kbuild and header files in msm_audio_ion_vm.c
and apr_vm.c for kernel 5.4 gvm audio bring up.
Change-Id: I6bcd0e49f783aaec43a64ad308b817a474b30dc7
Signed-off-by: Guodong Hu <guodhu@codeaurora.org>
Add slave device address for wcd937x in soundwire master.
Update slave port configuration for wcd937x for holi.
Change-Id: I1f953e47b1520efd99b6f400593242ae5fc6158a
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
LV Platform use the same ARCH cause Kbuild mismatch issue
Change-Id: I803aeb3bbee45566b1f9e66b4a6c8b8c26ba86f3
Signed-off-by: Fei Tong <ftong@codeaurora.org>