diff options
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r-- | sound/soc/codecs/max98088.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index d63e28773eb1..6447dbb2f123 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -40,7 +40,6 @@ struct max98088_cdata { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct max98088_priv { | 42 | struct max98088_priv { |
43 | u8 reg_cache[M98088_REG_CNT]; | ||
44 | enum max98088_type devtype; | 43 | enum max98088_type devtype; |
45 | void *control_data; | 44 | void *control_data; |
46 | struct max98088_pdata *pdata; | 45 | struct max98088_pdata *pdata; |
@@ -1588,7 +1587,7 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai, | |||
1588 | 1587 | ||
1589 | static void max98088_sync_cache(struct snd_soc_codec *codec) | 1588 | static void max98088_sync_cache(struct snd_soc_codec *codec) |
1590 | { | 1589 | { |
1591 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | 1590 | u16 *reg_cache = codec->reg_cache; |
1592 | int i; | 1591 | int i; |
1593 | 1592 | ||
1594 | if (!codec->cache_sync) | 1593 | if (!codec->cache_sync) |
@@ -1599,14 +1598,14 @@ static void max98088_sync_cache(struct snd_soc_codec *codec) | |||
1599 | /* write back cached values if they're writeable and | 1598 | /* write back cached values if they're writeable and |
1600 | * different from the hardware default. | 1599 | * different from the hardware default. |
1601 | */ | 1600 | */ |
1602 | for (i = 1; i < ARRAY_SIZE(max98088->reg_cache); i++) { | 1601 | for (i = 1; i < codec->driver->reg_cache_size; i++) { |
1603 | if (!max98088_access[i].writable) | 1602 | if (!max98088_access[i].writable) |
1604 | continue; | 1603 | continue; |
1605 | 1604 | ||
1606 | if (max98088->reg_cache[i] == max98088_reg[i]) | 1605 | if (reg_cache[i] == max98088_reg[i]) |
1607 | continue; | 1606 | continue; |
1608 | 1607 | ||
1609 | snd_soc_write(codec, i, max98088->reg_cache[i]); | 1608 | snd_soc_write(codec, i, reg_cache[i]); |
1610 | } | 1609 | } |
1611 | 1610 | ||
1612 | codec->cache_sync = 0; | 1611 | codec->cache_sync = 0; |
@@ -1951,7 +1950,6 @@ static int max98088_probe(struct snd_soc_codec *codec) | |||
1951 | int ret = 0; | 1950 | int ret = 0; |
1952 | 1951 | ||
1953 | codec->cache_sync = 1; | 1952 | codec->cache_sync = 1; |
1954 | memcpy(codec->reg_cache, max98088_reg, sizeof(max98088_reg)); | ||
1955 | 1953 | ||
1956 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); | 1954 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); |
1957 | if (ret != 0) { | 1955 | if (ret != 0) { |