alsa-info.sh: log SoundWire devices reported in ACPI

Track SoundWire devices reported in ACPI, this will help detect
missing or invalid configurations.

For now we only filter information from Realtek, Cirrus Logic and TI,
based on the manufacturer ID of their devices.

Example log for the classic RT711/RT1316x2/RT714 configuration.

!!ACPI SoundWire Device Status Information
!!---------------

Realtek 0x000030025d071101
Realtek 0x000331025d131601
Realtek 0x000230025d131601
Realtek 0x000130025d071401

As noted by reviewers, the script reports everything exposed in
ACPI. In practice some of the devices listed may not be physically
populated in hardware, or be listed as attached on a link that's
disabled by the manager. The drivers can cope with this case, it's not
technically an error.

Closes: https://github.com/alsa-project/alsa-utils/pull/264
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Pierre-Louis Bossart 2024-04-15 10:17:39 -05:00 committed by Jaroslav Kysela
parent 9cdcbe0e93
commit cc0bcef813

View file

@ -461,6 +461,20 @@ if [ -d /sys/bus/acpi/devices ]; then
done
fi
# Check for SoundWire ACPI _adr device status
if [ -d /sys/bus/acpi/devices ]; then
for f in /sys/bus/acpi/devices/*/adr; do
ACPI_ADR=$(cat $f 2>/dev/null);
if [[ "$ACPI_ADR" -ne 0 ]]; then
case $ACPI_ADR in
0x??????025d*) echo "Realtek $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
0x??????01fa*) echo "Cirrus Logic $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
0x??????0102*) echo "TI $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
esac
fi
done
fi
awk '{ print $2 " (card " $1 ")" }' < /proc/asound/modules > $TEMPDIR/alsamodules.tmp 2> /dev/null
cat /proc/asound/cards > $TEMPDIR/alsacards.tmp
if [[ ! -z "$LSPCI" ]]; then
@ -528,6 +542,12 @@ echo "" >> $FILE
cat $TEMPDIR/acpidevicestatus.tmp >> $FILE
echo "" >> $FILE
echo "" >> $FILE
echo "!!ACPI SoundWire Device Status Information" >> $FILE
echo "!!---------------" >> $FILE
echo "" >> $FILE
cat $TEMPDIR/sdwstatus.tmp >> $FILE
echo "" >> $FILE
echo "" >> $FILE
echo "!!Kernel Information" >> $FILE
echo "!!------------------" >> $FILE
echo "" >> $FILE