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: Only patch ASP registers if the DAI is part of a DAIlink

Move the ASP register patches to a separate struct and apply this from the
ASP DAI probe() function so that the registers are only patched if the DAI
is part of a DAI link.

Some systems use the ASP as a special-purpose interconnect and on these
systems the ASP registers are configured by a third party (the firmware,
the BIOS, or another device using the amp's secondary host control
interface).

If the machine driver does not hook up the ASP DAI then the ASP registers
must be omitted from the patch to prevent overwriting the third party
configuration.

If the machine driver includes the ASP DAI in a DAI link, this implies that
the machine driver and higher components (such as alsa-ucm) are taking
ownership of the ASP. In this case the ASP registers are patched to known
defaults and the machine driver should configure the ASP.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260226110137.1664562-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
9351cf3f 11439c46

+24 -1
+1
include/sound/cs35l56.h
··· 406 406 extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC]; 407 407 extern const unsigned int cs35l56_tx_input_values[CS35L56_NUM_INPUT_SRC]; 408 408 409 + int cs35l56_set_asp_patch(struct cs35l56_base *cs35l56_base); 409 410 int cs35l56_set_patch(struct cs35l56_base *cs35l56_base); 410 411 int cs35l56_mbox_send(struct cs35l56_base *cs35l56_base, unsigned int command); 411 412 int cs35l56_firmware_shutdown(struct cs35l56_base *cs35l56_base);
+15 -1
sound/soc/codecs/cs35l56-shared.c
··· 26 26 27 27 #include "cs35l56.h" 28 28 29 - static const struct reg_sequence cs35l56_patch[] = { 29 + static const struct reg_sequence cs35l56_asp_patch[] = { 30 30 /* 31 31 * Firmware can change these to non-defaults to satisfy SDCA. 32 32 * Ensure that they are at known defaults. ··· 43 43 { CS35L56_ASP1TX2_INPUT, 0x00000000 }, 44 44 { CS35L56_ASP1TX3_INPUT, 0x00000000 }, 45 45 { CS35L56_ASP1TX4_INPUT, 0x00000000 }, 46 + }; 47 + 48 + int cs35l56_set_asp_patch(struct cs35l56_base *cs35l56_base) 49 + { 50 + return regmap_register_patch(cs35l56_base->regmap, cs35l56_asp_patch, 51 + ARRAY_SIZE(cs35l56_asp_patch)); 52 + } 53 + EXPORT_SYMBOL_NS_GPL(cs35l56_set_asp_patch, "SND_SOC_CS35L56_SHARED"); 54 + 55 + static const struct reg_sequence cs35l56_patch[] = { 56 + /* 57 + * Firmware can change these to non-defaults to satisfy SDCA. 58 + * Ensure that they are at known defaults. 59 + */ 46 60 { CS35L56_SWIRE_DP3_CH1_INPUT, 0x00000018 }, 47 61 { CS35L56_SWIRE_DP3_CH2_INPUT, 0x00000019 }, 48 62 { CS35L56_SWIRE_DP3_CH3_INPUT, 0x00000029 },
+8
sound/soc/codecs/cs35l56.c
··· 348 348 return wm_adsp_event(w, kcontrol, event); 349 349 } 350 350 351 + static int cs35l56_asp_dai_probe(struct snd_soc_dai *codec_dai) 352 + { 353 + struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(codec_dai->component); 354 + 355 + return cs35l56_set_asp_patch(&cs35l56->base); 356 + } 357 + 351 358 static int cs35l56_asp_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 352 359 { 353 360 struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(codec_dai->component); ··· 559 552 } 560 553 561 554 static const struct snd_soc_dai_ops cs35l56_ops = { 555 + .probe = cs35l56_asp_dai_probe, 562 556 .set_fmt = cs35l56_asp_dai_set_fmt, 563 557 .set_tdm_slot = cs35l56_asp_dai_set_tdm_slot, 564 558 .hw_params = cs35l56_asp_dai_hw_params,