Commit Graph

1478 Commits

Author SHA1 Message Date
Junkai Cai
97e37eeee3 asoc: use ASoC API to set driver component name prefix
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>
2021-12-07 09:53:13 -08:00
Linux Build Service Account
7795165e0a Merge "asoc: codec: enable use_single_read for wsa and wcd regmap" into audio-kernel.lnx.5.15 2021-12-07 09:51:20 -08:00
Prasad Kumpatla
4ed625474c asoc: wsa884x: add slave_irq for wsa884x
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>
2021-12-07 09:16:44 -08:00
Meng Wang
0bd4c39e4e asoc: codec: enable use_single_read for wsa and wcd regmap
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>
2021-12-07 09:15:42 -08:00
Linux Build Service Account
ffbb0c4a5b Merge "ASoC: codecs: mbhc-adc: Check if moisture duty cycle enabled during elec rem irq" into audio-kernel.lnx.5.15 2021-12-07 08:54:51 -08:00
Linux Build Service Account
57366b5e90 Merge "asoc: wcd938x: update logic to close BCS correctly" into audio-kernel.lnx.5.15 2021-12-07 08:53:49 -08:00
Matthew Rice
b70a4759b3 asoc: codecs: Add WSA884X DRE Settings
Conforms to latest hardware DRE documentation

Change-Id: Ia08b03f519697723e9e260451c5bc68b4b45724c
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2021-11-24 11:19:42 -08:00
Meng Wang
f48ad4780a asoc: wcd938x: update logic to close BCS correctly
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>
2021-11-24 03:47:53 -08:00
Vatsal Bucha
5f65bb9592 ASoC: codecs: mbhc-adc: Check if moisture duty cycle enabled during elec rem irq
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>
2021-11-24 01:35:45 -08:00
Matthew Rice
1b69ddf3c3 asoc: Replace wsa883x with wsa884x in machine driver
Add bat_cfg, system_gain, and rload parameters to properly configure wsa884x

Change-Id: Ibb4de17a9935f178293bc17314784ff87a978815
Signed-off-by: Matthew Rice <mrice@quicinc.com>
2021-11-09 15:33:09 -08:00
Matthew Rice
08ad1635a5 asoc: codecs: Initial lpass-cdc 2.6 implementation
Update register headers, add version 2.6 string.

Change-Id: I6236ddebba3fcbb37f2a64c8638d4eea4f6cc062
Signed-off-by: Matthew Rice <mrice@codeaurora.org>
2021-11-09 15:32:30 -08:00
Matthew Rice
364ecf5de5 audio-kernel: Enable compilation of wsa884x
Compile for kalama chipset.
Replace wsa883x in kbuild/conf/mk files

Change-Id: I38910d7724e2b95ba79548f46dc152ccf63823ef
Signed-off-by: Matthew Rice <mrice@quicinc.com>
2021-11-09 15:25:45 -08:00
Matthew Rice
da73d84e5a asoc: codecs: Update SWR Ports with CPS & PBR
Reflecting latest hardware SWR updates.

Change-Id: I8a4c647e3a0a4e4b958dd102efa04a66fbce4618
Signed-off-by: Matthew Rice <mrice@codeaurora.org>
2021-11-09 15:24:38 -08:00
Matthew Rice
e9193b07c0 asoc: codecs: Update wsa884x dev_index to match uniq id
WSA884X has different uniq id than WSA883X

Change-Id: Ibb785f3edcc0ae4e8a79849bd8f01a891f5b46ae
Signed-off-by: Matthew Rice <mrice@quicinc.com>
2021-11-09 13:33:56 -08:00
Matthew Rice
cdcdcac0df asoc: codecs: Update register initialization sequence
Add latest register sequence.
Remove version 1_2.
Update header files with latest registers.

Change-Id: I92f56e5ec2be4e695d42cec8610b9b9300410b02
Signed-off-by: Matthew Rice <mrice@codeaurora.org>
2021-10-28 16:52:38 -07:00
Junkai Cai
179ce4f13f asoc: codecs: Implement codec driver for WSA884X
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>
2021-10-28 16:52:18 -07:00
Junkai Cai
11b2aeb0c9 asoc: update asoc and ipc drivers for kernel 5.15
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>
2021-10-28 16:47:53 -07:00
Junkai Cai
bd4a663a65 asoc: add config files to support kalama
add kalama config file to all drivers' Kbuild, including soc/dsp/ipc

Change-Id: I56a6092da515f211a56617f0cff60079dbf0aa39
Signed-off-by: Junkai Cai <junkai@quicinc.com>
2021-10-27 14:37:34 -07:00
Meng Wang
322f08f457 asoc: lpass-cdc: reset RX_TX_CORE_CLK and WSA_TX_CORE_CLK during SSR/PDR
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>
2021-09-28 14:23:52 +08:00
qctecmdr
316b9557b3 Merge "asoc: waipio: Parse and Set reg info for UPD." 2021-09-19 10:04:30 -07:00
qctecmdr
590d8a9823 Merge "wsa: soundwire: Add support for 4p8MHz DAC rate" 2021-09-19 10:04:30 -07:00
Laxminath Kasam
001ba433b2 wsa: soundwire: Add support for 4p8MHz DAC rate
Add support to use 4p8MHz DAC rate for receiver over WSA.

Change-Id: Ia0811670326be8131687fbdff70464da063902b2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-09-15 22:22:09 -07:00
Laxminath Kasam
ae258cb2f8 asoc: wsa883x: Update low_noise gain for receiver
Add changes to use wsa883x for receiver with
low_noise mode settings.

Change-Id: Icfa43ebbdb1e366f365053535f541bee03751ca3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-09-15 22:19:46 -07:00
Meng Wang
3fa91843c7 asoc: lpass-cdc: add mixer control to indicate if swr_dmic is used
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>
2021-09-15 22:19:40 -07:00
sarath varma ganapathiraju
2db2fd8857 asoc: codec: wcd938x: Get swr device number
add wcd938x_codec_get_dev_num to return
swr device number

Change-Id: I45f4324645643b4edc6182cee508ce1e647c3612
signed-off-by: sarath varma ganapahiraju <ganavarm@codeaurora.org>
2021-09-15 22:19:33 -07:00
Harold Tan
4ace4a9197 msm_hdmi_codec_rx: lower min sample rate for DP_DAI1
Lower rate_min to 32kHz to support more clips of
different sample rate for DP use case.

Change-Id: Idab284ac0cfe9248ae417ba9c25e5154f0658d69
2021-09-05 23:23:48 -07:00
qctecmdr
7923c5e04e Merge "asoc: lpass-cdc: update logic to disable VA_MCLK" 2021-09-03 01:46:33 -07:00
Vatsal Bucha
6527fdb4e6 ASoC: mbhc-adc: Enable BCS if plug type already reported
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>
2021-08-31 05:40:54 -07:00
qctecmdr
0753a3433e Merge "ASoC: codecs: add null check before use" 2021-08-28 21:21:19 -07:00
qctecmdr
8bd420897b Merge "asoc: lpass-cdc: return error when requesting incorrect state" 2021-08-28 21:21:19 -07:00
Meng Wang
f62a7f3e92 asoc: lpass-cdc: update logic to disable VA_MCLK
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>
2021-08-25 13:44:52 +08:00
Vatsal Bucha
47942f03ae ASoC: mbhc-adc: Resolve headset removal detected because of elec irq
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>
2021-08-24 14:16:38 +05:30
Junkai Cai
cc1ce15fb7 ASoC: codecs: add null check before use
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>
2021-08-21 15:08:00 -07:00
Junkai Cai
63db490176 asoc: lpass-cdc: return error when requesting incorrect state
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>
2021-08-19 14:25:57 -07:00
qctecmdr
fa58ae98f9 Merge "asoc: codecs: update cb decode register control" 2021-08-15 08:15:12 -07:00
Vignesh Kulothungan
1065b55645 asoc: codecs: update cb decode register control
Update central broadcast register control to enable bcl path.

Change-Id: Ibc05289d9cdd41e81369c6ef2547eceffa36d73a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2021-08-09 12:17:38 -07:00
Meng Wang
a8bd9abc48 asoc: lpass-cdc: add put_autosuspend to pair with pm_runtime_get_sync
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>
2021-08-08 19:49:27 -07:00
qctecmdr
043966829b Merge "asoc: lpass-cdc: Disable clk when core vote fails." 2021-08-06 21:14:44 -07:00
qctecmdr
786300e8a0 Merge "asoc: Return the correct clk_div value" 2021-08-06 21:02:43 -07:00
qctecmdr
a33aaa01f5 Merge "ASoC: mbhc-adc: Resolve bcs not enabled for us headset" 2021-08-06 20:56:50 -07:00
Aditya Bavanari
a415d7381d asoc: Return the correct clk_div value
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>
2021-08-04 20:34:18 -07:00
Deepali Jindal
a7de3376f2 asoc: lpass-cdc: Disable clk when core vote fails.
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>
2021-08-04 20:29:47 -07:00
qctecmdr
e28a044a67 Merge "asoc: lpass-cdc: update logic for va clk switch" 2021-08-02 20:56:04 -07:00
Vatsal Bucha
8b5bcc5a56 ASoC: mbhc-adc: Resolve bcs not enabled for us headset
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>
2021-08-02 02:52:43 -07:00
Meng Wang
f55dedc581 asoc: lpass-cdc: update logic for va clk switch
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>
2021-07-22 15:53:20 +08:00
Meng Wang
52aa968296 asoc: lpass-cdc: avoid enabling VA_MCLk when requested clk is not default clk
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>
2021-07-20 16:35:51 +08:00
qctecmdr
6a725a093e Merge "asoc: wsa883x: add support for multiple WSA" 2021-07-17 01:48:54 -07:00
Meng Wang
2344f44b9c asoc: lpass-cdc: add ftrace log for NOC issue
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>
2021-07-13 23:16:45 -07:00
Meng Wang
aa18085092 asoc: lpass-cdc: remove broadcast for wsa-macro
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>
2021-07-13 09:08:55 +08:00
qctecmdr
74848e76fe Merge "asoc: lpass-cdc: call runtime_suspend when vote fails" 2021-07-11 18:50:26 -07:00