Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l56: Attempt to read from cirrus,speaker-id device property first

When cs35l56 is connected via cs42l43 there isn't an ACPI node for the
cs35l56 so all properties are under the cs42l43 ACPI node. We're adding
a property as a way for the cs42l43 driver to pass this info in via a
software node.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240611132556.1557075-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Simon Trimmer and committed by
Mark Brown
c38082bf b745dcf7

+8 -1
+8 -1
sound/soc/codecs/cs35l56-shared.c
··· 853 853 int cs35l56_get_speaker_id(struct cs35l56_base *cs35l56_base) 854 854 { 855 855 struct gpio_descs *descs; 856 - int speaker_id; 856 + u32 speaker_id; 857 857 int i, ret; 858 + 859 + /* Attempt to read the speaker type from a device property first */ 860 + ret = device_property_read_u32(cs35l56_base->dev, "cirrus,speaker-id", &speaker_id); 861 + if (!ret) { 862 + dev_dbg(cs35l56_base->dev, "Speaker ID = %d\n", speaker_id); 863 + return speaker_id; 864 + } 858 865 859 866 /* Read the speaker type qualifier from the motherboard GPIOs */ 860 867 descs = gpiod_get_array_optional(cs35l56_base->dev, "spk-id", GPIOD_IN);