diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-10-14 23:46:02 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-22 06:09:54 -0400 |
commit | 0d8d293898ff0ea395840cdf2ac85fbd53c8d3ea (patch) | |
tree | 3cd14ea8d4335439ee1974e5d4c2892f99df5ead /sound | |
parent | 226d0f22d044f0151287bb7cf334b85182248f0e (diff) |
ASoC: max98095: Convert codec->hw_write to snd_soc_write
codec->hw_write is broken now, convert codec->hw_write to snd_soc_write.
The hardware has 2 banks of registers sharing a section in I2C register space.
The 1st bank is the primary one and is cached.
The 2nd bank is for loading coefficients only and they do not need cache.
These coefficients registers are therefore direct writes.
Thus we set cache_bypass flag to deal with this before calling snd_soc_write.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/max98095.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 6982f743c891..26d7b089fb9c 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c | |||
@@ -617,14 +617,13 @@ static int max98095_volatile(struct snd_soc_codec *codec, unsigned int reg) | |||
617 | static int max98095_hw_write(struct snd_soc_codec *codec, unsigned int reg, | 617 | static int max98095_hw_write(struct snd_soc_codec *codec, unsigned int reg, |
618 | unsigned int value) | 618 | unsigned int value) |
619 | { | 619 | { |
620 | u8 data[2]; | 620 | int ret; |
621 | 621 | ||
622 | data[0] = reg; | 622 | codec->cache_bypass = 1; |
623 | data[1] = value; | 623 | ret = snd_soc_write(codec, reg, value); |
624 | if (codec->hw_write(codec->control_data, data, 2) == 2) | 624 | codec->cache_bypass = 0; |
625 | return 0; | 625 | |
626 | else | 626 | return ret ? -EIO : 0; |
627 | return -EIO; | ||
628 | } | 627 | } |
629 | 628 | ||
630 | /* | 629 | /* |