ASoC: cs35l56: Check for vendor-specific speaker ID value

Call cs_amp_get_vendor_spkid() to get use a vendor-specific speaker ID
value, if one exists.

The speaker ID is used to load an appropriate set of firmware files for the
speakers, and is usually read from a GPIO. Some manufacturers are instead
using a custom UEFI variable for the speaker ID.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-ID: <20250909113039.922065-4-rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Richard Fitzgerald 2025-09-09 12:30:36 +01:00 committed by Mark Brown
parent 267b9cdee5
commit 59255cfa4a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1054,7 +1054,17 @@ int cs35l56_get_speaker_id(struct cs35l56_base *cs35l56_base)
u32 speaker_id;
int i, ret;
/* Attempt to read the speaker type from a device property first */
/* Check for vendor-specific speaker ID method */
ret = cs_amp_get_vendor_spkid(cs35l56_base->dev);
if (ret >= 0) {
dev_dbg(cs35l56_base->dev, "Vendor Speaker ID = %d\n", ret);
return ret;
} else if (ret != -ENOENT) {
dev_err(cs35l56_base->dev, "Error getting vendor Speaker ID: %d\n", ret);
return ret;
}
/* Attempt to read the speaker type from a device property */
ret = device_property_read_u32(cs35l56_base->dev, "cirrus,speaker-id", &speaker_id);
if (!ret) {
dev_dbg(cs35l56_base->dev, "Speaker ID = %d\n", speaker_id);