Commit Graph

1436 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Meng Wang
a108d5c2bb Revert "asoc: lpass-cdc: Do not update VA clk muxsel register"
This reverts commit 57fa62e292.

Change-Id: I1afb0d2f7495d3b30fc99bb4391eda094921fa89
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-27 09:15:15 +08:00
qctecmdr
798c3db8d9 Merge "asoc: lpass-cdc: Update core voting before gfmux access" 2021-05-25 20:42:48 -07:00
qctecmdr
f98485fa87 Merge "bolero: tx-macro: Fix link status not connected issue due to clk not enabled" 2021-05-25 20:42:48 -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
Vatsal Bucha
c5698c8a0b bolero: tx-macro: Fix link status not connected issue due to clk not enabled
Sometimes link status is not connected due to tx_mclk_users
not being properly updated. This is due to tx_mclk_users
enable and disable not being protected by common mutex lock.
Add mutex lock whereever it is accessed to resolve issue.

Change-Id: Ibba208be1f2d3eaf63c49e434c2ae48bc3b5b2d8
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-05-24 01:44:55 -07:00
Meng Wang
57fa62e292 asoc: lpass-cdc: Do not update VA clk muxsel register
Because of a HW limitation in DSP, while switching
RCG from TX MCLK to VA MCLK for SVA use cases
a glitch is seen on AHB bus leading to data
corruption in registers.
So, while doing a mux switch for VA RCG clock selection,
do not configure the muxsel register in HLOS as it is
taken care in DSP itself as a workaround for HW limitation.

Change-Id: Ie36ff239689e634f5c29ad03b343b95de2d12547
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-24 09:21:56 +08:00
qctecmdr
43c99c7f0a Merge "asoc: lpass-cdc: disable clk when they are enabled" 2021-05-22 11:31:19 -07:00
Meng Wang
cc0d0bf564 asoc: lpass-cdc: disable clk when they are enabled
Check if clk is enabled before disabling it to avoid
warning log during adsp SSR.

Change-Id: I916af6f9efacfe3d08e0b05dcc0c6023944369d2
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-18 08:38:24 -07:00
Soumya Managoli
afde3b3eb2 asoc: bolero: Update PCM_RATE based delay for amic
The PCM_RATE bit field in LPASS_TX_CDC_TXn_TX_PATH_CTL
ranges from 0 to 6.
In the current implementation of tx-macro, the value
read is mapped directly to the sample rate instead of
the indices. Change is to correct this.
Add the delay based on pcm_rate in va-macro as well.

Change-Id: I6cb7e58e71f2a25356608611f1dfed83171706f6
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2021-05-17 06:03:13 -07:00
qctecmdr
f1b8ccfee3 Merge "asoc: remove makefile for Rouleur codec" 2021-05-16 02:18:46 -07:00
qctecmdr
9da8af1eaf Merge "asoc: swr-haptics: Toggle swr-slave-vdd supply for SSR recovery" 2021-05-16 02:18:46 -07:00
Fenglin Wu
0538dab88c asoc: swr-haptics: Toggle swr-slave-vdd supply for SSR recovery
After ADSP SSR happened, toggle swr_slave_vdd before play to reset
haptics HW so that it can function properly.

Change-Id: I48bc07c923d1af2041c6c156c699e329084f0d34
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2021-05-13 06:50:19 -07:00
Meng Wang
8a3a9fcd5d asoc: remove makefile for Rouleur codec
Remove makefile for Rouleur codec.
Remove usage of shell command and update absolute path cmd
for AUDIO_ROOT.

Change-Id: I1589c688639892b7628914a3777632466949d000
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-13 04:17:13 -07:00
Meng Wang
b16ebebc97 asoc: mbhc: avoid unregister extcon device when ssr happens
MBHC extcon device is unregistered when adsp ssr happens and causes
kernel panic. Avoid unregistering MBHC extcon device in mbhc_deinit.

Change-Id: I69fa057a480ebadaf324ca1f61bf399c176e3b2d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-13 04:17:03 -07:00
Fenglin Wu
7d939baa46 asoc: swr-haptics: add non-HBoost regulator support
Haptics module is supplied by HBoost regulator by default, it requests
voltage to HBoost regulator through hardware channel. Haptics module
can also be configured to use other regulator device, in this case, it
requires software to request the voltage from the regulator before
enabling the play. Add support for this.

Change-Id: I4a8305ff2732a92bc8be90bd3ed197fa643a101e
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2021-05-13 04:16:27 -07:00
qctecmdr
468257a3a6 Merge "asoc: lpass-cdc: update sequence of HIFI FIR coeff number" 2021-05-11 06:51:11 -07:00
Fenglin Wu
e3c6149759 asoc: codec: swr-haptics: update slave-vdd regulator control logic
Update the slave-vdd regulator control logic to avoid unbalanced
regulator_enable() regulator_disable() calls. Meanwhile, correct
the jump label when bailing out from soundwire enumeration failure.
This helps to avoid the regulator_put() call in the device remove
process throwing a warning for a dangling regulator enable status.

Change-Id: I89157f5f9177db69bbbf6aedcc8e605c43a7584e
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2021-05-08 08:55:44 -07:00
Junkai Cai
b5edf3ad18 asoc: lpass-cdc: update sequence of HIFI FIR coeff number
The number of HIFI FIR coeff will not be retained if power collapsed,
need to be written right before FIR_START is kicked off.

Change-Id: I034949eb7748f8b2e5b21445fa10f4f1df66a7bf
2021-05-08 08:48:19 -07:00
Aditya Mohan
7cc7e513af asoc: CPS mixer control
Add support for getting logical device
number using mixer control required
for CPS

Change-Id: Ia710b8cb5a5a099139b25afedb7723d93468cc6b
2021-05-05 07:22:48 -07:00
Linux Build Service Account
baccca3aaa Merge "asoc: mbhc: add extcon device for MBHC" 2021-05-02 22:55:47 -07:00
Linux Build Service Account
48f26271e5 Merge "asoc: lpass-cdc: Support up to 200 coefficients for HiFi FIR" 2021-05-02 22:55:46 -07:00
Linux Build Service Account
0ad49f6f8a Merge "asoc: bolero: update incorrect bolero register" 2021-05-02 22:55:45 -07:00
Linux Build Service Account
e5940a24c3 Merge "asoc: lpass-cdc: Update default tables as per v2p5" 2021-05-02 22:55:44 -07:00
Linux Build Service Account
ffb2dac19d Merge "ASoC: codecs: fix a typo of dapm string concatenate" 2021-05-02 22:55:39 -07:00
Linux Build Service Account
03011b6324 Merge "ASoC: update channel map for rx multi codec usecase" 2021-05-02 22:55:39 -07:00
Linux Build Service Account
3a0df1d928 Merge "asoc: msm_hdmi_codec_rx: add 44.1kHz support for DP playback" 2021-05-02 22:55:38 -07:00
Linux Build Service Account
92567454a0 Merge "asoc: wsa883x: Update wsa8832 DRE gain" 2021-04-29 18:25:15 -07:00
Junkai Cai
2df3cd8d48 asoc: lpass-cdc: Support up to 200 coefficients for HiFi FIR
Previously code will not write coefficients if there are exactly 100 coeffs
in first coeffs write. Or if user update coeffs on the fly with one group
unchanged.

Change-Id: Id4e8af06dec6b247f4a79a797d5b61668fd1e7f4
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-04-29 11:00:33 -07:00
Linux Build Service Account
ccc1bcc38e Merge "lpass-cdc: rx-macro: AUX path has no compander support" 2021-04-29 04:03:23 -07:00
Linux Build Service Account
654666cdf2 Merge "asoc: wsa883x: Update OTP_REG_0 as volatile reg" 2021-04-29 04:03:21 -07:00
Laxminath Kasam
b5bc4627f2 asoc: wsa883x: Update wsa8832 DRE gain
Reduce WSA8832 SKU DRE gain offset by
1p5dB same as WSA8830

Change-Id: I949bd78e2f4e935e1aba7ce0e2319418562e14ac
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-04-29 13:49:31 +05:30
Meng Wang
ecf424366e asoc: mbhc: add extcon device for MBHC
Add extcon device for MBHC.

Change-Id: I2f22223bc62f4f4b5f2e8cb61cf7e7d41548947f
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-04-29 10:04:21 +08:00
Laxminath Kasam
05e8d4faa8 asoc: lpass-cdc: Update default tables as per v2p5
Update regmap default entries of spk protection
registers as per lpass cdc version 2p5.

Change-Id: I7c966eb3edbe9a9c065c03220ef2b9390b1fc723
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-04-27 14:20:03 +05:30