Commit d67b302
committed
ASoC: qcom: lpass-macro: Add LPASS codec v4.0 support for Shikra
Shikra (QCM2290) carries a Bolero v4.0 LPASS codec that extends the
existing VA and RX macro hardware in several ways. Wire up the new
platform while keeping all changes strictly gated so that no existing
platform is affected.
VA macro changes:
- Add LPASS_CODEC_VERSION_4_0 to the version enum and version-string
helper in lpass-macro-common.h.
- Introduce a dedicated shikra_va_data match-data struct that pre-sets
codec version to 4.0 and marks bypass_fs_control, avoiding the need
to read the version from hardware registers before clocks are up.
- Add new register definitions for v4.0-only hardware blocks:
* SWR GP-IN/GP-OUT channel registers (0x00E0-0x00FC)
* Extended ADC MUX4-7 CFG0/1 (0x0120-0x013C) for 8-DMIC support
* ADC MUXx CFG2 extension for all 8 muxes (0x0140-0x015C)
* SWR INTR_CTRL registers (0x0340-0x03D0)
* TX PATH CFG2 per decimator (0x0430/0x04B0/0x0530/0x05B0)
* Adaptive filter blocks ADPT0-3 (0x0800-0x09A4)
* ALT TOP configuration registers (0x1000-0x1140)
- Split register defaults: common defaults stay in va_defaults[]; all
v4.0-only defaults move to a new va_4_0_defaults[] array. The probe
function builds the regmap config dynamically (mirroring rx-macro),
merging va_4_0_defaults only for v4.0 and setting max_register to
VA_MAX_OFFSET (0x1240) vs VA_MAX_OFFSET_PRE_4_0 (0x07A8) accordingly.
- Guard va_is_rw_register() and va_is_volatile_register() so the new
INTR_CTRL, MUX4-7, CFG2, TX_PATH_CFG2, ADPT, and ALT_TOP cases are
only reachable when the codec version is 4.0.
- Add bypass_fs_control bool to va_macro_data and va_macro structs.
Gate the FS counter bit[7] toggle in va_clk_rsc_fs_gen_request()
behind va->bypass_fs_control instead of a version comparison.
- Add fsgen_gate_ops_4_0 clk_ops with recalc_rate (parent/2) used only
for v4.0; the base fsgen_gate_ops is unchanged for all other platforms.
- Fix a pre-existing bug where the TX1 and TX3 reg_default entries for
TX_PATH_CFG2 incorrectly referenced CDC_VA_TX0_TX_PATH_CFG2 (0x0430)
instead of their own addresses (0x04B0 and 0x05B0 respectively).
RX macro changes:
- Add LPASS_CODEC_VERSION_4_0 fall-through to the v2.5 register-set,
control, widget, and probe stride/defaults selection paths, since the
RX macro register layout is compatible with the 2.5 variant.
- Add bypass_fs_control bool to rx_macro struct; set it from the new
LPASS_MACRO_FLAG_BYPASS_FS_CONTROL flag in rx_macro_probe().
- Gate the FS counter bit[7] toggle in rx_macro_mclk_enable() behind
rx->bypass_fs_control instead of a version comparison.
- Add qcom,shikra-lpass-rx-macro DT match entry with both
LPASS_MACRO_FLAG_HAS_NPL_CLOCK and LPASS_MACRO_FLAG_BYPASS_FS_CONTROL.
Common header changes:
- Add LPASS_MACRO_FLAG_BYPASS_FS_CONTROL BIT(2) to lpass-macro-common.h
to signal that the FS counter control bit[7] must be toggled during
mclk enable. This is a platform capability flag, not a version check,
so it can be set independently of codec version in future platforms.
Signed-off-by: Mohammad Rafi Shaik <mohs@qti.qualcomm.com>1 parent 1e7c606 commit d67b302
3 files changed
Lines changed: 366 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
| |||
1612 | 1613 | | |
1613 | 1614 | | |
1614 | 1615 | | |
| 1616 | + | |
1615 | 1617 | | |
1616 | 1618 | | |
1617 | 1619 | | |
| |||
2043 | 2045 | | |
2044 | 2046 | | |
2045 | 2047 | | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
2046 | 2053 | | |
2047 | 2054 | | |
2048 | 2055 | | |
| |||
3648 | 3655 | | |
3649 | 3656 | | |
3650 | 3657 | | |
| 3658 | + | |
3651 | 3659 | | |
3652 | 3660 | | |
3653 | 3661 | | |
| |||
3809 | 3817 | | |
3810 | 3818 | | |
3811 | 3819 | | |
| 3820 | + | |
3812 | 3821 | | |
3813 | 3822 | | |
3814 | 3823 | | |
| |||
3831 | 3840 | | |
3832 | 3841 | | |
3833 | 3842 | | |
| 3843 | + | |
3834 | 3844 | | |
3835 | 3845 | | |
3836 | 3846 | | |
| |||
3961 | 3971 | | |
3962 | 3972 | | |
3963 | 3973 | | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
3964 | 3978 | | |
3965 | 3979 | | |
3966 | 3980 | | |
| |||
0 commit comments