All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Oder Chiou <oder_chiou@realtek.com>,
	Jack Yu <jack.yu@realtek.com>,
	Ryan Lee <ryans.lee@maximintegrated.com>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	broonie@kernel.org, Shuming Fan <shumingf@realtek.com>,
	Bard liao <yung-chuan.liao@linux.intel.com>
Subject: [PATCH 13/15] ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682_DEVICE_ID
Date: Mon,  7 Jun 2021 17:22:37 -0500	[thread overview]
Message-ID: <20210607222239.582139-14-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20210607222239.582139-1-pierre-louis.bossart@linux.intel.com>

From: Bard Liao <yung-chuan.liao@linux.intel.com>

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

Fixes: 03f6fc6de919 ("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>
---
 sound/soc/codecs/rt5682-sdw.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c
index 529a85fd0a00..54873730bec5 100644
--- a/sound/soc/codecs/rt5682-sdw.c
+++ b/sound/soc/codecs/rt5682-sdw.c
@@ -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)
@@ -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) {
-- 
2.25.1


  parent reply	other threads:[~2021-06-07 22:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 22:22 [PATCH 00/15] ASoC: fixes for SoundWire codec drivers Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 01/15] ASoC: max98373-sdw: add missing memory allocation check Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 02/15] ASoC: max98373-sdw: use first_hw_init flag on resume Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 03/15] ASoC: rt1308-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 04/15] ASoC: rt1316-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 05/15] ASoC: rt5682-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 06/15] ASoC: rt700-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 07/15] ASoC: rt711-sdca-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 08/15] ASoC: rt711-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 09/15] ASoC: rt715-sdca-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 10/15] ASoC: rt715-sdw: " Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 11/15] ASoC: rt715-sdca: fix clock stop prepare timeout issue Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 12/15] ASoC: rt5682: Fix a problem with error handling in the io init function of the soundwire Pierre-Louis Bossart
2021-06-07 22:22 ` Pierre-Louis Bossart [this message]
2021-06-07 22:22 ` [PATCH 14/15] ASoC: rt711-sdca-sdw: add readable for SDW_SDCA_CTL() registers Pierre-Louis Bossart
2021-06-07 22:22 ` [PATCH 15/15] ASoC: rt711-sdca: handle mbq_regmap in rt711_sdca_io_init Pierre-Louis Bossart
2021-06-08 16:06 ` [PATCH 00/15] ASoC: fixes for SoundWire codec drivers Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210607222239.582139-14-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jack.yu@realtek.com \
    --cc=oder_chiou@realtek.com \
    --cc=ryans.lee@maximintegrated.com \
    --cc=shumingf@realtek.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.