Commit Graph

1430 Commits

Author SHA1 Message Date
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
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
Junkai Cai
6d66c41d46 ASoC: codecs: fix a typo of dapm string concatenate
SWR DAC_PORT string should be defined as SWR DAC_Port
This was causing "ASoC: unknown pin" issue.

Change-Id: I31ce7bf983b3793f8e4ee9702f5df021a89fd389
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-04-26 17:01:39 -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
Harold Tan
5f4dbcb2f5 asoc: msm_hdmi_codec_rx: add 44.1kHz support for DP playback
Change-Id: Iaf45d62b8250c7e54e86018822805ca52a9d5941
2021-04-26 11:50:04 -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
Meng Wang
f3aa1cddc4 asoc: bolero: update incorrect bolero register
Update incorrect bolero register for default value.

Change-Id: Ifa14f3b5dd73971e5c6b15ab58f70074b3a74408
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-04-26 05:47:04 -07:00