summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs35l56.c
diff options
context:
space:
mode:
authorSimon Trimmer <simont@opensource.cirrus.com>2024-03-08 16:58:58 +0300
committerTakashi Iwai <tiwai@suse.de>2024-03-08 19:59:18 +0300
commitafd17e6debf9494af778a58ec7706da05ede0730 (patch)
treeae550e091ce65c38a26039b05a17128f264447dc /sound/soc/codecs/cs35l56.c
parent85b4f2a6efc933b742e447604df88f1f098ec080 (diff)
downloadlinux-afd17e6debf9494af778a58ec7706da05ede0730.tar.xz
ASoC: cs35l56: Add support for CS35L54 and CS35L57
The CS35L54 and CS35L57 are Boosted Smart Amplifiers. The CS35L54 has I2C/SPI control and I2S/TDM audio. The CS35L57 also has SoundWire control and audio. The hardware differences between L54, L56 and L57 do not affect the driver control interface so they can all be handled by the same driver. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <20240308135900.603192-2-rf@opensource.cirrus.com>
Diffstat (limited to 'sound/soc/codecs/cs35l56.c')
-rw-r--r--sound/soc/codecs/cs35l56.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 2c1313e34cce..beb51c87c6e9 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -972,6 +972,10 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
return -ENODEV;
}
+ cs35l56->dsp.part = kasprintf(GFP_KERNEL, "cs35l%02x", cs35l56->base.type);
+ if (!cs35l56->dsp.part)
+ return -ENOMEM;
+
cs35l56->component = component;
wm_adsp2_component_probe(&cs35l56->dsp, component);
@@ -1002,6 +1006,9 @@ static void cs35l56_component_remove(struct snd_soc_component *component)
wm_adsp2_component_remove(&cs35l56->dsp, component);
+ kfree(cs35l56->dsp.part);
+ cs35l56->dsp.part = NULL;
+
kfree(cs35l56->dsp.fwf_name);
cs35l56->dsp.fwf_name = NULL;
@@ -1221,7 +1228,12 @@ static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
dsp = &cs35l56->dsp;
cs35l56_init_cs_dsp(&cs35l56->base, &dsp->cs_dsp);
- dsp->part = "cs35l56";
+
+ /*
+ * dsp->part is filled in later as it is based on the DEVID. In a
+ * SoundWire system that cannot be read until enumeration has occurred
+ * and the device has attached.
+ */
dsp->fw = 12;
dsp->wmfw_optional = true;