Gráfico de commits

47 Commits

Autor SHA1 Mensaje Fecha
Prasad Kumpatla
8ae3047a7e asoc: msm_common: add mutex lock for vote against sleep cnt
add mutex for vote_against_sleep_cnt to avoid race conditions
while updating the cnt value at the time of SSR. Add check
while decrementing the cnt.

Change-Id: Ic8e40fa6b4a68c05fb70369ecb764943d5f582fa
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-06-20 02:36:38 -07:00
qctecmdr
6acdb1bc38 Merge "audio-kernel: Remove spf_apm_close_all from machine driver" 2023-05-30 07:34:04 -07:00
Ritu Sharma
ec9966e427 audio-kernel: Remove spf_apm_close_all from machine driver
Call spf_apm_close_all and msm_ion_crasH_handler from audio-pkt driver
only to avoid calling for these APIs twice.

Change-Id: I69f8f9cbafd5b08a24b45c8229d22a639eb35b8b
Signed-off-by: Ritu Sharma <quic_ritushar@quicinc.com>
2023-05-22 03:43:06 -07:00
Prasad Kumpatla
77dec4e24c asoc: common: Enable AudioHM vote for VA I2S and TDM interface
Enable Audio HM vote for VA I2S and TDM interface so that
clock is sourced from CXO instead of RO.

Change-Id: I4f74f46a4ae7977e9cd15a2d8f59f020e02ac8a1
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-05-17 22:07:49 -07:00
MingShu Pang
51ff3d008d asoc: get and update audio core list from device tree
Change-Id: I155576a4c136e5e0570dff0f2b598afbfc0ab872
Signed-off-by: MingShu Pang <quic_mpang@quicinc.com>
2023-03-28 10:44:25 +08:00
Prasad Kumpatla
7769502c7d asoc: msm_common: add counter to reset vote at the time of SSR
When target enters into secure mode, HLOS receives an event to
place vote against sleep until writing of required registers
from TZ. Once the secure DMA registers write done, HLOS will
get a event to unvote against sleep.

Issue scenario: When device enter secure mode votes for sleep
against, before unvote event receives for TZ SSR is triggered.
When SSR triggers all votes are reset on ADSP. While recovering
from SSR, HLOS receives unvote event to HLOS, which will unvoting
of other use case vote and leading to NOC issue.

Solution: Maintain a counter for sleep against vote to
track the votes and unvotes. Also reset the sleep counter
if SSR is trigger as ADSP will reset all votes on SSR.

Change-Id: Ib1689d8f54408a9a80a12fb2697ba5c3d7087b9a
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-15 02:34:43 -07:00
MingShu Pang
9e71504e36 asoc: inform scheduler that certain CPUs need to be reserved for audio
inform scheduler that certain CPUs need to be reserved for audio.

Change-Id: I3d2b4d6faeca1dfab3d7461db4e13a1d188f864c
Signed-off-by: MingShu Pang <quic_mpang@quicinc.com>
2023-02-06 20:21:17 -08:00
jianzhou
aa82144669 asoc: Get num_cpus from dai_link after it was removed
With new "struct snd_soc_pcm_runtime", num_cpus is
removed, instead num_cpus now is in
"struct snd_soc_dai_link".

Change-Id: Ia08e98ec0afa72deab147c6758fd6aeaf4477e75
2022-12-18 21:38:52 -08:00
qctecmdr
fee63bd4ec Merge "asoc: free backend_name memory when error happens" 2022-11-22 07:09:16 -08:00
qctecmdr
39fbfeb33a Merge "asoc: msm_common: call spf_apm_close_all only once" 2022-11-22 06:23:16 -08:00
Phani Kumar Uppalapati
7e16f6c859 audio-kernel: set hwparams for dummy platform
Set runtime hwparams for dummy platform components.

Change-Id: I160f7fafe60d644bc05fb90d0be777bbac712066
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-11-21 10:10:09 -08:00
Phani Kumar Uppalapati
5555970830 audio-kernel: fix compilation issues for pineapple target
Fix compilation issues in audio-kernel for pineapple target.

Change-Id: I93fa4fb670989f82139dd2cd0dbe57b52ad52504
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-11-18 11:58:44 -08:00
Rohit kumar
7047b7ab7f asoc: msm_common: call spf_apm_close_all only once
Add lock to avoid calling spf_apm_close_all twice from
machine driver.

Change-Id: Id5f40b0a5f7c336aa900db5657f5fab198c6e359
2022-11-16 15:48:08 +05:30
Meng Wang
17e29ced12 asoc: free backend_name memory when error happens
Free backend_name memory when error happens.

Change-Id: Ia54e5483f061ec015cc717e0b408804df58af7f0
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-10-28 02:06:31 -07:00
Phani Kumar Uppalapati
f3ce1994c6 msm_common: send correct return code for sleep mixer control
Send correct return code for Vote Against Sleep mixer
control.

Change-Id: I9f9779456331a11c95c160bdc2b182aa8de78b91
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-09-01 14:47:55 -07:00
Prasad Kumpatla
6a758782b1 audio-kernel: select param id vote against sleep when enter to securezone
select param id vote against sleep when enter to securezone with the help of
mixer ctl from pal.

Change-Id: Icb0d6aba4b13edc0658e676eb89c996d440e9971
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-05-27 12:51:23 +05:30
Meng Wang
95c95b2d67 asoc: update digital_cdc_rsc_mgr_hw_vote API
Update digital_cdc_rsc_mgr_hw_vote_enable/disable API with device
info for easy debug. Also, add swrm clock enable checks during SSR.
When SSR happens, swrm->hw_core_clk_en and swrm->aud_core_clk_en will
be reset without resetting audio_vote and core_vote clk. This would
cause clk mismatch in audio driver and adsp and device fails suspending
when there's no audio usecase. Make this change to reset audio_vote
and core_vote clk when receiving SWR_DEVICE_SSR_DOWN.

Change-Id: I9875aac9f6faf8b6481457a70f31b005073369e0
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-05-06 10:50:36 -07:00
Prasad Kumpatla
42e49611b0 asoc: common: correct buffer overflow array index Out of Bounds
Add range check for ch_cnt value to avoid buffer overflow.

Change-Id: Iad18ea2fa42057211dc98c9d80465687cbc62776
2022-05-04 03:30:39 -07:00
Srijan Magapu
77363afeba audio-kernel: I2S/TDM backend dai-links tertiary MI2S
Change-Id: I56cb744c0399b3f8e049c13c68ad0dbd7ead94a6
2022-03-31 18:48:37 -07:00
Srijan Magapu
4a4b666ba0 audio-kernel: I2S/TDM backend dai-links
Add support for I2S/TDM backend dai-links for Kalama target

Change-Id: I0504a030afc534207d2d40ba6fd7fcebb2bb40f1
2022-03-24 22:15:51 -07:00
Phani Kumar Uppalapati
0ceec6c1ac audio-kernel: select RCO clock if lpi PCM logging is enabled
Select clock root as RCO for VA use-case whenever LPI
PCM logging feature is enabled.

Change-Id: I461b2afb9eeb595975d550d56c54e7548f0f2130
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-02-27 23:55:47 -08:00
Phani Kumar Uppalapati
69448e2228 asoc: return correct index id for secondary mi2s stream-name
Check and return correct index id for secondary mi2s
stream name.

Change-Id: I4df832e6cfc0e5eeac047e8cd4ce42def3be4061
2022-02-23 09:15:50 -08:00
Srinivas Marka
86f969d03d asoc: add pm qos mixer controls
When device enters LPM, it hurts audio latency as
CPU spends more time in entering/exiting LPM.
Hence, for LL and/or ULL, LPM is disabled.
Add pm qos mixer controls for cpu affinity and
increase the delay for the cores to enter LPM mode.

Change-Id: I3aa2d17f6b3ec3ffad180205085bd2f4961858b7
Signed-off-by: Srinivas Marka <quic_smarka@quicinc.com>
2022-01-13 19:23:47 +05:30
Prasad Kumpatla
fd473434d7 asoc: common: modify the incorrect comparsion
In case of error scenario for get_tdm_clk_id/get_mi2s_clk_id, storing the
return value into uint32 clk_id which is always positive and does not handle
the invalid clk ids failure. So modify the incorrect comparsion.

Change-Id: I1e606709cd3c11a24a39679bcee638a045804961
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-12-07 09:16:02 -08:00
Harold Tan
31b4d5b834 asoc: msm_common.c: update stream name sanity check
In the function call get_mi2s_tdm_auxpcm_intf_index(...),
updated stream_name sanity check (if condition) to avoid
short-circuit scenarios causing FM Radio to be muted.

Change-Id: Ia3e500a49b4af2beda8af35d1f472662918d9c1b
2021-09-30 22:55:20 -07:00
Prasad Kumpatla
adf32e6429 msm: common: retrieve clk attribute for tdm and mi2s from dtsi
retrieve clk attribute for tdm and mi2s from dtsi.

Change-Id: Ie00ac5cf7c2e1d7ca56e27d291dfd6af3feb8d8f
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-09-06 23:44:21 -07:00
Aditya Bavanari
c46348987c asoc: common: Modify the logic for interface index check
Check if the interface index is either of TDM/MI2S/AUXPCM
to implement the common ops as the current index is valid
for other interfaces like CDC DMA as well.

Change-Id: I345a2b47185d6d56198061a17921fdfc2f5e3290
2021-09-06 22:09:36 +05:30
Srinivas Marka
c315833fa3 asoc: set card state to online after snd card registration
AGM might get initialized before sound card is populated
with all pcm nodes. This will lead to AGM parsing fewer
nodes and forms incomplete list of backends.

To avoid this, kernel module sets card status to ONLINE,
and AGM waits till the card status is ONLINE before parsing
for the pcm nodes.

Change-Id: I4b7f7085645706ba4351efe23ba048d3a177312c
Signed-off-by: Srinivas Marka <smarka@codeaurora.org>
2021-09-06 09:35:23 -07:00
Prasad Kumpatla
7277bb1171 asoc: common: add lpass hw core request
add lpass hw core request before request for the
set clk cfg in the case of primary and tertiary
interface along with fractional sample rate related
clock request.

Change-Id: I273e6963ee39e350c44e5bcf35427327b7189cd1
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-08-25 10:45:43 +05:30
Prasad Kumpatla
d8f2af06e6 asoc: common: configure mi2s interface clocks
Add support for mi2s interface clock configuration.

Change-Id: I439de17670d9521898d8bde893255025eceab84d
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-08-11 13:51:01 +05:30
Prasad Kumpatla
8201861fd3 asoc: common: fix null pointer access.
pdata return from msm_common_get_pdata may be NULL
and dereferenced.

Change-Id: Ied986d377f0fe8486c4be2c420d8d1b5f3868fd8
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-08-04 20:34:16 -07:00
Prasad Kumpatla
6b93e2c23b asoc: common: add support for tdm slots configuration
add support for the tdm slots configuration from dt.

Change-Id: I9fc9f81c4793c1b9eefe326af2db5259f35a2a4f
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-07-27 13:47:09 +05:30
Prasad Kumpatla
a40c1bebd9 asoc: msm_common: clock handling for tdm interface
Observed pop noise on TDM SPK AMP in the disable sequence. To resolve
the pop noise, TDM clock should be turned OFF after digital mute ,which is done
in machine driver for the disable sequence.

Change-Id: I9c8b5ef820cd8ec1e9a7d022e1938d53e2f401a1
Signed-off-by: Prasad Kumpatla <pkumpatl@codeaurora.org>
2021-07-19 15:26:42 +05:30
Vignesh Kulothungan
c02fc6e8c4 ASoC: update mi2s/tdm/auxpcm interface names
Update backend interface names as required by spf.

Change-Id: I10e5d64677e9ea2b70d53697d9df09ef8cae8612
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2021-05-20 17:47:42 -07:00
Rohit kumar
3b528eff50 asoc: msm_common: Fix pinctrl state during shutdown
Move pinctrl state to sleep instead of active during
mi2s shutdown.

Change-Id: I9dc1097a698d6ebd34ac3cedac99e95799a7fb66
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2021-05-13 04:17:09 -07:00
Meng Wang
f70e2d8de4 asoc: initialize rx_ch and tx_ch array before use
Initialize rx_ch and tx_ch array before use.

Change-Id: Id31c65101be2630a55b5b96bd3e35199758e243e
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-11 12:34:18 +08:00
Vignesh Kulothungan
dd4041eca5 ASoC: update channel map for rx multi codec usecase
Update the channel map and count to reflect all the codec
dais used by the backend dai link.

Change-Id: Id2a46210aadd8bb06eaea2ff50f8b1ddbe365105
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2021-04-27 01:56:04 -07:00
Harold Tan
fdab4dc6bf msm_common.c: fix dereference of pointer 'kctl_pdata' before NULL check
Change-Id: I8d7843b13cdfe3b0e1783acc662e4d06ae7a739a
Signed-off-by: Harold Tan <harotan@codeaurora.org>
2021-04-01 23:06:41 -07:00
Revathi Uddaraju
9d0e5be6b5 asoc: Add support for sysfs based SSR
Create sysfs node for SSR.

Change-Id: Ia181a51ae969632b739676b4b95e2bf0f50ce432
2021-02-22 01:57:49 -08:00
Jyotirmoi Sarma
a3d8911945 audio-kernel: asoc : Upgrade asoc to support 5.10 kernel
Change-Id: Ia54112cfbde418d66b9314d4ba731928aa057558
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-08 08:49:44 -08:00
Phani Kumar Uppalapati
f9c7c60107 asoc: change log mss level from pr_err to pr_debug
Change log level to pr_debug to avoid spurious log prints
in kernel messages.

Change-Id: I4ddacad8a5b2a143d3e46e683e3374f0449c05f6
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2020-09-22 23:43:31 -07:00
Phani Kumar Uppalapati
10bed4cd23 lahaina: add mi2s and tdm dai-links
Change-Id: I3d541b110cc849b6e323f4df55be208e153d65eb
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2020-09-16 01:39:22 -07:00
Ashish Jain
b1846bb750 asoc: msm_common: Use destination size for strlcpy
Fix compilation error due to strlcpy referring to source size
instead of destination size.

Change-Id: Ifcbb70342cefbeaf77575afd98780cd7fed0fac5
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
2020-07-08 06:33:09 -07:00
Phani Kumar Uppalapati
bc326d21fd audio-kernel: upgrade to ar/spf changes
Rename casa to ar and gecko to spf in audio-kernel.

Change-Id: Ia37ee0497ce043443ca70131d2739737cb8f0366
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2020-06-25 00:39:53 -07:00
Rohit kumar
ca765db76b asoc: kona: Add support for channel map mixer control
Add new mixer control to get channel map associated with
codec for Slimbus and Codec DMA interface.

Change-Id: Ie38c5b05a2a371a7f3801b1ab194546b39b5a3d6
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2020-06-25 00:35:51 -07:00
Ashish Jain
de3e09d08d asoc: Expose a sysfs node to notify device open/close.
Add support in kona machine driver to expose a sysfs node.
Userspace uses this sysfs node to notify machine driver
on which dai-link ( pcm id) is opened/closed. This information
regarding device open/close is then compared against shutdown/
startup dai_link ops. If there is a mismatch we conclude
that there has been a userspace service crash and we
issue a close all session command to dsp and also clear
all the dma buffers which were allocated by the service.

Change-Id: I4fc13adf8cc527c87b822a3b189d4ff081539a3c
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
2020-06-25 00:35:46 -07:00
Rohit kumar
f6eb3aac0f asoc: Add msm_common.c for I2S, TDM and AUXPCM interfaces
Change-Id: I675ec1f266a68c87882094d64055481305c6bdfb
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2020-06-25 00:35:13 -07:00