[alsa-devel] [PATCH] ASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() function

Peter Ujfalusi peter.ujfalusi at ti.com
Fri May 30 15:47:41 CEST 2014


For some unknown reason the parameters for snd_soc_test_bits() were in wrong
order:
It was:
snd_soc_test_bits(codec, val, mask, reg); /* WRONG!!! */
while it should be:
snd_soc_test_bits(codec, reg, mask, val);

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
Hi,

so the failures I was seeing was indeed caused by something one never expects:
wrong parameter order for snd_soc_test_bits() in the tlv320aic3x driver, so
regmap failed time to time when we asked it to read a register out of the valid
range, since the value was sent as register number :o

Regards,
Peter

 sound/soc/codecs/tlv320aic3x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index d7349bc89ad3..e12fafbb1e09 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -169,7 +169,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
 	mask <<= shift;
 	val <<= shift;
 
-	change = snd_soc_test_bits(codec, val, mask, reg);
+	change = snd_soc_test_bits(codec, reg, mask, val);
 	if (change) {
 		update.kcontrol = kcontrol;
 		update.reg = reg;
-- 
1.9.3



More information about the Alsa-devel mailing list