aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt715.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2023-08-02 10:36:15 -0500
committerMark Brown <broonie@kernel.org>2023-08-07 14:32:20 +0100
commit49ae74abc76b2d9be4777e7ac833674fa4749071 (patch)
treee321af3e7d72eb374ed23a3d458376d1930b9910 /sound/soc/codecs/rt715.c
parent3f3d66ba998fb079c1239430e96e3b138bc63166 (diff)
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>
Diffstat (limited to 'sound/soc/codecs/rt715.c')
-rw-r--r--sound/soc/codecs/rt715.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt715.c b/sound/soc/codecs/rt715.c
index 6c2e165dd621..1bd2fe8aa625 100644
--- a/sound/soc/codecs/rt715.c
+++ b/sound/soc/codecs/rt715.c
@@ -984,6 +984,8 @@ int rt715_init(struct device *dev, struct regmap *sdw_regmap,
rt715->regmap = regmap;
rt715->sdw_regmap = sdw_regmap;
+ regcache_cache_only(rt715->regmap, true);
+
/*
* Mark hw_init to false
* HW init will be performed when device reports present
@@ -1006,6 +1008,8 @@ int rt715_io_init(struct device *dev, struct sdw_slave *slave)
if (rt715->hw_init)
return 0;
+ regcache_cache_only(rt715->regmap, false);
+
/*
* PM runtime is only enabled when a Slave reports as Attached
*/