Sampling rate of the decimator is reset to hw reset value during
power down event in existing code. This code was implemented for
a safety precaution.
Remove this code as it is causing a side effect for VA use cases.
Side effect of existing code: during successive VA use cases runs,
Sampling rate is not updated as the device is not closed completely.
Due to this, decimator runs with incorrect sampling rate for
successive runs and causes failure.
Change-Id: I5e60c656043d06c3d999de183698adfffdaa44d1
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
While disabling the Decimator, reset the sampling rate to default value.
Change-Id: If07aeb69ddff459d0fdf8dfd4ccb7b3d8ed97743
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
Use VA_CORE_CLK without LPI Enable mixer cntl for SVA usecases,
To keep usecase in LPI mode even in corner cases.
Change-Id: I45da244b8a992b1ff043ab4b401903376c5cff90
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
When switching from 16KHz to 48KHz recording, mute issue happens.
Addd TX datapath reset during path teardown to resolve this issue.
Change-Id: I7445b397c20ce4e4968fec2326267f63dcba5a8c
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
During SSR down event,
ensure swr gpios are put to sleep even in error conditions.
Change-Id: I649d088d0bc429c9b7a02304272eaea06774ca51
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
add pm stay awake before the queue delayed work to avoid the when apps suspend.
Change-Id: Iad4d55d509e800b352ac7cb8afb0824a89c80c40
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
After ADSP is up during SSR, core_hw_vote may fail and audio_hw_vote
may successed in lpass_cdc_runtime_resume which is caused some timing.
When getting slave device_id, as core_hw_vote is 0, it will skip reading
swr registers and return 0 which causes fail to read correct device_id.
Make this change to avoid calling lpass_cdc_runtime_resume when adsp_up
notification doesn't reach lpass_cdc.
Change-Id: I90a97e5c47bb95180a96ba1c60b462f1fa0124b7
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
Signed-off-by: Kunlei Zhang <quic_kunleiz@quicinc.com>
Match datatypes of variables in
lpass_cdc_va_macro_enabl_dmic() with
lpass_cdc_dmic_clk_enable() to prevent CFI issues.
Change-Id: Id378476b1aa6231c8542ca754124716af2b1f50b
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
replace all dev(pr)_err/info logs
that could potentially flood kernel logs with
ratelimit functions dev_err_ratelimited and
dev_info_ratelimited
Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
Cast returned u16 value to int in VA/TX macro: clk_div_get
to avoid possible data type warnings seen in function
caller.
Change-Id: I08943a26294ce54a207b739867292c01d090623e
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
Udpate MSM DMIC power up sequence to reduce pop.
Change-Id: I5f3f2e439e31877d3f21c05575c95942b937252e
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
When SWR MIC is used, lpass-cdc doesn't know if it's amic
or dmic on WCD. Add new mixer control to indicate if
swr_dmic is used or not.
Change-Id: I2910053d1da9110edfe9b021df744f9d1662d158
Signed-off-by: Meng Wang <mengw@codeaurora.org>
When adsp SSR happens, VA_MCLK enabled by VA_SWR_PWR widget will
not be disabled as ADSP is down and it cannot enable TX_MCLk before
disabling VA_MCLK. After disabling SVA, VA_MCLk is left open.
Add dev_up flag to indicate SSR and close VA_MCLK during SSR.
Change-Id: Ic544ce32c46054c7362d3eb07a4a47ec115d2651
Signed-off-by: Meng Wang <mengw@codeaurora.org>
When reading/writing lpass codec registers, pm_runtime_put_autosuspend
is missed when vote fails and it causes device fails suspending after
ssr. Add pm_runtime_put_autosuspend to pair with pm_runtime_get_sync.
When LPASS_CDC_MACRO_EVT_PRE_SSR_UP comes, core vote is needed before
resetting GFMUX reg and dev_up is not set to true yet. Add pre_dev_up
flag to indicate PRE_SSR_UP and be used in lpass_cdc_check_core_votes
to avoid false alarm.
Change-Id: Ic12ecd9645f291078e32f4921f9f77c2d85e4b8c
Signed-off-by: Meng Wang <mengw@codeaurora.org>
During ssr, when powering down audio path and core vote fails,
it directly exits without disabling clock. After adsp is up,
it will enable both RX_MCLk and RX_TX_MCLK which causes
glitch on headset output.
Change-Id: I98d3cdbffa0a5ae1ac4064579a52a29b02d4ae3e
Signed-off-by: Deepali Jindal <deepjind@codeaurora.org>
SVA switch is not retain at VA_CLK when switch
between handset and headset mic sva. Update the
clock release logic during swr power event.
Change-Id: I52c5f7576426af2ff385a862da872e8d86959ecb
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Add ftrace log to debug NOC issues.
When writing/reading lpass codec registers, add vote_lock
to make sure clk is not disabled.
Change-Id: I1df924d6aefee2899f7e5008851c1c324dabf62a
Signed-off-by: Meng Wang <mengw@codeaurora.org>
During adsp SSR, after adsp is down, lpass_cdc_runtime_resume
is called in va-marco and fails. lpass_cdc_runtime_suspend is
not called 100ms later. After adsp is up and va-macro considers
lpass_cdc is resumed and not setting clk which causes wcd not
detected. Call runtime_suspend when vote fails to resolve
the issue.
Change-Id: Ice398d0168c5c67f6c98e3122af507ca74837175
Signed-off-by: Meng Wang <mengw@codeaurora.org>
When WCD AMIC is used and connected to SWR master port3,
DMIC clk div is updated by mistake. Update logic to update
DMIC clk DIV with new flag.
Change-Id: Iee01acf97f925ec54c8d189c13e63acca7ffc2f4
Signed-off-by: Meng Wang <mengw@codeaurora.org>
The PCM_RATE bit field in LPASS_TX_CDC_TXn_TX_PATH_CTL
ranges from 0 to 6.
In the current implementation of tx-macro, the value
read is mapped directly to the sample rate instead of
the indices. Change is to correct this.
Add the delay based on pcm_rate in va-macro as well.
Change-Id: I6cb7e58e71f2a25356608611f1dfed83171706f6
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
During sound card register init call, if swr pdev
is not initialized yet respective soundwire port
config is not updated to soundwire controller device.
In macro drivers, update swr pdev into macro private
data prior to platform device add.
Change-Id: Ifa67471cfc7a10b102b573df6285e598bb0b5e5e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
lpass-cdc only support new codec after 2.5 version.
Remove old lpass cdc version check.
Change-Id: I54a53edf5bdb92f78b43d96e9413f64b0e06c306
Signed-off-by: Meng Wang <mengw@codeaurora.org>
In va, rx and wsa macros, move schedule_work call to
add the child devices to the point later to where the parent
initialization gets completed.
Change-Id: I2095f1007beae253534b2ed44f988ce55fad6b75
Signed-off-by: Vatsal Bucha <vbucha@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: I619da358c7c42af45ef480ed0dba2c2cc26e9cc1
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Update codec driver dai link names for proper enumeration of
dai links during sound card enumeration.
Change-Id: I91630f60647c83095bc979b09aad1b273b44f71c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update lpass-cdc version 2p5 registers update and remove old
version tables.
Change-Id: I14e0efe09e3ff5ded49b91e2e226558ae444bc0f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add driver support to enable lpass digital codec for
audio playback and capture usecases.
Change-Id: I3d31d31f340db79334700e8fd495f40479e0ec6c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>