during devm_snd_soc_register_card(), the name_prefix can be set
if "sound-name-prefix" is provided in the DT nodes.
The original approach to set prefix would possibly cause ASoC
component probe failed if prefix has not set before probe is called
Change-Id: Ie78d042cda24b7d1d926223d476786e13d965ac7
Signed-off-by: Junkai Cai <quic_junkai@quicinc.com>
Interrupt from wsa884x are not handle as slave_irq is not set.
Add slave_irq for wsa884x to address this issue.
Change-Id: I82edb35b55f6a46d79bd96b7f0f4bfac58583860
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
When interrupts are triggered on the second or third interrupt
status register, current logic cannot clear that interrupt status
after handling it. Enable use_single_read for wsa and wcd regmap
to resolve the issue.
Change-Id: Ieac57e169505d4455dde1dcd0e80e222e3e8eb1e
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
Conforms to latest hardware DRE documentation
Change-Id: Ia08b03f519697723e9e260451c5bc68b4b45724c
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
For SVA usecase, BCS is not needed. For other usecase,
BCS is enabled. When voicecall and SVA are running
concurrently and do device switch between headset-mic
and handset-mic, BCS SWR port may not get closed when
teardown headset-mic. When closing ADC2, check BCS_STATUS_MASK
only and remove check for bcs_disabled flag to make sure
BCS SWR port is closed.
Change-Id: I01b1cadc0143a4f46eb6a04c3fc8a2509aa13ec3
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
With moisture_en flag being set as true for legacy moisture detection,
need to check if duty cycle is also enabled so as to report headset
insertion/removal properly when moisture detection enabled.
Change-Id: I6014e2e047d7c33b16bf9229ee1901fd8d042b47
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Compile for kalama chipset.
Replace wsa883x in kbuild/conf/mk files
Change-Id: I38910d7724e2b95ba79548f46dc152ccf63823ef
Signed-off-by: Matthew Rice <mrice@quicinc.com>
Driver implementation for WSA884X.
Use new script to generate register files.
Modify register naming convention.
Add wsa884x-reg-masks.h and wsa884x-reg-shifts.h
Reverting copyrights to 2019 for wsa884x.h file
Change-Id: Ic3652d6138a2f62ba59a36d4307c732ab6e8db89
Signed-off-by: Shazmaan Ali <shazmaan@codeaurora.org>
Port drivers for Linux kernel 5.15(or after).
Remove unused headers that not present in the new kernel.
Update function interface matching API updates in the kernel.
Change-Id: Ibdffbe20c0b65b2ddda958d6a32c493696e15768
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
add kalama config file to all drivers' Kbuild, including soc/dsp/ipc
Change-Id: I56a6092da515f211a56617f0cff60079dbf0aa39
Signed-off-by: Junkai Cai <junkai@quicinc.com>
Sometimes after SSR/DPR is triggered, RX_TX_CORE_CLK, WSA_TX_CORE_CLK
and WSA2_TX_CORE_CLK are not reset which causes WSA or WCD not
detected. Make this change to add reset during SSR.
Change-Id: I343f2f92244de3eee844e220a6201b389dc647b4
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>
Add changes to use wsa883x for receiver with
low_noise mode settings.
Change-Id: Icfa43ebbdb1e366f365053535f541bee03751ca3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
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>
BCS is not enabled sometimes after inserting headset if
plug is already reported and we dont report it again.
Enable BCS if plug type already reported.
Change-Id: I8c9f15ced66a21bda169d3479da96168ebec26a7
Signed-off-by: Vatsal Bucha <vbucha@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 SVA is enabled and headset is inserted and playback is started
on headset, sometimes electrical irq is triggered resulting in
headset removal being reported. This happens because of high mic
voltage being reported. Enable micbias before checking for adc
voltage to resolve issue.
Change-Id: If7445c906b2e62f12b48548a2d435db01f184587
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Add null check for swr dmic component and swr_dmic_priv
before use.
Add array bounds check for slave port index before
accessing the array.
Change-Id: I6f1976e98e41e513a9a9db83d4e804a5cb1fe79b
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
Thermal framework is expected an error to be returned if the requested
cur_state exceed the max_state.
Change-Id: I1e0d8124a1aa6c0d755b35225207638aefdcb464
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
Update central broadcast register control to enable bcl path.
Change-Id: Ibc05289d9cdd41e81369c6ef2547eceffa36d73a
Signed-off-by: Vignesh Kulothungan <vigneshk@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>
Incorrect check for return value of clk_div_get
causes CLK_DIV2 setting being missed. Fix the
return value check to address this.
Change-Id: Ic1b6761ab836a38c657ac7e43efda0e2f23c5fee
Signed-off-by: Aditya Bavanari <abavanar@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>
BCS is not enabled for us headset as after 3sec loop
we directly switch to report headset and bcs is still disabled.
Enable bcs only after reporting valid plug to resolve issue.
Change-Id: I69bb71d20583fd2e2be921e9b657d9c44c047708
Signed-off-by: Vatsal Bucha <vbucha@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>
When requested clk is not default clk, it should not enable
VA_MCLk directly. lpass_cdc_clk_rsc_check_and_update_va_clk
will take care of VA_MCLK switch.
Change-Id: I602be7dcc0228fd2e6ecd7624a96663e89485bd0
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>
When multi wsas are connected to wsa-macro and some registers
are written to wsa, swr broadcast mode is used. When closing
one wsa, it will also send the register write to the other wsa
and it should not get updated. The other wsa will be in bad
state.
Remove broadcast for wsa-macro to resolve this issue.
Change-Id: I4c788a213fdcd217861703a13d44c096fd9b632d
Signed-off-by: Meng Wang <mengw@codeaurora.org>