Commit Graph

48 Commits

Author SHA1 Message Date
Prasad Kumpatla
3dd1953f31 asoc: codec: defer the probe if msm cdc pinctrl is not probed
Defer the probe when the msm cdc pinctrl driver is not
proded.

Change-Id: Ia6aaaca7c55b60b53008ffda0fc40e5db407cd2a
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2024-02-01 12:46:33 +05:30
qctecmdr
db5e3d22a0 Merge "asoc: wcd939x: Add conditional check before calling wcd usb api" 2023-11-08 20:45:05 -08:00
Sarath Varma Ganapathiraju
18b9c62542 asoc: wcd939x: Add conditional check before calling wcd usb api
Add conditional check before calling wcd usb api

Change-Id: I9046ece531ea009e8b8cd5db98675960d928c1c6
Signed-off-by: Sarath Varma Ganapathiraju <quic_ganavarm@quicinc.com>
2023-10-30 12:04:38 +05:30
Sam Rainey
556c4befcd asoc: wcd939x: Change OVP threshold
Change default OVP threshold to 4.2V, but set
to 4.0V during CODEC reset.

Change-Id: I4aa8accf7466e144902a2f6a250c1aad91084e95
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-10-26 16:25:00 -07:00
Sam Rainey
08bc673260 asoc: wcd939x: Support xtalk for high voltage mics
Update zdet and xtalk to support high voltage microphones
with improved accuracy.

Change-Id: I4b0af5ade7f653de4a938162302ec21c4a09891f
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-09-29 16:56:12 -07:00
Phani Kumar Uppalapati
3fca2376eb audio-kernel: wcd: Disable 1M Pull-up resistor
1M Pull-up resistor within WCD causes LPD (Liquid Presence
Detection) failures. So add support for disabling 1Mohm
Pull-up resistor. Re-enable it whenever wcd enters into
audio mode.

Change-Id: Ib3115315bc61d4e6126ddf688653182417d5d54d
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-08-15 19:27:16 -07:00
Eric Rosas
af6068fd31 asoc: codec: Unvote wcd939x vdd-px supply
When codec goes into suspend, disable vdd-px which
will cause an unvote in PM.

Change-Id: Ia9f958d67fc57dbf3932733797bce7b0eb742363
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-07-20 11:54:57 -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
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
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
qctecmdr
e1715432ea Merge "wcd939x: update register defaults for wcd939x codec" 2023-04-30 06:09:45 -07:00
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
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
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
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
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
Phani Kumar Uppalapati
ce393052e3 asoc: wcd939x: use half rate selection for HPH DAC
Harmonium supports full and half rate modes for DAC.
Update DAC rate to swr clkdiv2 to achieve better
power performance.

Change-Id: I136a064dc258ee839ea78c9f1051ba34521ac871
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2023-03-09 11:43:24 -08:00
Prasad Kumpatla
575a0b0dd1 asoc: wcd939x: update compander settings for wcd9395 codec
Update compander settings for wcd9395 codec.Default values
are sufficient to achieve better THD+N at max. volume.

Change-Id: If04539fc2f5dd9fd398997dbb6a32487ce45b788
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-07 12:50:59 +05:30
Prasad Kumpatla
2a86f48992 asoc: wcd939x: add support to update power modes on wcd-usbss
Get the wcd939x power mode of from mixer ctls and configure
same power mode to wcd-usbss.

Change-Id: I9dc8fe586f7e7608da542b0986bb7c605fc552d4
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-05 21:34:57 -08:00
qctecmdr
f11d3c6c07 Merge "asoc: wcd939x: remove unwant IRQ register" 2023-02-26 00:43:33 -08:00
qctecmdr
bcd24127e8 Merge "asoc: codec: Add 2Vpk support in WCD939X driver" 2023-02-15 11:11:23 -08:00
Prasad Kumpatla
ace2dd19df asoc: wcd939x: remove unwant IRQ register
For wcd939x LDORT_SCD_INT IQR register is removed, so remove
LDORT_SCD_INT register to avoid CMD ignore errors from RX SWR
while booting.

Change-Id: I6dfe6a1c32fddbcdbbf388b47efde60b6b4b5f35
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-02-14 13:00:22 +05:30
Sam Rainey
742849e4e9 asoc: wcd939x: Disable legacy surge protection
Disable legacy HPH surge protection
for certain platforms. Enable HPH over-current
protection for all platforms.

Change-Id: I147321417ad2152530a71b3990a7cbf064c9299f
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-02-08 17:10:00 -08:00
Sam Rainey
837696b627 asoc: codec: Add 2Vpk support in WCD939X driver
Add support for HPH 2Vpk output mode in the
WCD939X driver.

Change-Id: I44a84cde84f0feee6d7d1255e097a5ffb616f78e
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
2023-02-07 02:52:07 -08:00
qctecmdr
a116a9c2f0 Merge "asoc: wcd939x: update correct HPH class h power modes" 2023-02-03 11:08:36 -08:00
Eric Rosas
ebcfc03c12 asoc: codec: Change default CFG0 value
Change CFG0 register value from 0x07 to 0x05.

Change-Id: I0da0e7e754657c66679bd7844616328b2774301c
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
2023-02-01 22:58:15 -08:00
Prasad Kumpatla
df0977f834 asoc: wcd939x: update correct HPH class h power modes
update HPH power mode comparison with mixer ctls enum names,
so this will pick the correct compander coeff values depends on modes.

Change-Id: I42cdfeceda4c4bac960b71bbd62d0e8528680490
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-31 00:27:37 +05:30
Prasad Kumpatla
1cb456dd0e asoc: wcd939x: update power mode for LOHIF
update power mode for LOHIFI.

Change-Id: Ifc7a3061a3c54d768976e7ae3a1378ff3e907d5a
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-23 11:02:34 -08:00
Prasad Kumpatla
17a7fb3f4d asoc: Add support for 11P2896MHz RX clk config
1. Update RX CLK config for 11P2896MHz.
2. Add condition to update Droop sel coeffs for 11P28MHz
   and 9P6MHz RX CLK.
3. Upate SWR port config for 44.1Khz sample rate usecase.
4. Unselect RX_TOP.SWR_CTRL(0x6AC0008) for RX CLK 11P28MHz.
5. Update HD2_CTL L/R registers as per latest seq version.

Change-Id: Ifac2c03e3d1bf522fe2a4d942341d9071a1e6239
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-11 11:19:54 +05:30
Prasad Kumpatla
33f464c16b asoc: wcd939x: for PCM mode no need to enbale PDM interrupts
For PCM mode no need to enbale PDM interrupts, so add condition
to skip for register of PDM interrupts. Also avoid unwanted register
writes for PCM mode.

Change-Id: I4675a7ffe94d1f8628a4f539829f5aa83544cf8d
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-06 00:09:59 -08:00
Prasad Kumpatla
59bb6d4de4 asoc: wcd939x: update registers based on latest version
update register based on latest version and add conditional
check to enable PCM path.

Change-Id: Ib2fe0b477adfa07bef52954993fbd6aae011500a
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-06 13:31:11 +05:30
Prasad Kumpatla
d4626706b1 asoc: wcd939x: update port config for pcm path
update port config parameters for hph pcm path.

Change-Id: I2f8fd56a4d562f92c80c8997a98f5f3436411dfa
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-05 00:37:50 -08:00
Prasad Kumpatla
334bb47082 asoc: codec: update registers based on hph mode
update registers based on specific hph mode before compander
config.

Change-Id: Iea4f2bc5521dc701bd52ce8fe24323b1f9d96045
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-05 00:36:42 -08:00
Prasad Kumpatla
7934eb5971 asoc: codec: add support to enable/disable HPH PCM path
add mixer ctl to enable/disable HPH PCM path on WCD939x.

Change-Id: I4b3eadf4f57813b0a861848e0a0cb842749ff764
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-05 00:32:21 -08:00
Prasad Kumpatla
76f60e792b asoc: codecs: add support for xtalk
add support for xtalk on wcd939x.

Change-Id: I3aac6196363f2032e8ff453ca3cf52143bafcd0e
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-05 00:32:05 -08:00
Prasad Kumpatla
d0220474be asoc: codec: add support for compander enable and disable
add support for compander to enable and disable for HPHL and HPHR
in wcd939x.

Change-Id: Ib7aa96bd9faac7389b38f01baff0a93c646f84f2
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-05 00:31:42 -08:00
Prasad Kumpatla
8dcd87dafa asoc: wcd939x: update variant as per wcd codec
On wcd939x contains only one variant. Sometimes reading
for codec variant which is giving incorrect/unsupported,
due to this incorrect mixer ctl are picked. So Wcd939x 
is updated with supported variant WCD9395.

Change-Id: Ie556350b3630b6f1f76a4b2af1db795f908f13d4
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-11-29 10:52:17 +05:30
Yuhui Zhao
c9ec60ea62 asoc: wcd: add NULL pointer check for wcd component
add NULL pointer check for wcd component.

Change-Id: Icfba04b689ace34f8f82b3ee58dd79ce139861b5
Signed-off-by: Yuhui Zhao <quic_yuhuzhao@quicinc.com>
2022-10-27 22:25:04 -07:00
Prasad Kumpatla
5d647662c7 asoc: use BIAS_LEVEL_OFF for LPM trigger
Use BIAS_LEVEL_OFF trigger from ASoC to mark the wcd/wsa power
supplies to LPM (if supported).

Change-Id: I89f232f9338168b99ae03f84318c21734b592f82
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-13 16:20:22 +05:30
Prasad Kumpatla
3a37e5dfa1 asoc: codec: add muxs in wcd939x
add mux in b/w IN1/2 and RX1/2 for configuring xtalk and
compander in hph pcm sequence.

Change-Id: I5ee97017585d03e0ef83841bbccef5982d79b9d9
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-12 23:44:41 -07:00
Prasad Kumpatla
22ff866d46 asoc: codec: wcd939x: enable and disable rx clks
enable and disable rx clks.

Change-Id: I9b5729331ede14381f028c763b8fb5a4eb2f13dc
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-12 23:44:38 -07:00
Prasad Kumpatla
23b1088e9f asoc: codec: add support for wcd939x for pineapple target
Update wcd939x api and marcro in pineapple driver
Update wcd939x macro in wcd939x driver.

Change-Id: Id87fc550e0a3aff61efee61644fd6bc15ea7c66d
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-12 23:44:35 -07:00