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

authored by Eric Millbrandt and committed by Mark Brown 48e3cbb3 1628af5a

+2 -1
+2 -1
sound/soc/codecs/wm9712.c
··· 463 463 { 464 464 u16 *cache = codec->reg_cache; 465 465 466 - soc_ac97_ops.write(codec->ac97, reg, val); 466 + if (reg < 0x7c) 467 + soc_ac97_ops.write(codec->ac97, reg, val); 467 468 reg = reg >> 1; 468 469 if (reg < (ARRAY_SIZE(wm9712_reg))) 469 470 cache[reg] = val;