aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98088.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-28 18:42:53 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-28 18:42:53 -0500
commit22a756ee8951e597c76e5a60f81d40a43054489e (patch)
tree10415d740b2876dc13ac7b0f857a7717987b9ddf /sound/soc/codecs/max98088.c
parent839d271c509b6ce5c1da8a8e89fad73a1af0ddda (diff)
parent776065e36de1d5eb9e33ff908352fef4050ab38d (diff)
Merge branch 'for-2.6.37' into for-2.6.38
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r--sound/soc/codecs/max98088.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index 335a002aaf0e..37133c40e762 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -39,7 +39,6 @@ struct max98088_cdata {
39}; 39};
40 40
41struct max98088_priv { 41struct max98088_priv {
42 u8 reg_cache[M98088_REG_CNT];
43 enum max98088_type devtype; 42 enum max98088_type devtype;
44 void *control_data; 43 void *control_data;
45 struct max98088_pdata *pdata; 44 struct max98088_pdata *pdata;
@@ -1589,7 +1588,7 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai,
1589 1588
1590static void max98088_sync_cache(struct snd_soc_codec *codec) 1589static void max98088_sync_cache(struct snd_soc_codec *codec)
1591{ 1590{
1592 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 1591 u16 *reg_cache = codec->reg_cache;
1593 int i; 1592 int i;
1594 1593
1595 if (!codec->cache_sync) 1594 if (!codec->cache_sync)
@@ -1600,14 +1599,14 @@ static void max98088_sync_cache(struct snd_soc_codec *codec)
1600 /* write back cached values if they're writeable and 1599 /* write back cached values if they're writeable and
1601 * different from the hardware default. 1600 * different from the hardware default.
1602 */ 1601 */
1603 for (i = 1; i < ARRAY_SIZE(max98088->reg_cache); i++) { 1602 for (i = 1; i < codec->driver->reg_cache_size; i++) {
1604 if (!max98088_access[i].writable) 1603 if (!max98088_access[i].writable)
1605 continue; 1604 continue;
1606 1605
1607 if (max98088->reg_cache[i] == max98088_reg[i]) 1606 if (reg_cache[i] == max98088_reg[i])
1608 continue; 1607 continue;
1609 1608
1610 snd_soc_write(codec, i, max98088->reg_cache[i]); 1609 snd_soc_write(codec, i, reg_cache[i]);
1611 } 1610 }
1612 1611
1613 codec->cache_sync = 0; 1612 codec->cache_sync = 0;
@@ -1952,7 +1951,6 @@ static int max98088_probe(struct snd_soc_codec *codec)
1952 int ret = 0; 1951 int ret = 0;
1953 1952
1954 codec->cache_sync = 1; 1953 codec->cache_sync = 1;
1955 memcpy(codec->reg_cache, max98088_reg, sizeof(max98088_reg));
1956 1954
1957 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); 1955 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C);
1958 if (ret != 0) { 1956 if (ret != 0) {