alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Hebbar Gururaja <gururaja.hebbar@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, linaro-kernel@lists.linaro.org,
	Mark Brown <broonie@linaro.org>
Subject: [PATCH 5/6] ASoC: tlv320aic3x: Don't reference cache datastructure directly
Date: Tue, 24 Sep 2013 00:12:47 +0100	[thread overview]
Message-ID: <1379977968-25982-5-git-send-email-broonie@kernel.org> (raw)
In-Reply-To: <1379977968-25982-1-git-send-email-broonie@kernel.org>

From: Mark Brown <broonie@linaro.org>

Rather than referencing the cache directly read back the values we are
going to restore, supporting refactoring to use regmap.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 sound/soc/codecs/tlv320aic3x.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 16fc74c..83e7d85 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1068,14 +1068,14 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
 
 static int aic3x_init_3007(struct snd_soc_codec *codec)
 {
-	u8 tmp1, tmp2, *cache = codec->reg_cache;
+	unsigned int tmp1, tmp2;
 
 	/*
 	 * There is no need to cache writes to undocumented page 0xD but
 	 * respective page 0 register cache entries must be preserved
 	 */
-	tmp1 = cache[0xD];
-	tmp2 = cache[0x8];
+	tmp1 = snd_soc_read(codec, 0xD);
+	tmp2 = snd_soc_read(codec, 0x8);
 	/* Class-D speaker driver init; datasheet p. 46 */
 	snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x0D);
 	snd_soc_write(codec, 0xD, 0x0D);
@@ -1083,8 +1083,9 @@ static int aic3x_init_3007(struct snd_soc_codec *codec)
 	snd_soc_write(codec, 0x8, 0x5D);
 	snd_soc_write(codec, 0x8, 0x5C);
 	snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x00);
-	cache[0xD] = tmp1;
-	cache[0x8] = tmp2;
+
+	snd_soc_write(codec, 0xD, tmp1);
+	snd_soc_write(codec, 0x8, tmp2);
 
 	return 0;
 }
-- 
1.8.4.rc3

  parent reply	other threads:[~2013-09-23 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 23:12 [PATCH 1/6] ASoC: tlv320aic3x: Remove nonsense comment for register cache Mark Brown
2013-09-23 23:12 ` [PATCH 2/6] ASoC: tlv320aic3x: Move resource acquisition to I2C probe Mark Brown
2013-09-23 23:12 ` [PATCH 3/6] ASoC: tlv320aic3x: Move to table based control init Mark Brown
2013-09-23 23:12 ` [PATCH 4/6] ASoC: tlv320aic3x: Move to table based DAPM init Mark Brown
2013-09-23 23:12 ` Mark Brown [this message]
2013-09-23 23:12 ` [PATCH 6/6] ASoC: tlv320aic3x: Convert to direct regmap API usage 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=1379977968-25982-5-git-send-email-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@linaro.org \
    --cc=gururaja.hebbar@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).