diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-10-03 21:58:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-04 07:03:49 -0400 |
commit | c6d43417dd0ff6d4431f6f52e6eac1f48ff779b2 (patch) | |
tree | 076fb7ef681cb27c21606c3eacced3553e3271d3 /sound | |
parent | 11b9ce622a8c29740707e5fbb54cddf8d7892398 (diff) |
ASoC: wm8971: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8971.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 572bb80627a4..ce33a94b6aad 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c | |||
@@ -660,25 +660,14 @@ static int wm8971_probe(struct snd_soc_codec *codec) | |||
660 | msecs_to_jiffies(1000)); | 660 | msecs_to_jiffies(1000)); |
661 | 661 | ||
662 | /* set the update bits */ | 662 | /* set the update bits */ |
663 | reg = snd_soc_read(codec, WM8971_LDAC); | 663 | snd_soc_update_bits(codec, WM8971_LDAC, 0x0100, 0x0100); |
664 | snd_soc_write(codec, WM8971_LDAC, reg | 0x0100); | 664 | snd_soc_update_bits(codec, WM8971_RDAC, 0x0100, 0x0100); |
665 | reg = snd_soc_read(codec, WM8971_RDAC); | 665 | snd_soc_update_bits(codec, WM8971_LOUT1V, 0x0100, 0x0100); |
666 | snd_soc_write(codec, WM8971_RDAC, reg | 0x0100); | 666 | snd_soc_update_bits(codec, WM8971_ROUT1V, 0x0100, 0x0100); |
667 | 667 | snd_soc_update_bits(codec, WM8971_LOUT2V, 0x0100, 0x0100); | |
668 | reg = snd_soc_read(codec, WM8971_LOUT1V); | 668 | snd_soc_update_bits(codec, WM8971_ROUT2V, 0x0100, 0x0100); |
669 | snd_soc_write(codec, WM8971_LOUT1V, reg | 0x0100); | 669 | snd_soc_update_bits(codec, WM8971_LINVOL, 0x0100, 0x0100); |
670 | reg = snd_soc_read(codec, WM8971_ROUT1V); | 670 | snd_soc_update_bits(codec, WM8971_RINVOL, 0x0100, 0x0100); |
671 | snd_soc_write(codec, WM8971_ROUT1V, reg | 0x0100); | ||
672 | |||
673 | reg = snd_soc_read(codec, WM8971_LOUT2V); | ||
674 | snd_soc_write(codec, WM8971_LOUT2V, reg | 0x0100); | ||
675 | reg = snd_soc_read(codec, WM8971_ROUT2V); | ||
676 | snd_soc_write(codec, WM8971_ROUT2V, reg | 0x0100); | ||
677 | |||
678 | reg = snd_soc_read(codec, WM8971_LINVOL); | ||
679 | snd_soc_write(codec, WM8971_LINVOL, reg | 0x0100); | ||
680 | reg = snd_soc_read(codec, WM8971_RINVOL); | ||
681 | snd_soc_write(codec, WM8971_RINVOL, reg | 0x0100); | ||
682 | 671 | ||
683 | snd_soc_add_controls(codec, wm8971_snd_controls, | 672 | snd_soc_add_controls(codec, wm8971_snd_controls, |
684 | ARRAY_SIZE(wm8971_snd_controls)); | 673 | ARRAY_SIZE(wm8971_snd_controls)); |