ASoC: SoundWire codecs: make regmap cache-only in probe
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 2 Aug 2023 15:36:15 +0000 (10:36 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 7 Aug 2023 13:32:20 +0000 (14:32 +0100)
commit49ae74abc76b2d9be4777e7ac833674fa4749071
treee321af3e7d72eb374ed23a3d458376d1930b9910
parent3f3d66ba998fb079c1239430e96e3b138bc63166
ASoC: SoundWire codecs: make regmap cache-only in probe

The SoundWire bus may start after the probe where the SoundWire ASoC
components are registered. This creates a time window where the card
can be created and the registers be accessed.

As discussed on the mailing list, we can't really control when codecs
are enumerated and initialized, but we can make sure the access to the
codecs is cached until the hardware is accessible.

This patch configures regcache_cache_only() with a 'true' parameter in
the probe function, and a 'false' parameter in the io_init routine.

The rt5682 is handled through a different patch due to its specific
cache handling.

Link: https://lore.kernel.org/alsa-devel/20230503144102.242240-1-krzysztof.kozlowski@linaro.org/
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 files changed:
sound/soc/codecs/max98363.c
sound/soc/codecs/max98373-sdw.c
sound/soc/codecs/rt1308-sdw.c
sound/soc/codecs/rt1316-sdw.c
sound/soc/codecs/rt1318-sdw.c
sound/soc/codecs/rt700.c
sound/soc/codecs/rt711-sdca.c
sound/soc/codecs/rt711.c
sound/soc/codecs/rt712-sdca-dmic.c
sound/soc/codecs/rt712-sdca.c
sound/soc/codecs/rt715-sdca.c
sound/soc/codecs/rt715.c