diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-11-13 20:05:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-27 13:50:17 -0500 |
commit | 3bb0f7c31b1aedd0f85c675297031281799145d7 (patch) | |
tree | e299bc3a2cc3d50e0414de66981866006a787dc6 | |
parent | 2dbb29cd977fc281f71f8895abce7e382efe77e1 (diff) |
ASoC: don't use snd_soc_write/read on twl4030
twl4030 doesn't use regmap nor reg_cache. Its write/read are done
through twl4030_reg_write/read. This driver directly calling these
functions, but sometimes using snd_soc_write/read.
As part of cleanup, snd_soc_codec_driver::write, read will be
removed soon. Then, write/read access through snd_soc_write/read
will doesn't work on this driver, since it doesn't use regmap nor
reg_cache.
This patch replace snd_soc_write/read to twl4030_write/read.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/twl4030.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 90691701b082..8798182959c1 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -850,14 +850,14 @@ static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol, | |||
850 | int mask = (1 << fls(max)) - 1; | 850 | int mask = (1 << fls(max)) - 1; |
851 | 851 | ||
852 | ucontrol->value.integer.value[0] = | 852 | ucontrol->value.integer.value[0] = |
853 | (snd_soc_read(codec, reg) >> shift) & mask; | 853 | (twl4030_read(codec, reg) >> shift) & mask; |
854 | if (ucontrol->value.integer.value[0]) | 854 | if (ucontrol->value.integer.value[0]) |
855 | ucontrol->value.integer.value[0] = | 855 | ucontrol->value.integer.value[0] = |
856 | max + 1 - ucontrol->value.integer.value[0]; | 856 | max + 1 - ucontrol->value.integer.value[0]; |
857 | 857 | ||
858 | if (shift != rshift) { | 858 | if (shift != rshift) { |
859 | ucontrol->value.integer.value[1] = | 859 | ucontrol->value.integer.value[1] = |
860 | (snd_soc_read(codec, reg) >> rshift) & mask; | 860 | (twl4030_read(codec, reg) >> rshift) & mask; |
861 | if (ucontrol->value.integer.value[1]) | 861 | if (ucontrol->value.integer.value[1]) |
862 | ucontrol->value.integer.value[1] = | 862 | ucontrol->value.integer.value[1] = |
863 | max + 1 - ucontrol->value.integer.value[1]; | 863 | max + 1 - ucontrol->value.integer.value[1]; |
@@ -908,9 +908,9 @@ static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, | |||
908 | int mask = (1<<fls(max))-1; | 908 | int mask = (1<<fls(max))-1; |
909 | 909 | ||
910 | ucontrol->value.integer.value[0] = | 910 | ucontrol->value.integer.value[0] = |
911 | (snd_soc_read(codec, reg) >> shift) & mask; | 911 | (twl4030_read(codec, reg) >> shift) & mask; |
912 | ucontrol->value.integer.value[1] = | 912 | ucontrol->value.integer.value[1] = |
913 | (snd_soc_read(codec, reg2) >> shift) & mask; | 913 | (twl4030_read(codec, reg2) >> shift) & mask; |
914 | 914 | ||
915 | if (ucontrol->value.integer.value[0]) | 915 | if (ucontrol->value.integer.value[0]) |
916 | ucontrol->value.integer.value[0] = | 916 | ucontrol->value.integer.value[0] = |
@@ -2195,8 +2195,6 @@ static int twl4030_soc_remove(struct snd_soc_codec *codec) | |||
2195 | static const struct snd_soc_codec_driver soc_codec_dev_twl4030 = { | 2195 | static const struct snd_soc_codec_driver soc_codec_dev_twl4030 = { |
2196 | .probe = twl4030_soc_probe, | 2196 | .probe = twl4030_soc_probe, |
2197 | .remove = twl4030_soc_remove, | 2197 | .remove = twl4030_soc_remove, |
2198 | .read = twl4030_read, | ||
2199 | .write = twl4030_write, | ||
2200 | .set_bias_level = twl4030_set_bias_level, | 2198 | .set_bias_level = twl4030_set_bias_level, |
2201 | .idle_bias_off = true, | 2199 | .idle_bias_off = true, |
2202 | 2200 | ||