Unverified Commit 59255cfa authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown
Browse files

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: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Message-ID: <20250909113039.922065-4-rf@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 267b9cde
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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);