aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic3x.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-09-23 14:55:39 -0400
committerMark Brown <broonie@linaro.org>2013-09-24 14:32:58 -0400
commit2677b4bb7316c07dd53535e01bd9b2ec699d0314 (patch)
tree475d25497de3d393077f90772c502796018419b8 /sound/soc/codecs/tlv320aic3x.c
parent58a63fbd7c80510140a94442b2ca9199bb6d51c3 (diff)
ASoC: tlv320aic3x: Don't reference cache datastructure directly
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>
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r--sound/soc/codecs/tlv320aic3x.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 16fc74cae754..83e7d855c49a 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,
1068 1068
1069static int aic3x_init_3007(struct snd_soc_codec *codec) 1069static int aic3x_init_3007(struct snd_soc_codec *codec)
1070{ 1070{
1071 u8 tmp1, tmp2, *cache = codec->reg_cache; 1071 unsigned int tmp1, tmp2;
1072 1072
1073 /* 1073 /*
1074 * There is no need to cache writes to undocumented page 0xD but 1074 * There is no need to cache writes to undocumented page 0xD but
1075 * respective page 0 register cache entries must be preserved 1075 * respective page 0 register cache entries must be preserved
1076 */ 1076 */
1077 tmp1 = cache[0xD]; 1077 tmp1 = snd_soc_read(codec, 0xD);
1078 tmp2 = cache[0x8]; 1078 tmp2 = snd_soc_read(codec, 0x8);
1079 /* Class-D speaker driver init; datasheet p. 46 */ 1079 /* Class-D speaker driver init; datasheet p. 46 */
1080 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x0D); 1080 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x0D);
1081 snd_soc_write(codec, 0xD, 0x0D); 1081 snd_soc_write(codec, 0xD, 0x0D);
@@ -1083,8 +1083,9 @@ static int aic3x_init_3007(struct snd_soc_codec *codec)
1083 snd_soc_write(codec, 0x8, 0x5D); 1083 snd_soc_write(codec, 0x8, 0x5D);
1084 snd_soc_write(codec, 0x8, 0x5C); 1084 snd_soc_write(codec, 0x8, 0x5C);
1085 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x00); 1085 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x00);
1086 cache[0xD] = tmp1; 1086
1087 cache[0x8] = tmp2; 1087 snd_soc_write(codec, 0xD, tmp1);
1088 snd_soc_write(codec, 0x8, tmp2);
1088 1089
1089 return 0; 1090 return 0;
1090} 1091}