summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm9712.c
diff options
context:
space:
mode:
authorEric Millbrandt <emillbrandt@dekaresearch.com>2009-12-22 10:13:24 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-12-23 15:20:56 +0000
commit48e3cbb3f67a27d9c2db075f3d0f700246c40caa (patch)
tree32188642f6503f6b9be38123d0368e8fd7058229 /sound/soc/codecs/wm9712.c
parent1628af5adf64cc2960bce81009f119de822f876e (diff)
ASoC: Do not write to invalid registers on the wm9712.
This patch fixes a bug where "virtual" registers were being written to the ac97 bus. This was causing unrelated registers to become corrupted (headphone 0x04, touchscreen 0x78, etc). This patch duplicates protection that was included in the wm9713 driver. Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Diffstat (limited to 'sound/soc/codecs/wm9712.c')
-rw-r--r--sound/soc/codecs/wm9712.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 0ac1215dcd9b..e237bf615129 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
{
u16 *cache = codec->reg_cache;
- soc_ac97_ops.write(codec->ac97, reg, val);
+ if (reg < 0x7c)
+ soc_ac97_ops.write(codec->ac97, reg, val);
reg = reg >> 1;
if (reg < (ARRAY_SIZE(wm9712_reg)))
cache[reg] = val;