Skip to content

Commit 59255cf

Browse files
rfvirgilbroonie
authored andcommitted
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>
1 parent 267b9cd commit 59255cf

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

sound/soc/codecs/cs35l56-shared.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,17 @@ int cs35l56_get_speaker_id(struct cs35l56_base *cs35l56_base)
10541054
u32 speaker_id;
10551055
int i, ret;
10561056

1057-
/* Attempt to read the speaker type from a device property first */
1057+
/* Check for vendor-specific speaker ID method */
1058+
ret = cs_amp_get_vendor_spkid(cs35l56_base->dev);
1059+
if (ret >= 0) {
1060+
dev_dbg(cs35l56_base->dev, "Vendor Speaker ID = %d\n", ret);
1061+
return ret;
1062+
} else if (ret != -ENOENT) {
1063+
dev_err(cs35l56_base->dev, "Error getting vendor Speaker ID: %d\n", ret);
1064+
return ret;
1065+
}
1066+
1067+
/* Attempt to read the speaker type from a device property */
10581068
ret = device_property_read_u32(cs35l56_base->dev, "cirrus,speaker-id", &speaker_id);
10591069
if (!ret) {
10601070
dev_dbg(cs35l56_base->dev, "Speaker ID = %d\n", speaker_id);

0 commit comments

Comments
 (0)