Commit Graph

1731 Commits

Author SHA1 Message Date
Sam Rainey
dc708f8a73 asoc: wcd939x-mbhc: Add zdet ramp down timeout
Add impedance detection ramp down timeout after a given interval.

Change-Id: Ia03bc82ec0bb653e6ccd1b6d14c1a9cb996e8ecd
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-07-05 11:51:40 -07:00
qctecmdr
eff813c736 Merge "asoc: codec: Add surge reset routine for wcd939x" 2023-06-29 19:10:27 -07:00
Eric Rosas
4d7a95f88e asoc: codec: Add surge reset routine for wcd939x
Enable wcd939x surge reset routine. Add callback for
the event within mbhc and enable it for wcd939x.

Change-Id: Iabc8c3367ae2eca5982db4526c6860e5eba63b76
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-06-29 14:17:16 -07:00
Sam Rainey
68eb5f668d asoc: wcd939x: Add linearizer support
Add linearizer software changes, including calculating and writing
software calibration codes.

Change-Id: I964c23cbd1806c25d422bac606ed51e5dc0212e3
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-06-29 08:52:25 -07:00
Sam Rainey
4e6ea745c2 asoc: wcd939x: Update MBHC zdet and xtalk
Update MBHC zdet for Harmonium 2.0. Update impedance parameters and
xtalk implementation.

Change-Id: I85e0a5c8816cd54d4892a10ac18bdf1420e92e89
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-06-29 08:50:27 -07:00
qctecmdr
069af6015e Merge "asoc: wcd939x: Use local trim for version 2.0" 2023-06-29 04:43:40 -07:00
qctecmdr
c9aa83ed22 Merge "asoc: wcd939x: add support for 2Vpk and 1.4Vpk modes" 2023-06-29 01:12:50 -07: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
Phani Kumar Uppalapati
1ddeec779c asoc: wcd939x: Use local trim for version 2.0
For test program < 3, use local default trim values
for harmonium 2.0 version.

Change-Id: I8cdcbe83ddae4626cef1f3dc4bfab3b2c285a0ca
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-06-27 10:15:50 -07:00
Phani Kumar Uppalapati
429f5cc596 asoc: wcd939x: add support for 2Vpk and 1.4Vpk modes
Update wcd939x register settings for 2.15V VDD_RX supply
and for 2Vpk and 1.4Vpk modes depending on the headphone
load impedance values.

Change-Id: Iae5e6087fe96d22c9b9f8b755c468d2e6dface4e
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-06-27 10:13:48 -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
qctecmdr
0709b47e97 Merge "asoc: wcd939x: avoid static sbu1/2 connections to gnd/mic" 2023-06-11 09:17:21 -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
Phani Kumar Uppalapati
e6eac8ce72 asoc: wcd939x: avoid static sbu1/2 connections to gnd/mic
Currently on pineapple CDP platform, sbu1/2 switches are always
pre-connected to gnd/mic of the jack. Avoid this static connection
and connect/disconnect only when headset insertion/removal is detected.

Change-Id: If3bef6834caeb539492304d8b16808cd09c5afab
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-06-05 11:32:47 -07:00
karishma Tekade
b6e311a3d8 audio_kernel: Fix compilation issues during kernel upgrade
Updated WCD937x, WSA881x-analog and bolero drivers for successful
compilation on kernel6.0 for holi.

Change-Id: Ia91a999f825570b3d7123842f0aad3740c4d25ed
2023-05-23 22:46:24 -07:00
Karishma Tekade
1ed2ece8c4 audio_kernel: Enable audio kernel compilation for blair platform
Updated make files in audio_kernel to support blair platform.

Change-Id: I00c832875fc4558580e22825e9a72305e05ae409
2023-05-23 22:44:18 -07:00
Prasad Kumpatla
2d7bcd0ba2 asoc: wcd939x: update HPH PCM playback sequence
Update start up sequence for headphone pcm playback
for better performance.

Change-Id: If9edcb619c657947724e072788f2d3b8ea3d21af
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-05-18 00:00:29 +05:30
Kunlei Zhang
de2c1d0cf9 asoc: lpass-cdc: clear active channel cnt if channel is active
Clear active channel cnt if the channel has enabled.

Change-Id: I364f4253398e8d42c3d9e3d44cce7f65c5863bf7
2023-05-09 10:32:39 +08:00
Yuhui Zhao
5990a54d8e asoc: lpass-cdc: add enable check before tx mixer put
Check whether tx channel had been enabled or disabled before
tx channel set.

Change-Id: I1f2e0132f0905a53df989b5d52370c4dfdf7d99b
2023-05-04 12:10:41 -07:00
qctecmdr
a8496e9bf4 Merge "asoc: wcd-mbhc: skip AATC switch settings for SSR/PDR" 2023-05-01 03:16:37 -07:00
qctecmdr
e1715432ea Merge "wcd939x: update register defaults for wcd939x codec" 2023-04-30 06:09:45 -07:00
qctecmdr
b8506aa704 Merge "asoc: wsa884x: update INTR_CLEAR0/1 register to volatile" 2023-04-30 06:09:45 -07:00
Prasad Kumpatla
23853e3c76 asoc: wsa884x: update INTR_CLEAR0/1 register to volatile
In PDR cases INTR_CLEAR registers values are not updating
properly while doing reg_cache in recover from PDR. So add
these registers as volatile to get the exact HW values.

When these registe values are properly updated the FSM_PA
status is reseting properly and working.

Change-Id: I8fa7b01b3256ec8f01edc3fe48a519accfff9638
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-28 10:46:38 +05:30
Prasad Kumpatla
9a5bca98b7 asoc: wcd-mbhc: skip AATC switch settings for SSR/PDR
In SSR/PDR usb switch settings won't be reset in wcd939x-i2c
driver. So no need to do switch settings for AATC when recovering
from SSR/PDR. Depends on the status to avoid AATC switch settings
again after  SSR/PDR.

Change-Id: If7fc2a84356a406e9cf7e6cc557e19584fda3969
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-28 10:39:37 +05:30
Eric Rosas
f0358171bf asoc: codec: Fix WCD939X readable reg check
Add static variable to store version to avoid improper
device pointer in wcd939x_readable_register().

Update WCD939X_NUM_REGISTERS macro to be correct size.

Change-Id: Ib594f2f799ac2202ff78c02ccf2f6cdb80ffd38e
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-04-27 14:55:10 -07:00
Phani Kumar Uppalapati
eb6008aebf wcd939x: update register defaults for wcd939x codec
Few register default values are incorrectly set for harmonium
codec in the register map table. Fix it by setting correct
values as per the hardware interface documentation.

Change-Id: Ibcb517d6050a4932243ead396e6f89294aab4a23
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-04-26 16:02:12 -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
Prasad Kumpatla
312d94f693 asoc: mbhc: change special HS pr_debug
change the debug print from wcd_mbhc_adc_check_for_spl_headset
func to caller wcd_correct_swch_plug function.

Change-Id: Iabca7351a1abb1ad7b3de15812b4a6014a0463ad
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-18 22:28:29 -07:00
qctecmdr
db55976826 Merge "asoc: wsa884x: add null check for wsa884x->component" 2023-04-16 08:07:36 -07:00
qctecmdr
8b0e3889df Merge "audio-kernel: remove unused uapi headers" 2023-04-16 08:07:36 -07:00
qctecmdr
d3f75e675d Merge "asoc: mbhc: enable l_det_en bit" 2023-04-16 08:07:35 -07:00
Prasad Kumpatla
1ea2687052 asoc: wcd939x: Update register sequences for wcd9395 v2.0
Check and update register sequences for wcd9395 version
2.0.

Change-Id: I85fc739744ee2ba2c5dbdc853eb639b84cac6478
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-15 07:55:43 -07:00
Prasad Kumpatla
1399d39839 asoc: mbhc: enable l_det_en bit
enable l_det_en bit while detecting the HS.

Issue: While removing HS some additional electrical interrupts
are triggered and reporting different events to userspace, which is
cause issues. To avoid this electrical interrupt flow, there is
a check in adc_hs_rem_irq for wcd_swch_level_remove() to check
for l_det_en bit status. Depends on this it will return from the
adc_hs_rem_irq() without going further.

Solution: Enabling the l_det_en bit will helps to avoid serving
electrical interrupt flow to further in adc_hs_rem_irq().So this
will helps to stop reporting different/unwanted events to user space.

Change-Id: I29d72b65ebb59969b69f3f8c7f4c7eb2debb0f1c
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-12 11:12:31 +05:30
Prasad Kumpatla
58a039c9e6 asoc: wsa884x: add null check for wsa884x->component
add null check before accessing for wsa884x->component.

Change-Id: I0694ad6426317f2f80d5084125c5b24876f96a65
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-11 13:43:09 +05:30
Phani Kumar Uppalapati
664c7a5ac6 audio-kernel: remove unused uapi headers
Remove unused uapi headers and structures for AudioReach
architecture.

Change-Id: I7b7718f118f2c7295aa0a741c1259ab76104de6c
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-04-08 09:55:27 -07:00
Ganapathiraju Sarath Varma
7f605534e2 asoc: wsa88XX: Enable/Disable swr ports based on setbit.
During some concurrencies even though we are not
enabling the swrm port, we are trying to disable it.
which causes problem w.r.t clock disablement,
To avoid that we are updating the set bit only
when port is enabled, based on that bit we are taking
decision to disable or enable the port.

Change-Id: I6707c56c40dd3716917edc097c4b7bcad68261fd
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-04-04 22:20:42 +05:30
qctecmdr
04a1c53fe1 Merge "soc: define ratelimit for prints to avoid flooding of logs" 2023-03-31 06:25:59 -07:00
qctecmdr
d3f8aa4eb7 Merge "asoc: codec: Update wcd939x-usbss mode" 2023-03-30 08:32:56 -07:00
qctecmdr
f481fa25f5 Merge "asoc: wcd939x: Add xtalk cancellation gain updates" 2023-03-30 08:32:56 -07:00
qctecmdr
2bb2cabe85 Merge "asoc: wcd9395: Add support for WCD9395 EAR path" 2023-03-30 08:32:56 -07:00
Prasad Kumpatla
ecbb93d98d soc: define ratelimit for prints to avoid flooding of logs
Change-Id: I7aa38c992716152ebb336190d9d3cd2e9a60e8e0
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-30 05:33:58 -07:00
Phani Kumar Uppalapati
ec43052bb3 asoc: wcd9395: Add support for WCD9395 EAR path
Add support for WCD9335 EAR playback path.

Change-Id: I643beaa4d27f279621202893062419ce2a3e96ed
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-03-29 22:13:16 -07:00
Yuhui Zhao
6b2a5ea4d9 asoc: lpass-cdc: add null pointer check in register_notifier func
Add null pointer check in register_notifier funcion.

Change-Id: Icba3776cbf33095dc8bdf32ed7b6c749e639a11b
2023-03-29 21:41:20 -07:00
Sam Rainey
bdf4011578 asoc: wcd939x: Add xtalk cancellation gain updates
Add scale and alpha register value updates based
on computed digital xtalk cancellation gain.

Change-Id: I8c12e2ba7c1566476741fec5459a74549f19cf5f
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-03-29 16:48:50 -07:00
Eric Rosas
f66738f4db asoc: codec: Update wcd939x-usbss mode
Update wcd939x-usbss mode on PA enable and disable.

Change-Id: I73a19ea73102ced5c8011a5a1567ebfa372b2e44
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-03-29 13:41:27 -07:00
qctecmdr
3038c0281b Merge "asoc: wsa884x: update uvlo registers for wsa884x" 2023-03-29 05:37:18 -07:00
qctecmdr
ed2fbe492d Merge "asoc: lpass-cdc : Enable wsa clks during DAPM powerup sequence" 2023-03-29 05:37:18 -07:00