Skip to content

Shikra config2 support - #69

Open
mpratyus wants to merge 4 commits into
AudioReach:masterfrom
mpratyus:shikra-audio-support
Open

Shikra config2 support#69
mpratyus wants to merge 4 commits into
AudioReach:masterfrom
mpratyus:shikra-audio-support

Conversation

@mpratyus

@mpratyus mpratyus commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Add AudioReach kernel support required for Shikra CQS/IQS audio enablement.

This series adds MDSP-aware GPR routing, MDSP audio memory support, audio
packet routing updates, and Shikra CQS/IQS machine-driver support.

Changes included:

  • Add GPR destination-domain helper and use MDSP/ADSP domain from the GPR
    device where needed.

  • Add QAIF LPASS clock IDs required by Shikra audio interfaces.

  • Add qcom audio heap support for MDSP shared-memory use cases.

  • Route audio packet layer commands to the GPR device destination domain.

  • Add Shikra CQS/IQS machine-driver data and QAIF backend link naming.

  • Add generic TDM clock setup for TDM DAI IDs using
    snd_soc_tdm_params_to_bclk().

  • Extend LPASS dummy DAI clock parsing to include TDM DAI IDs.

  • Preserve existing target behavior by keeping qaif_interface disabled by
    default and enabling Shikra-specific BCLK/sysclk handling through board data.

    verified in Kodiak as well as part of regression testing
    CRS-Fixed:4637772

@mpratyus
mpratyus requested review from a team July 31, 2026 15:50
@mpratyus
mpratyus force-pushed the shikra-audio-support branch 5 times, most recently from aea180f to 20c75f0 Compare August 1, 2026 09:41
@mpratyus mpratyus changed the title Shikra audio support Shikra config2 support Aug 1, 2026
@mpratyus
mpratyus force-pushed the shikra-audio-support branch from 6f9d678 to f365ba4 Compare August 2, 2026 13:35
Comment thread audioreach-driver/q6apm_lpass_dummy_dais.c Outdated
return 0;
}

static int q6apm_lpass_dai_get_clks(struct device *dev, struct device_node *np,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
.num_dapm_widgets = ARRAY_SIZE(shikra_iqs_dapm_widgets),
.controls = shikra_iqs_controls,
.num_controls = ARRAY_SIZE(shikra_iqs_controls),
.qaif_backend_names = true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this, backend_name not good to use,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread dsp/spf-core.c Outdated

@mohsRafi mohsRafi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please validate in RB3Gen2 as well,

since some modifications done in generic code and also add tested on specific target in PR decription

@mohsRafi mohsRafi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cleanup

some duplicate patches in same PR

@mpratyus
mpratyus force-pushed the shikra-audio-support branch 3 times, most recently from b72a252 to 1b1aa78 Compare August 5, 2026 10:03
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c
Comment thread audioreach-driver/audioreach_common.c
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c Outdated
Comment thread audioreach-driver/audioreach_common.c
Comment thread audioreach-driver/q6apm_lpass_dummy_dais.c Outdated
Comment thread audioreach-driver/q6apm_lpass_dummy_dais.c
Comment thread audioreach-driver/q6apm_audio_mem.c
@mohsRafi

mohsRafi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

commit 1 and 3 doing same changes

@mpratyus
mpratyus force-pushed the shikra-audio-support branch from 1b1aa78 to a799ae1 Compare August 6, 2026 11:48
Pratyush Meduri added 4 commits August 6, 2026 18:10
Introduce audioreach_gpr_dest_domain() helper in q6prm_audioreach.h
that selects the correct GPR destination domain (MDSP or ADSP) based
on the gpr_device domain_id. Update __q6prm_audioreach_alloc_pkt() and
all callers to pass the gpr_device so the domain is resolved at packet
build time rather than being hardcoded to ADSP.

Also add QAIF audio interface clock IDs (Q6PRM_LPASS_CLK_ID_AUD_INTF*
and LPASS_CLK_ID_AUD_INTF*) to q6prm_audioreach.h and register them
in the q6prm clock table so they are available for Shikra QAIF paths.

Signed-off-by: Pratyush Meduri <pratyush.meduri@oss.qualcomm.com>
Add a dedicated DMA-heap ("qcom,audio") backed by a gen_pool over a
reserved-memory region. When the device tree lists qcom,vmid with
QCOM_SCM_VMID_MSS_MSA the heap memory is hypervisor-assigned to the
MSS MSA VMID at probe time and unassigned on remove, enabling MDSP
audio paths on Shikra.

Also add an auxiliary reserved-memory region assign path for platforms
that need a second contiguous region assigned alongside the main heap.

Remove the now-superseded CMA child platform-device spawning path
(q6apm-audio-mem-cma) and the q6apm_audio_mem_cma_init/exit calls;
the gen_pool heap replaces that mechanism. Clean up probe error paths
to properly unwind chrdev and heap registrations on failure.

Signed-off-by: Pratyush Meduri <pratyush.meduri@oss.qualcomm.com>
Replace hardcoded GPR_DOMAIN_ID_ADSP in __q6apm_audio_alloc_pkt()
with audioreach_gpr_dest_domain(). This keeps ADSP unchanged and routes
Shikra MDSP packets to the domain advertised by the GPR device.

Add MDSP memory-map opcode handling for the audio packet path:
- APM_CMD_GLOBAL_SHARED_MEM_MAP_REGIONS
- APM_CMD_SHARED_SATELLITE_MEM_MAP_REGIONS

Select the pass-through device name from the glink channel so ADSP uses
"aud_pasthru_adsp" and modem glink uses "aud_pasthru_modem".

Signed-off-by: Pratyush Meduri <pratyush.meduri@oss.qualcomm.com>
Add machine-driver support for Shikra CQS and IQS sound cards in
audioreach_common.c. Extend q6apm_lpass_dummy_dais.c to parse clocks
for TDM DAI IDs.

audioreach_common.c:
- Add Shikra CQS and IQS private data with DAPM widgets and IQS
  controls.
- Use qaif_interface to select QAIF link names only for Shikra boards.
  CQS playback maps SECONDARY_TDM_RX_0 to QAIF-QAIF_AUD-RX-2. IQS
  playback maps PRIMARY_MI2S_RX to QAIF-QAIF_AUD-RX-0. Capture maps
  VA_CODEC_DMA_TX_0 to CODEC_DMA-QAIF-TX-0.
- Use board data flags to request CPU BCLK and codec sysclk for Shikra
  QAIF playback paths.
- Handle TDM clock setup generically for TDM DAI IDs using
  snd_soc_tdm_params_to_bclk().
- Keep qaif_interface false by default so existing LPAIF backends are
  unchanged for other targets.
- Check devm_snd_soc_register_card() return value.

q6apm_lpass_dummy_dais.c:
- Add PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7 to the existing MI2S clock
  parsing path.
- Reuse q6i2s_lpass_dai_shutdown() and q6i2s_set_sysclk() for TDM ops.

Signed-off-by: Pratyush Meduri <pratyush.meduri@oss.qualcomm.com>
@mpratyus
mpratyus force-pushed the shikra-audio-support branch from a799ae1 to 53df625 Compare August 6, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants