ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821
Open
ger5ones wants to merge 1 commit into
Open
ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821ger5ones wants to merge 1 commit into
ger5ones wants to merge 1 commit into
Conversation
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>
Collaborator
|
Can one of the admins verify this patch?
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.