From d3cdcb217498dff78dddb66547dad6c7b3aa4c9b Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 25 May 2024 10:43:19 +0100 Subject: Detect legacy (non-PCI) Intel SST audio DSP devices (mga#33145) On the Broadwell. Bay Trail, Cherry Trail, and Braswell platforms the CPU has direct access to the SST sound device, so the device doesn't appear on the PCI bus. So the only way to detect these devices is to inspect the ACPI device list. As there are only a few devices involved, include the device table here rather than extending ldetect-lst. --- perl-install/NEWS | 1 + perl-install/detect_devices.pm | 32 +++++++++++++++++++++++++++++++- perl-install/install/NEWS | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 273b00e91..823534874 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,4 @@ +- Detect legacy (non-PCI) Intel SST audio DSP devices (mga#33145) - install rpm's /usr/lib/rpm/sysusers.sh to stage2 image by default - Drop i586 bits diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 9aff9306c..48dadadbb 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -1168,6 +1168,36 @@ sub dmi_probe() { @$dmi_probe; } +=item acpi_probe() + +Return list of devices that are only discoverable via ACPI + +=cut + +my %acpi_device_info = ( + "80860F28" => { vendor => 0x8086, id => 0x0f28, description => 'Intel Corporation|Bay Trail SST Audio DSP', + nice_media_type => 'Audio device', driver => 'snd_sof_acpi_intel_byt' }, + "808622A8" => { vendor => 0x8086, id => 0x22a8, description => 'Intel Corporation|Cherry Trail SST Audio DSP', + nice_media_type => 'Audio device', driver => 'snd_sof_acpi_intel_byt' }, + "INT3438" => { vendor => 0x8086, id => 0x3438, description => 'Intel Corporation|Broadwell SST Audio DSP', + nice_media_type => 'Audio device', driver => 'snd_sof_acpi_intel_bdw' } +); + +sub acpi_probe() { + my $dev_dir = '/sys/bus/acpi/devices'; + my @l; + foreach (glob("$dev_dir/*")) { + my $dev_name = basename($_); + my ($prefix, $suffix) = split(':', $dev_name); + my $e = $acpi_device_info{$prefix}; + if ($e) { + add2hash($e, { bus => 'ACPI', sysfs_device => "$dev_dir/$dev_name" }); + push @l, $e; + } + } + @l; +} + =item probeall() Returns a list of all PCI/USB/Firewire/PCMCIA/DMI/HID devices. @@ -1179,7 +1209,7 @@ It's usually called through a higher level filtering function. sub probeall() { return if $::noauto; - pci_probe(), usb_probe(), firewire_probe(), pcmcia_probe(), dmi_probe(), getInputDevices_and_usb(); + pci_probe(), usb_probe(), firewire_probe(), pcmcia_probe(), dmi_probe(), acpi_probe(), getInputDevices_and_usb(); } sub probeall_update_cache() { return if $::noauto; diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 18c280175..580efac6c 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- Detect legacy (non-PCI) Intel SST audio DSP devices (mga#33145) - install rpm's /usr/lib/rpm/sysusers.sh to stage2 image by default - Drop i586 bits -- cgit v1.2.1