Skip to content

ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821

Open
ger5ones wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ger5ones:sof-pr-skip-unattached
Open

ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821
ger5ones wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ger5ones:sof-pr-skip-unattached

Conversation

@ger5ones

Copy link
Copy Markdown

When no SoundWire machine driver matches the ACPI-reported configuration, hda_sdw_machine_select() builds a default machine from the enumerated SoundWire peripherals. The link mask and the per-peripheral adr_d entries are generated by iterating over every entry in hdev->sdw->peripherals, including peripherals that never attached to the bus.

Some platforms declare SoundWire peripherals in ACPI that are not physically populated. On the ASUS Zenbook S14 UX5406AA (PCI SSID 1043:1464) the BIOS declares an RT722 (025d:0722) on link 3 that stays SDW_SLAVE_UNATTACHED, alongside the physically present CS42L43. The phantom peripheral adds a second SimpleJack function on the same link, whose DAI name collides with the CS42L43 one:

kobject_add_internal failed for SDW3-Playback-SimpleJack with -EEXIST
sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12

so card registration fails and only HDMI/Loopback remain.

Skip peripherals whose status is SDW_SLAVE_UNATTACHED when computing the link mask and when generating the adr_d entries, so the default machine reflects only hardware that is actually present, and bail out if no peripheral is attached.

Testing

Tested on ASUS Zenbook S14 UX5406AA (Panther Lake, PCI SSID 1043:1464,
CS42L43 + 4x CS35L56 over SoundWire). Without this patch, card
registration fails with -EEXIST / -12 because a phantom RT722
(025d:0722) declared in ACPI on link 3 never attaches and collides the
SDW3-Playback-SimpleJack DAI with the CS42L43. With the patch the
sof-soundwire card registers, the Speaker PCM appears, and all four
CS35L56 amplifiers attach and load their 10431464 firmware/calibration.

Note: a separate channel-routing limitation (the default machine selects
sof-sdca-2amp for a 4-amp board, leaving one side silent) is independent
of this fix and will be addressed separately.

When no SoundWire machine driver matches the ACPI-reported
configuration, hda_sdw_machine_select() builds a default machine from
the enumerated SoundWire peripherals. The link mask and the
per-peripheral adr_d entries are generated by iterating over every
entry in hdev->sdw->peripherals, including peripherals that never
attached to the bus.

Some platforms declare SoundWire peripherals in ACPI that are not
physically populated. On the ASUS Zenbook S14 UX5406AA (PCI SSID
1043:1464) the BIOS declares an RT722 (025d:0722) on link 3 that stays
SDW_SLAVE_UNATTACHED, alongside the physically present CS42L43. The
phantom peripheral adds a second SimpleJack function on the same link,
whose DAI name collides with the CS42L43 one:

  kobject_add_internal failed for SDW3-Playback-SimpleJack with -EEXIST
  sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12

so card registration fails and only HDMI/Loopback remain.

Skip peripherals whose status is SDW_SLAVE_UNATTACHED when computing the
link mask and when generating the adr_d entries, so the default machine
reflects only hardware that is actually present, and bail out if no
peripheral is attached.

Signed-off-by: Gerson Tamanaha Yabiku <gerson.yabiku@gmail.com>
@ger5ones ger5ones requested a review from bardliao as a code owner June 20, 2026 12:51
@sofci

sofci commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

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.

2 participants