Commit Graph

46 Commits

Author SHA1 Message Date
yuayang
568d8d0822 asoc: audio-kernel: Remove trace_printk
Remove trace_printk point.

Change-Id: I76b53eda77bc41c75e06a885084022d74c248188
Signed-off-by: yuayang <quic_yuayang@quicinc.com>
2023-12-21 16:26:31 +08:00
qctecmdr
69a087fc8e Merge "asoc: lpass-cdc: Add check for array bound overflow" 2023-06-29 01:12:50 -07:00
qctecmdr
b0ea759df3 Merge "asoc: lpass_cdc: Program FS_CTL reg based on input used" 2023-06-28 13:17:46 -07:00
Deepali Jindal
3daac9507a asoc: lpass-cdc: Add check for array bound overflow
In lpass_cdc_wsa_macro_config_compander function,
add check for wsa_sys_gain array's index to make sure
it won't go out of bound.

Change-Id: I9d8512726de959e7a0d9e875e966140d70412e25
Signed-off-by: Deepali Jindal <quic_deepjind@quicinc.com>
2023-06-22 10:53:05 +05:30
Ganapathiraju Sarath Varma
d41a40721c asoc: lpass_cdc: Program FS_CTL reg based on input used
Program WSA_DATA_FS_CTL reg based on input used(wsa rx/wsa2 rx)
and also update the channelmap based on mixer cntl.

Change-Id: I0cfac1d9b25dd1211824bcea2753bb6c1131f767
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-06-13 07:57:21 -07:00
Faiz Nabi Kuchay
e460678dab soc: codecs: remove redundant WSA AIF_CPS control
Remove redundant WSA AIF_CPS control.

Change-Id: Iae150ed81acfa4013a08b90e10744e6c49b30537
Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
2023-06-11 22:50:04 -07:00
Faiz Nabi Kuchay
42973a5dfc asoc: codecs: Enable main path clk before enabling mix path
Mix path clk is gated by main path clk, as per current logic we are not
enabling main path clk for mix path use-cases.

Enable main path clk before enabling mix path for UPD dedicated backend
to work.

Change-Id: I209d1eaf25f4ef08bbd534f5ecc858e465ce7e18
Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
2023-06-06 11:39:25 -07:00
Soumya Managoli
5c3832c4a8 ASoC: lpass-cdc: Toggle WSA fs_cnt_clr bit
During spk playback and VA concurrency,
sometimes WSA CLK goes out of sync causing
VI_TX data mute. To resolve this, everytime
after WSA MCLK enable toggle fs_cnt_clr bit.

Change-Id: Ia936f1d4843890d2ae5c02b039f502941a5427b9
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-04-25 23:22:33 +05:30
Ganapathiraju Sarath Varma
70ea54b385 asoc: lpass-cdc : Enable wsa clks during DAPM powerup sequence
enable the wsa and wsa2 clk as per  sequence.

Change-Id: Ieefa4b6ea7aec535d940d780b0ed923483b4d3ee
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-03-27 11:49:47 -07:00
Eric Rosas
2c2db12700 asoc: codec: Unmute WSA for ADIE loopback
Unmute WSA after enabling main path for
ADIE loopback cases.

Change-Id: I850aa4dbcf77371811010c1d614c6c7e94736971
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-02-28 11:13:56 -08:00
Sam Rainey
6b5e8148d4 asoc: lpass-cdc: Fix digital volume range
Remove platform_max setting in WSA/WSA2 drivers
to correct the volume range for digital volume.

Change-Id: Ia87c9fbeacc7bbb37b02f707b5c624a4091251d9
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-01-12 10:40:21 -08:00
Yuhui Zhao
1dacaf014f audio-kernel: Compilation fixes with "Break" and "fallthrough"
Compilation fixes with "Break" and "fallthrough".

Change-Id: Ica05d0410efc5e9dc52addcf4cd8c0253f49fada
2022-10-06 22:40:29 -07:00
Ganapathiraju Sarath Varma
8280a19ab8 asoc: lpass-cdc: Handle pbr clk based with its ref cnt.
Disable the common pbr clk register only when no one uses
RX0 and RX1 channels.

Change-Id: Ia5fab1d3e4be7d9ecb01ad0b612b9f6ef7406bea
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2022-09-13 10:55:09 -07:00
Ganapathiraju Sarath Varma
c7d5b69be6 asoc: update out of bound check for comp_mode.
updated the out of bound check for comp_mode
if any such occurence happens setting it to default mode.

Change-Id: Ie4a7275d45af6a96f1a2ec4b6ece6dc7a5dca464
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2022-07-20 12:54:13 +05:30
qctecmdr
dd26499468 Merge "lpass-cdc: apply digital unmute after PA is enabled" 2022-07-12 16:14:47 -07:00
Phani Kumar Uppalapati
35ae7a451e lpass-cdc: apply digital unmute after PA is enabled
Unmute digital volume after analog PA is enabled to reduce
pop issues.

Change-Id: Iae4a5b6df3c258e1ab9976bb0a47946c5a681b08
2022-07-11 04:25:26 -07:00
Vangala, Amarnath
e275af3979 asoc: lpass-cdc: fix the vi enable sequence
Enable the VI decimator at the end of Rx and VI enable sequence.

Change-Id: I12045c903b29d4cc830dbbfd242d805a629c0efd
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
2022-07-11 16:53:48 +05:30
Ganapathiraju Sarath Varma
e74b2a8eb5 asoc : codec : update audio path and ch_msk for VI.
Update ch_msk and audio path for VI feedback path
in lpass_wsa2 macro.

Change-Id: Ibc96fc1ad82e2e996b11af20522f35e47b94d8f0
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2022-06-30 00:01:28 +05:30
Ganapathiraju Sarath Varma
ddd5081752 asoc: codec: update wsa2 with wsa bat_cnfg,sys_gain,rloads.
- update wsa2 macro with wsa bat_cnfg, sys_gain,
  rloads dt cnfg.

Change-Id: Idb579b460949a61579e8e27b8f0a4f911c271090
2022-05-23 22:09:58 +05:30
Meng Wang
14b172d92c asoc: lpass-cdc: update logic to vote during ssr
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>
2022-05-17 17:33:04 +08:00
qctecmdr
2205759439 Merge "asoc: codecs: Update WSA2 Macro to Match WSA Macro" 2022-05-16 16:12:55 -07:00
qctecmdr
401747d67f Merge "asoc: codecs: support for cps soundwire port" 2022-05-16 16:12:55 -07:00
Vangala, Amarnath
9a5deb8cc6 asoc: codecs: support for cps soundwire port
Implement backend for CPS soundwire port in Bolero.

Change-Id: Ibbd38d067e46be1a71723de04a83bc83f0ec2925
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
2022-05-12 21:38:25 +05:30
Matthew Rice
c3cddd0b43 asoc: codecs: Update WSA2 Macro to Match WSA Macro
Propagate all changes to lpass-cdc-wsa-macro to
lpass-cdc-wsa2-macro. Leave get_channel_map alone
because it is wsa macro specific.

Change-Id: I46733a759490d488f46eda24b4006a1dec63c7cc
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-05-10 14:11:40 -07:00
Prasad Kumpatla
c9930cc8d8 asoc: lpass-cdc: fix for array out of bounds for active ch mask and ch_cnt
update check not to exceed the array index for active_ch_mask and active_ch_cnt

Change-Id: Ic6d72d7469edbd004cd34a709384d527e90cd26f
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-05-09 10:26:33 +05:30
Shazmaan Ali
a20e11e0c3 asoc: codecs: Replace dev_err/info with ratelimit prints
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>
2022-04-13 12:43:20 -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
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
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
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
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
Junkai Cai
29cda5976d asoc: lpass-cdc: update WSA/WSA2 cooling option policy
cooling of WSA/WSA2 is to reduce the digital gain.
the cooling callback should only be called when the WSA pointer
has not been initialized.
Also the adjusted volume of RX0 and RX1 need to be set separately.

Change-Id: I6aac0e7a3a3219e8b5c24d711a6c7773824827e9
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-06-27 12:18:45 -07:00
Junkai Cai
9107dae9d8 aosc: codecs: set mclk flag false when mclk is disabled
the dapm_mclk_enable flag has not been set back to false
when the actual mclk is disabled.

Change-Id: Ic04756b3dcd074887dd1e93f23cf31873abc1428
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-06-27 12:00:04 -07:00
Junkai Cai
751d49a88b asoc: lpass-cdc: reduce WSA digital gain when cooling is enabled
The digital gain will be adjusted lower than what userspace set
during playback if the device temperature reach the threshold.

Whenever digital gain is changed from userspace, codec will check the cooling
state and adjust the gain.

Change-Id: I52df0f96cf20b90a9bdad70b9c117eed82145fb2
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-06-07 05:14:17 -07:00
Laxminath Kasam
5a96e4bc5b asoc: lpass-cdc: Update core voting before gfmux access
GFMUX access in va clock supported in lpass-cdc v2p5
onwards. Ensure add core voting before access.

Change-Id: I36c8db86a2e7f265ab293dd6cd1f1ee3ac7722a5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-05-24 01:45:01 -07:00
Junkai Cai
647c4b4898 ASoC: added WSA2 support on targets with more than two spkrs
Add wsa2 backend dai links only in platforms
which has 4 wsa speakers.

add 2 to the device index parsed from hardware device id
of wsa slave to match the dai names in the msm_dailink.h

Change-Id: Iffe43842123526f4925f9d5bcd8dff0317bac7a7
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-04-26 13:29:01 -07:00
Laxminath Kasam
01756036b5 asoc: lpass-cdc: Update swr pdev initialize order
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>
2021-04-26 07:50:25 -07:00
Meng Wang
195771b877 asoc: lpass-cdc: update correct offset for compander and softclip
Update correct offset for compander and softclip.

Change-Id: Ic4071a25911db0c6c57d550e98d63e663354f62d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-04-26 05:47:12 -07:00
Laxminath Kasam
fefa2893b5 asoc: lpass-cdc: Update ch_mask for wsa2_macro
Update ch_mask of WSA2 macro to return based on
4-channel DMA support.

Change-Id: Iea4800dc85bf6bf1d250dfca214c58925ea328ab
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-04-21 00:35:20 -07:00
Vatsal Bucha
a5ca4621d9 asoc: bolero: Add core_vote before gfmux access
GFMUX access happen during WSA macro usecase.
Update wsa macro to do core_vote before clock
request.

Change-Id: I8f7eb67b87845016b54c9873a6fc230d207262f7
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-03-22 04:39:40 -07:00
Meng Wang
d7859b1bdd asoc: lpass-cdc: add RX4/5 for wsa macro
RX4/5 are added on bolero 2.5 and can be used for wsa1 macro.
Make this change to add RX4/5.

Change-Id: I4fa77fec3cbcb4d01718026cf648e5e7a171ddb2
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-17 15:00:40 +08:00
Vignesh Kulothungan
a6040adea6 ASoC: bolero: add support for central broadcast bcl
Remove bcl decode registers and add new central broadcast
decode registers.
Enable the new central broadcast (CB) block registers during usecase
start and request for bcl data inorder to receive current bcl events.

Change-Id: I4c626e5083328b4cfdb5c956695078985b5c54a5
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2021-01-21 10:26:05 -08:00
Sudheer Papothi
78e6d7ec4b ASoC: lpass-cdc: Update digital codec driver name
Update LPASS digital codec driver name for proper enumeration.

Change-Id: Ied6a3697a5e47c0695b6339ec7b4b4561ef6ccbd
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2021-01-13 04:22:40 +05:30
Laxminath Kasam
96d934a968 asoc: lpass-cdc: Update compander zone settings for macros
Update compander settings table to calculate based on
upper gain and lower gain.

Change-Id: Ib423f3c14c900c0df03bc8fcab2df0f62fb614f1
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-18 12:42:11 +05:30
Laxminath Kasam
f5ea229fb5 asoc: lpass-cdc: Add new driver for lpass-cdc wsa2 macro
Add driver support for wsa2 macro.

Change-Id: Ieca032b538cb2a8ac1345df1f1972e3c5689a5d8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-10 19:12:23 +05:30