ASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() function
diff mbox

Message ID 1401457661-2994-1-git-send-email-peter.ujfalusi@ti.com
State Accepted
Commit e6c111fac4464e3f4bf7b3802b517dafc80f8e0f
Headers show

Commit Message

Peter Ujfalusi May 30, 2014, 1:47 p.m. UTC
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@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(-)

Comments

Mark Brown June 1, 2014, 10:43 a.m. UTC | #1
On Fri, May 30, 2014 at 04:47:41PM +0300, Peter Ujfalusi wrote:
> For some unknown reason the parameters for snd_soc_test_bits() were in wrong
> order:

Applied, thanks.

Patch
diff mbox

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;