linux-stable/sound/soc
Richard Fitzgerald 72a77d7631
ASoC: cs35l56: Fix to ensure ASP1 registers match cache
Add a dummy SUPPLY widget connected to the ASP that forces the
chip registers to match the regmap cache when the ASP is
powered-up.

On a SoundWire system the ASP is free for use as a chip-to-chip
interconnect. This can be either for the firmware on multiple
CS35L56 to share reference audio; or as a bridge to another
device. If it is a firmware interconnect it is owned by the
firmware and the Linux driver should avoid writing the registers.
However. If it is a bridge then Linux may take over and handle
it as a normal codec-to-codec link.

CS35L56 is designed for SDCA and a generic SDCA driver would
know nothing about these chip-specific registers. So if the
ASP is being used on a SoundWire system the firmware sets up the
ASP registers. This means that we can't assume the default
state of the ASP registers. But we don't know the initial state
that the firmware set them to until after the firmware has been
downloaded and booted, which can take several seconds when
downloading multiple amps.

To avoid blocking probe() for several seconds waiting for the
firmware, the silicon defaults are assumed. This allows the machine
driver to setup the ASP configuration during probe() without being
blocked. If the ASP is hooked up and used, the SUPPLY widget
ensures that the chip registers match what was configured in the
regmap cache.

If the machine driver does not hook up the ASP, it is assumed that
it won't call any functions to configure the ASP DAI. Therefore
the regmap cache will be clean for these registers so a
regcache_sync() will not overwrite the chip registers. If the
DAI is not hooked up, the dummy SUPPLY widget will not be
invoked so it will never force-overwrite the chip registers.

Backport note:
This won't apply cleanly to kernels older than v6.6.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: e496112529 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Link: https://msgid.link/r/20240129162737.497-8-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-01 12:57:20 +00:00
..
adi
amd ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
apple
atmel
au1x
bcm
cirrus ASoC: cirrus: edb93xx: Drop legacy include 2023-12-01 16:59:22 +00:00
codecs ASoC: cs35l56: Fix to ensure ASP1 registers match cache 2024-02-01 12:57:20 +00:00
dwc Linux 6.6-rc7 2023-10-23 19:38:22 +01:00
fsl sound updates for 6.8-rc1 2024-01-12 11:55:28 -08:00
generic ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm() 2024-01-12 14:13:53 +00:00
google
hisilicon ASoC: hisilicon: Drop GPIO include 2023-12-18 14:03:29 +00:00
img
intel sound fixes for 6.8-rc1 2024-01-19 12:30:29 -08:00
jz4740
kirkwood
loongson
mediatek ASoC: Fixes for v6.8 2024-01-16 17:37:17 +01:00
meson ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux 2024-01-03 18:37:02 +00:00
mxs
pxa ASoC: pxa: sspa: Don't select SND_ARM 2023-12-29 17:41:15 +00:00
qcom ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
rockchip i2c: make i2c_bus_type const 2024-01-18 21:10:43 +01:00
samsung ASoC: samsung: odroid: don't need DUMMY Platform 2023-12-19 13:23:43 +00:00
sh ASoC: sh: convert not to use dma_request_slave_channel() 2023-11-27 13:44:06 +00:00
sof ASoC: Fixes for v6.8 2024-01-16 17:37:17 +01:00
spear
sprd ASoC: sprd: Simplify memory allocation in sprd_platform_compr_dma_config() 2023-12-19 14:02:50 +00:00
starfive ASoC: starfive/jh7110-pwmdac: Convert to platform remove callback returning void 2023-10-23 13:29:44 +01:00
sti ASoC: sti-uniperf: Use default pcm_config instead 2023-11-13 01:26:07 +00:00
stm
sunxi
tegra ASoC: tegra: tegra20_ac97: Convert to use GPIO descriptors 2023-12-18 14:03:32 +00:00
ti ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings 2023-10-30 13:30:20 +00:00
uniphier ASoC: uniphier: Make uniphier_aio_remove() return void 2023-10-23 13:29:48 +01:00
ux500
xilinx
xtensa
Kconfig
Makefile
soc-ac97.c
soc-acpi.c
soc-card.c
soc-component.c
soc-compress.c
soc-core.c ASoC: soc.h: don't create dummy Component via COMP_DUMMY() 2023-12-19 13:23:46 +00:00
soc-dai.c ASoC: Merge up workaround for CODECs that play noise on stopped stream 2023-10-27 22:33:15 +01:00
soc-dapm.c ASoC: makes CPU/Codec channel connection map more generic 2023-11-27 13:44:00 +00:00
soc-devres.c
soc-generic-dmaengine-pcm.c
soc-jack.c
soc-link.c
soc-ops.c ASoC: ops: add correct range check for limiting volume 2023-12-04 16:20:25 +00:00
soc-pcm.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
soc-topology-test.c ASoC: topology: Replace fake root_device with kunit_device in tests 2023-12-18 13:28:08 -07:00
soc-topology.c
soc-utils-test.c
soc-utils.c