summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt1308-sdw.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/rt1308-sdw.c
parent3f3d66ba998fb079c1239430e96e3b138bc63166 (diff)
downloadlinux-stable-49ae74abc76b2d9be4777e7ac833674fa4749071.tar.gz
linux-stable-49ae74abc76b2d9be4777e7ac833674fa4749071.tar.bz2
linux-stable-49ae74abc76b2d9be4777e7ac833674fa4749071.zip
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/rt1308-sdw.c')
-rw-r--r--sound/soc/codecs/rt1308-sdw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c
index a7740549d35c..2c4e5330c2df 100644
--- a/sound/soc/codecs/rt1308-sdw.c
+++ b/sound/soc/codecs/rt1308-sdw.c
@@ -218,10 +218,9 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
if (rt1308->hw_init)
return 0;
- if (rt1308->first_hw_init) {
- regcache_cache_only(rt1308->regmap, false);
+ regcache_cache_only(rt1308->regmap, false);
+ if (rt1308->first_hw_init)
regcache_cache_bypass(rt1308->regmap, true);
- }
/*
* PM runtime is only enabled when a Slave reports as Attached
@@ -688,6 +687,8 @@ static int rt1308_sdw_init(struct device *dev, struct regmap *regmap,
rt1308->sdw_slave = slave;
rt1308->regmap = regmap;
+ regcache_cache_only(rt1308->regmap, true);
+
/*
* Mark hw_init to false
* HW init will be performed when device reports present