Commit Graph

3819 次程式碼提交

作者 SHA1 備註 提交日期
Junkai Cai
16acb739c4 soc: swr-mstr: Enable device wakeup only for tx macro
At bootup device wakeup enable is called for all masters
causing issue for wsa. This is because wsa
supports interrupts. Thus enable device wakeup
only for tx master.

Propagated this change from previous target.

Change-Id: Iade70defc599952b77b664b752cc55570b4aed27
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-25 23:12:05 -07:00
Junkai Cai
1f7c8acba3 soc: add check condition before enabling irq
propagated from component audio-drivers.lnx.5.0 with same time.
However, original 5.10 code includes the change functionally already.
Adding check when irq_get_irq_data returns NULL.

Original comments:
Enable interrupt request only when the interrupt is
in disabled state.

Change-Id: Ic5048d2fbddf53bd0e42536677bf5d935f4e0683
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-21 15:52:04 -07:00
qctecmdr
fa58ae98f9 Merge "asoc: codecs: update cb decode register control" 2021-08-15 08:15:12 -07:00
qctecmdr
6c5d480fb1 Merge "asoc: lpass-cdc: add put_autosuspend to pair with pm_runtime_get_sync" 2021-08-15 08:15:12 -07:00
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
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
3df9593b07 Merge "asoc: common: fix null pointer access." 2021-08-06 21:08: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
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
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
02c5a3aca7 Merge "asoc: common: add support for tdm slots configuration" 2021-08-02 20:56:04 -07:00
qctecmdr
e28a044a67 Merge "asoc: lpass-cdc: update logic for va clk switch" 2021-08-02 20:56:04 -07:00
qctecmdr
f0f7494128 Merge "asoc: lpass-cdc: avoid enabling VA_MCLk when requested clk is not default clk" 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
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
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
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
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
qctecmdr
a39bae0a48 Merge "Revert "dsp: add workqueue for audio_prm and pinctrl_lpi"" 2021-07-13 23:01:34 -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
eeab67787b Merge "dsp: remove ION_FLAG_CACHED for DMA buf heap" 2021-07-11 18:50:26 -07:00
qctecmdr
74848e76fe Merge "asoc: lpass-cdc: call runtime_suspend when vote fails" 2021-07-11 18:50:26 -07:00
Meng Wang
f01200e92b Revert "dsp: add workqueue for audio_prm and pinctrl_lpi"
This reverts commit 8b3578665b as
it would cause NOC issue.
Move clk reset and snd_event_notify from PD notification to
ssr_enable function to make sure these are done after GPR is
up.

Change-Id: I784ad03093846434313967bcf18c946b3ef18bfc
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-07-08 14:07:09 +08:00
Vikram Panduranga
1873045b4d dsp: remove ION_FLAG_CACHED for DMA buf heap
ION_FLAG_CACHED is no longer supported for DMA
buf heap. Remove cache maintenance as it can be
counter productive for CMA memory.

Change-Id: I13c58a4304269c6140fbca891cf718ab6a0eb2fe
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2021-07-06 09:25:56 -07:00
Sairam Peri 
bdc547ac12 asoc: wsa883x: add support for multiple WSA
This change is to remove the group write so that both the WSA slaves are
updated with the corresponding values for DRE CTL register.

Change-Id: I1f9583ff1ca3988b78896087b2f8e7409e4796fd
Signed-off-by: Sairam Peri <peri@codeaurora.org>
2021-07-06 18:29:05 +05:30
qctecmdr
f9c72af547 Merge "asoc: lpass-cdc: update WSA/WSA2 cooling option policy" 2021-07-01 05:25:05 -07:00
Meng Wang
7fea7ac663 asoc: lpass-cdc: call runtime_suspend when vote fails
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>
2021-06-28 13:10:48 +08:00
Vatsal Bucha
bb1b149345 ASoC: wcd-mbhc: Resolve warning log when mutex destroy before unlock
Resolve warning log when hph pa mutex lock is destroyed before
unlock. Initialize hph pa locks as global lock and do not destroy
during SSR to resolve issue.

Change-Id: Idc5af793294f7fdc8dbcc17770f68fe2c46ab337
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-06-27 21:07:36 -07:00
qctecmdr
671d354cf5 Merge "dsp: audio_prm: move mutex_init to module_init" 2021-06-27 12:35:05 -07: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
qctecmdr
47b9399ea3 Merge "ASoC: include: Remove obsolete header files" 2021-06-22 20:40:25 -07:00
qctecmdr
e15f70c21e Merge "asoc: lpass-cdc: update DMIC clk when WCD DMIC is selected" 2021-06-19 11:39:00 -07:00
Amitkumar H
2daa21da03 ASoC: include: Remove obsolete header files
Remove to avoid maintenance of code.

Change-Id: I093518ff11486df229ed5276c90e463250be5679
Signed-off-by: Amitkumar H <amih@codeaurora.org>
2021-06-17 20:52:03 -07:00
Meng Wang
a982e87448 dsp: audio_prm: move mutex_init to module_init
During SSR, prm_gpr_send_pkr may request g_prm.lock and
audio_prm_probe may reinitiaze g_prm.lock. When prm_gpr_send_pkr
unlock g_prm_lock, warning log will be there.
Move g_prm.lock init and destroy to module_init and module_exit.

Change-Id: Id410e55f9dee7c0dcb487591cda8fd21e01c7255
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-17 09:43:31 +08:00
Patrick Lai
ea9d97a198 dsp: adsp-loader: call proper APIs to shutdown DSP gracefully
Original implementation calls rpoc_report_crash API which yanks out
ADSP abrutptly without proper shutdown. This leads to NOC errors
being reported. Update adsp-loader to call proper shutdown API.

Change-Id: Ibf4bab1e8a8b63082ab4014fff298abcb8750118
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2021-06-16 12:59:30 -07:00
Meng Wang
500ce512d1 dsp: adsp_loader: Probe only after remoteproc is ready
This change checks whether the adsp remoteproc is ready or not
before probing the adsp loader. Since adsp loader is not useful
until the adsp remoteproc is ready, defer probe of the driver.

Change-Id: I659e67f0207707388c6484e58366637c1809d304
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-16 01:53:08 -07:00
Meng Wang
99b86b9f62 asoc: lpass-cdc: update DMIC clk when WCD DMIC is selected
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>
2021-06-16 01:51:57 -07:00
qctecmdr
5fa13c2cd8 Merge "dsp: add workqueue for audio_prm and pinctrl_lpi" 2021-06-14 12:59:22 -07:00
qctecmdr
984e5cd1f7 Merge "asoc: lpass-cdc: reduce WSA digital gain when cooling is enabled" 2021-06-14 12:59:22 -07:00
Meng Wang
8b3578665b dsp: add workqueue for audio_prm and pinctrl_lpi
GPR will deregister and register to audio notifier during
SSR. When ADSP up notification comes to pinctrl LPI before
GPR is registered to audio notifier. Pinctrl LPI will
reset core vote clks however GPR is not masked as up yet
which will causes audio hold clk mutex_lock for long time
and cause kernel panic.
Add workqueue for audio_prm and pinctrl_lpi to avoid hold
clk mutex_lock for long time to resolve this issue.

Change-Id: Idcd7c7d18709dbd5ae85e19eb2abfbed009ffab1
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-07 05:16:37 -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
Meng Wang
9cf7f24da5 asoc: swr-mstr-ctrl: return when requesting hw vote fails
In swrm_runtime_resume, when hw vote fails, it still requests
clk and tries to access gfmux which may cause kernel panic.
Update the logic to return when requesting hw vote fails.

Change-Id: I15d2913ae69bf7442ef504b588e0a55917a26071
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-07 10:20:07 +08:00
Vidyakumar Athota
6a50edfffc Revert "Revert "asoc: lpass-cdc: Do not update VA clk muxsel register""
This reverts commit a108d5c2bb.

Change-Id: Ie7d2bc6b05c62dff251cd80b2a4e81670e43108d
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2021-06-02 20:21:04 -07:00