Commit graph

3960 Commits

Autor SHA1 Nachricht Datum
Phani Kumar Uppalapati
2f03655808 asoc: wsa883x: update irq_drv_data per wsa device
regmap_irq_chip->irq_drv_data is shared by all attached wsa
devices and point to last probbed wsa device. This will cause
interrupt handle issue. Update irq_drv_data per wsa deviece to
resolve this issue.
(cherry-picked from commit 1852682fbcebfb9f479c3d09a91c075049b90253)

Change-Id: I6ac0520a4074d74dfb28122e06eed6a86374c0ce
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-03-31 19:12:51 -07:00
Phani Kumar Uppalapati
cace0a8255 ASoC: wsa883x: Handle PA_ERR interrupt on WSA speaker
PA_ERR can happen during speaker path setup. Log the
error status in the interrupt handler and clear the error
status for next audio playback to resume properly on
the speaker.

Change-Id: I0490d4cdd6379ed779ce7f54ec8b56d5a7af0649
Signed-off-by: Phani Kumar Uppalapati<quic_phaniu@quicinc.com>
2022-03-31 19:12:33 -07:00
Kunlei Zhang
d007a64c4b asoc: codecs: update WSA dapm_ignore_suspend pin names
Update to 5.15 kernel dapm api.
Pin name no longer needs prefix as it is added in API.

Change-Id: Ibf967dd01a36decdf904eff9d5af2e315aa53f1c
Signed-off-by: Kunlei Zhang <quic_kunleiz@quicinc.com>
2022-03-31 19:12:14 -07:00
Meng Wang
2a7c4c286e ASoC: wsa883x: Enable all WSA interrupts
Only UVLO_irq, PA_ON_ERR_IRQ and PDM_WD_IRQ are enabled
on wsa883x. Enable all other IRQs to monitor if WSA is in
bad state.

Change-Id: Ia78f12520eda4b26c00776583a78b14b74771e0e
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-03-31 19:11:51 -07:00
Meng Wang
b19ddc0ca2 asoc: wsa883x: update default value for VBAT_ATTN
With current setting for VBAT_ATTN1/2/3, pop is heard when
battery is low. Update default value for these registers
to resolve pop issue.

Change-Id: Ic4002a4b30ecd04b04001ca5f16bac5745a803d7
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-03-31 19:11:37 -07:00
Meng Wang
e13418a3ca asoc: wsa883x: add support for updating analog gain
Add support for updating analog gain.

Change-Id: Icb090a86672d154bb0a8e22ce7fffeccea060604
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2022-03-31 18:51:47 -07:00
qctecmdr
2e08677b22 Merge "asoc: codecs: Add WSA init reg writes" 2022-03-30 22:27:10 -07:00
Matthew Rice
5403d47a9a asoc: codecs: Add WSA init reg writes
Update to latest sequence from WSA hardware systems team.
Add writes for VADC, BG, Boost

Change-Id: Ic61e1c36154ff673fce05546332e89fe683a3075
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-24 22:30:07 -07:00
Matthew Rice
f5d8dd3262 asoc: codecs: Add RX 6,7,8 to WSA Macro
Add new lpass RX paths. Needed to fix
WSA ADIE Loopback.
Update DAPM enum length to include these RXs.

Change-Id: Ie174cfab20b8beb103eefa94636e76ad756c7345
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-24 22:24:35 -07:00
Srijan Magapu
4a4b666ba0 audio-kernel: I2S/TDM backend dai-links
Add support for I2S/TDM backend dai-links for Kalama target

Change-Id: I0504a030afc534207d2d40ba6fd7fcebb2bb40f1
2022-03-24 22:15:51 -07:00
Shiv Maliyappanahalli
cb778a4ecd asoc: add ext-display module dependencies
Enable CONFIG_MSM_EXT_DISPLAY and link external display module
in audio to enable displayport audio.

Change-Id: I43f8821ec7612422b6a09c9631b038ceb17b1e44
2022-03-15 05:26:21 -07:00
qctecmdr
906c4aaa44 Merge "asoc: codecs: Resolve checkpatch errors" 2022-03-15 04:03:28 -07:00
Josh Kirsch
abf15450cf audio_kernel: update for techpack related compilation
Change-Id: I7440bf5c0f78c1889112a4de92f5341c817dd713
2022-03-15 02:39:24 -07:00
Shazmaan Ali
b62c934b61 asoc: codecs: Resolve checkpatch errors
Change-Id: I33dca97f388b524c7476e0da0ea8b1cbca4b849c
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-03-15 02:39:22 -07:00
Matthew Rice
2e70df2efe asoc: codecs: Add checking of WSA SWR dt params
Add to avoid crashing related to device tree parsing
of SWR port params.

Change-Id: Id839cc908fb5f7843e5fd6260b3205c8844349ba
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-10 10:18:23 -08:00
Matthew Rice
9d7405ec04 asoc: codecs: Fix Bolero and WSA out-of-range variables
Found potential issues relating to uninitialized or out-of-bounds variables
present in codec drivers. Place checks to ensure proper ranges are used.

Change-Id: Ib68cba2413788a57237f1f18fc5ce5fb5c6bfb0a
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-02 22:02:03 -08:00
Meng Wang
018369d65f soc: swr-mstr-ctrl: remove FIFO_Flush for overflow
FIFO_Flush should only be for SWRM_INTERRUPT_STATUS_CMD_ERROR.
For other usecase, it should not be flushed otherwise it would
cause register write mismatch and cause some sideeffect.

Change-Id: I6d40a30129dfdf48993125fb57042ab97a13a631
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-03-02 22:02:00 -08:00
Matthew Rice
3a6ef472dd asoc: codecs: Enable custom WSA SWRS port settings
For PBR and CPS ports, need the ability to customized slave
SWR frame OFFSET1 settings. Add similar method to WCD TX where
offset1 and lane_ctrl parameters are parsed from WSA device tree
and configured in SWRM.

Change-Id: Ib973ed93d9daa5ba02461a156e5b0a8c816d371e
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-02 22:01:34 -08:00
qctecmdr
8d3fde6573 Merge "asoc: Fix PBR SWR port config" 2022-03-01 20:51:35 -08:00
Matthew Rice
dd886964e0 asoc: Fix PBR SWR port config
Update HSTOP from 0 to 8 to match configuration.
Also fix slave ch en from 2 ch to 1 ch.
This fix resolves port collision/bus clash issues.

Change-Id: I91c6fe80a9db88d029e4ef81c7a06480a767b170
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-28 08:36:55 -08:00
Matthew Rice
0aca66e5fe soc: swr-mstr-ctrl: Add a uniq CMD_ID for every slave action
For all FIFO_WR/RD_CMDS, add function that increments cmd_id
every time for easier sw debugging.

Change-Id: I53d133d9b427dd6b80201aab3c6f367600e82bfc
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-28 08:36:52 -08:00
Phani Kumar Uppalapati
2b5f3e4778 va-macro: Use DT property for selecting the clock ID
Use device tree property "qcom,use-clk-id" for selecting
the clock ID for VA Macro operation.

Change-Id: I759c690ab7f6dc7ca023d5954e9b445a7b91b1b6
2022-02-28 00:18:39 -08:00
Phani Kumar Uppalapati
0ceec6c1ac audio-kernel: select RCO clock if lpi PCM logging is enabled
Select clock root as RCO for VA use-case whenever LPI
PCM logging feature is enabled.

Change-Id: I461b2afb9eeb595975d550d56c54e7548f0f2130
Signed-off-by: Phani Kumar Uppalapati <quic_phaniu@quicinc.com>
2022-02-27 23:55:47 -08:00
Matthew Rice
b6785ab5bc soc: swr-mstr-ctrl: Remove SI_HIGH write if > 0xFF
Slave reg SAMPLE_CONTROL_2_BANK (0x23) should only be written
when sample interval is > 0xFF otherwise we get CMD_Ignored IRQ.
Also add handling for this CMD_IGNORED_AND_EXEC_CONTINUED Irq.

Change-Id: I4693fb17ba78c73d4fda2e4ddce9fa6e0311309d
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-27 22:01:38 -08:00
qctecmdr
b622e92a38 Merge "asoc: codecs: Fix WSA dapm_ignore_suspend pin names" 2022-02-25 22:58:48 -08:00
qctecmdr
5239aa7d5c Merge "asoc: return correct index id for secondary mi2s stream-name" 2022-02-23 23:42:07 -08:00
Phani Kumar Uppalapati
69448e2228 asoc: return correct index id for secondary mi2s stream-name
Check and return correct index id for secondary mi2s
stream name.

Change-Id: I4df832e6cfc0e5eeac047e8cd4ce42def3be4061
2022-02-23 09:15:50 -08:00
qctecmdr
fb5143b4e5 Merge "asoc: Update secondary mi2s interface type and index" 2022-02-20 06:34:06 -08:00
qctecmdr
e87e6718f2 Merge "swr-haptics: Add new compatible string for Kalama target" 2022-02-20 06:34:06 -08:00
Phani Kumar Uppalapati
f51bed35f2 asoc: Update secondary mi2s interface type and index
Update secondary mi2s interface type and index
for kalama target.

Change-Id: I5b0bb1ab4458fbd3b7e8f36a0ca63e330e3bbc02
2022-02-17 21:45:23 -08:00
Matthew Rice
f3d67be087 asoc: codecs: Fix WSA dapm_ignore_suspend pin names
Update to 5.15 kernel dapm api.
Pin name no longer needs prefix as it is added in API.

Change-Id: I5c1378839f4c4d2aa70fb11706c5bb65d4eb0952
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-17 17:51:57 -08:00
Matthew Rice
72f737377e asoc: codecs: Fix lpass_cdc_wsa_macro_read_array
Update function to correctly read array from device tree.
Previously not reading values and returning -EINVAL.
WSA bat_cfg/rload/sys_gain are now correctly configured.
Also add softclip clock enable during pbr config.

Change-Id: Ia1b93acfde3e799b3b72e05966d0fa955c3f49ac
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-17 11:41:34 -08:00
Phani Kumar Uppalapati
f5d67429ea swr-haptics: Add new compatible string for Kalama target
Add new pmic soundwire haptics compatible string for
Kalama target.

Change-Id: I7c3f85b90176633fb0117577fd97193d929f6452
2022-02-16 13:09:42 -08:00
qctecmdr
110af4933f Merge "asoc: Fix speaker swr port config" 2022-02-11 01:17:37 -08:00
qctecmdr
97edd2c1b6 Merge "dsp: fix issues related to caching of dma_vmap data" 2022-02-11 01:17:37 -08:00
Shiv Maliyappanahalli
964187d31d dsp: fix issues related to caching of dma_vmap data
Local variable is used for dma_vmap and same value is used for caching
which becomes invalid after going out of scope. Store in heap instead.

Change-Id: I2e291137dd461d0cdb49209a6c1d804f1e806457
2022-02-10 18:50:33 -08:00
Matthew Rice
67c6c0c9f8 asoc: Fix speaker swr port config
Change wsa Word length param to be - 1.
Also, any value that is 0 should be set to 0xFF.
This causes the swr mstr driver to ignore the write
(default value).

Change-Id: I9bacb6657284c02cc023be655011b321a08ef3a9
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-09 22:02:42 -08:00
Matthew Rice
09ddecf85c asoc: codecs: Remove unused asoc kcontrols in WSA884x
Removed PA Mute, COMP Offset, Ext_vdd as they will not be used
in WSA884x.

Change-Id: I58ffd490c9929fa3388678d9ab7114207779191d
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-21 12:55:20 -08:00
Shazmaan Ali
5fd6cafe49 asoc: codecs: Add source select between PRE-LA and LEGACY
Add idle detect source select based on NG mode,
if NG2 then source is PRE-LA else LEGACY

Change-Id: I4e0cb3825960e6b795038fb5e85cfaa7a2fbfe62
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-01-20 21:30:26 -08:00
Shazmaan Ali
ff568161d0 asoc: codecs: Add idle detect control for WSA macro
Add idle detect enable for mixed control path,
and update copyright markings

Change-Id: Idf2932cd1813082f60ee96010788cdb1ef36afbf
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-01-20 21:30:22 -08:00
Shazmaan Ali
da66f4540f asoc: codecs: Add WSA884X set config func
Add set config function to validate and
set battery stack mode, rload and system gain

Change-Id: I075bf3cde6a9671a8d93f32aec43b941ea86f2ea
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-01-20 21:30:19 -08:00
Shazmaan Ali
152f664978 asoc: codecs: Add noise gating register writes
Read noise gate mode from device tree,
set NG2 based on the register read or
set to idle detect mode

Change-Id: Id1e478ad230125d1e35229493cb0fbd6867c6a3b
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-01-20 21:30:16 -08:00
Matthew Rice
823dd9bab9 asoc: codecs: Add current_limit updates to WSA884x
Boost current limit is now dependent on PBR and bat_cfg.
Add BOP2 VTH/HST initial settings.
Add OCP LOW VBAT ITH sel settings dependent on bat_cfg.

Change-Id: I235f4b75ee12e5f24d46fa0ebca67547997934e2
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:30:13 -08:00
Matthew Rice
233a0dcb1b asoc: codecs: Updated swr slave debug w/ new ports
Add PBR/CPS ports to debugging by adding logic to
is_swr_slave_reg_readable.

Change-Id: I9ef09ed90ccce2c696eaec7b1eed9c47a7e73f58
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:30:04 -08:00
Matthew Rice
9284d9af02 asoc: codecs: Implement lpass PBR feature
Lpass-side enablement of new WSA feature.
Configure PBR registers based on WSA bat_cfg/rload/sys_gain.
Some registers updated during init, others during enable_interpolator.

Change-Id: Iac42672182827a9da47700319c61b9d0a17d0936
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:30:01 -08:00
Matthew Rice
8f819a5cda soc: Fix bugs found in register updates to SWRM
Add CPU_m calculation in CPU_SW_MESSAGE.
Fix CLK_CTRL value. Skip 0x2C54 to 0x4000 in reg_show.

Change-Id: I487bfab9c9fa6c1e99af1b778da7d150ef5ac927
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:57 -08:00
Matthew Rice
d8711a3a66 asoc: codecs: Implement PBR feature for WSA884X
Change PBR enable to be acquired from device tree.
Using system_gain, bat_cfg, rload, set pbr thresholds based on tables.
Table values are x100 to avoid kernel float issues,
truncate when converting to reg val.
Set pbr registers during initialization.
Rename WSA_8OHMS -> WSA_8_OHMS to match system gain naming.

Change-Id: I28985496e1da37ceeb8c9db6e17f4c48d37d11c7
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:51 -08:00
Matthew Rice
2db06d4b50 asoc: codecs: wsa884x: Enable all irqs by default
Previously we disabled all irqs by default and toggled them pre/post
playback. Update to leave them enabled by default and remove the toggling.
Also, leave the default values for edge/level triggering.

Change-Id: Iac96649fc0f33cbdf5a25f136cf577f7242db74e
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:48 -08:00
Matthew Rice
e41373e842 asoc: codecs: Add Comp Off Pa Gain usecase
If not using compander, allow for user to set pa gain
using DRE_CTL_1 register.

Change-Id: I45af5a64a5630ff1cd8410a66ed55914efb5a529
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:45 -08:00
Matthew Rice
311264875e asoc: codecs: Change WSA config params acquisition
Update WSA rload, system gain, bat_cfg to get from wsa_macro device tree.
WSA Bat_cfg change to read from VPHX_SYS_EN_STATUS reg.
Add device tree parsing for these params in WSA macro
and WSA driver.
Remove machine driver method of sending the parameters.
Add default_dev_mode (spkr vs rcv) from device tree for WSA.
Move code from spkr event to userspace controls or probe.
Change system_gain and affected params when switching between
dev_modes.
These changes simplify configuration data and code and allow
more registers to be written during bootup or before playback.

Change-Id: I79966c704adfac1bf2d85aa6519ea574764c7a8b
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:37 -08:00