Skip to content

ASoC: Intel: use function topologies for the HDA generic machine - #6062

Open
bardliao wants to merge 3 commits into
thesofproject:topic/sof-devfrom
bardliao:hda-function-topology
Open

bardliao wants to merge 3 commits into
thesofproject:topic/sof-devfrom
bardliao:hda-function-topology

Conversation

@bardliao

Copy link
Copy Markdown
Collaborator

The SoundWire and I2S machine can already use function topology. This series adds the same support to
the HDA generic machine driver (skl_hda_dsp_generic).

Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Replacing the legacy HDA topology fallback with dummy prevents the sound card from loading when function topology is disabled or no fragments are found, even if the legacy topology is installed.

1 open issue
What changed in this PR

This PR adds function-topology support to the generic HDA machine driver (skl_hda_dsp_generic), extending support already available for SoundWire and I2S machines.

Changes:

  • Selects topology fragments for HDA codecs, HDMI, DMIC, and SSP links.
  • Registers the HDA fragment-selection callback.
  • Encodes the Intel platform name for constructing fragment filenames.
File Description
sound/​soc/​sof/​intel/​hda.c Adds platform-specific topology naming during HDA machine selection.
sound/​soc/​intel/​common/​sof-function-topology-lib.h Declares the HDA topology-selection helper.
sound/​soc/​intel/​common/​sof-function-topology-lib.c Implements HDA fragment selection and filename generation.
sound/​soc/​intel/​common/​soc-acpi-intel-hda-match.c Registers the helper for the generic HDA machine.

Review effort: Balanced

Comment thread sound/soc/sof/intel/hda.c Resolved
* Analog Playback and Capture - HDA analog codec
* Digital Playback and Capture - HDA digital codec (same tplg as the analog)
* dmic01/dmic16k - PCH DMIC
* SSP<n>-BT - BT offload

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How HDMI-IN and UAOL can be added here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

HDMI-IN is already supported by get_ssp_tplg_dev(). Regarding UAOL, we need to add a new tplg_device_id and add a else if (strstr(dai_link->name, "<UAOL link name>")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

like this:
63c7689

and will work on hda as well?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

like this: 63c7689

and will work on hda as well?

It only works for SDW, but the same approach will work on HDA, too.

@bardliao
bardliao force-pushed the hda-function-topology branch from 3dbfe9e to 365c105 Compare November 26, 2026 14:40
Copilot AI balanced review requested due to automatic review settings November 26, 2026 14:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Zero-microphone configurations incorrectly trigger monolithic fallback because DMIC prelinks are still processed; skip them when the count is zero while preserving fallback for unsupported nonzero counts.

1 open issue
1 resolved since last review

Review effort: Balanced

@ujfalusi
ujfalusi marked this pull request as draft November 26, 2026 16:01
@ujfalusi
ujfalusi marked this pull request as ready for review November 26, 2026 16:01
Add sof_hda_get_tplg_files() callback for the skl_hda_dsp_generic
machine driver. It finds the function topologies according to the dai
links created by the machine driver: iDisp (HDMI), HDA analog/digital
codecs, PCH DMIC, SSP BT offload and SSP HDMI IN.

The analog and digital HDA codec dai links share one topology. Like the
HDMI one, it has no NHLT blob and doesn't depend on the platform, so
its name has no platform: sof-hda-id<BE id>.tplg.

When a dai link has no function topology, e.g. with 1 or 3 dmics, no
function topology is used so that the monolithic topology is loaded
instead, unless best effort is requested.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Set get_function_tplg_files to sof_hda_get_tplg_files() so that the
skl_hda_dsp_generic machine can use function topologies. The monolithic
sof-hda-generic topologies are still used when any of the function
topologies is missing.

The HDA and HDMI function topologies are platform independent, so an
HDA machine with only HDA codec and HDMI links uses function topologies
on any platform once they are installed, the same as with the
platform independent sof-hda-generic topologies.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The platform name is needed to form the file names of the DMIC and SSP
function topologies, which depend on the platform NHLT blobs.
get_platform_name() takes it from sof_tplg_filename, but the one of the
HDA generic match table is platform independent, and it can't be
replaced: it is also the monolithic topology that is used when the
function topologies are not available, e.g. on platforms that have no
function topologies or with an older sof-firmware.

mach_params.platform can't be used either, it is the name of the ASoC
platform component the machine drivers bind their dai links to.

Add mach_params.tplg_platform, set it to the platform name in
hda_generic_machine_select(), and use it in get_platform_name() when it
is set.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao
bardliao force-pushed the hda-function-topology branch from 365c105 to 5f3cbbe Compare November 27, 2026 07:51
Copilot AI balanced review requested due to automatic review settings November 27, 2026 07:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two critical issues remain: fragment-only installations still fail probe because the monolithic topology is required prematurely, and BT fragment allocation failures are silently ignored, allowing an incomplete topology set to load.

2 open issues
1 resolved since last review

Review effort: Balanced

.drv_name = "skl_hda_dsp_generic",
.sof_tplg_filename = "sof-hda-generic", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
.get_function_tplg_files = sof_hda_get_tplg_files,
Comment on lines +403 to +405
if (get_ssp_tplg_dev(card->dev, dai_link, &hdmi_in_mask,
&tplg_dev, &tplg_dev_name) < 0)
continue;
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.

3 participants