Skip to content

Commit

Permalink
ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682…
Browse files Browse the repository at this point in the history
…_DEVICE_ID

[ Upstream commit c0372bc ]

RT5682_DEVICE_ID is a volatile register, we can not read it in cache
only mode.

Fixes: 03f6fc6 ("ASoC: rt5682: Add the soundwire support")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210607222239.582139-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
bardliao authored and gregkh committed Jul 14, 2021
1 parent 1863731 commit c7c275d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sound/soc/codecs/rt5682-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)

pm_runtime_get_noresume(&slave->dev);

if (rt5682->first_hw_init) {
regcache_cache_only(rt5682->regmap, false);
regcache_cache_bypass(rt5682->regmap, true);
}

while (loop > 0) {
regmap_read(rt5682->regmap, RT5682_DEVICE_ID, &val);
if (val == DEVICE_ID)
Expand All @@ -415,11 +420,6 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
goto err_nodev;
}

if (rt5682->first_hw_init) {
regcache_cache_only(rt5682->regmap, false);
regcache_cache_bypass(rt5682->regmap, true);
}

rt5682_calibrate(rt5682);

if (rt5682->first_hw_init) {
Expand Down

0 comments on commit c7c275d

Please sign in to comment.