aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-07-03 10:51:36 -0400
committerMark Brown <broonie@linaro.org>2014-07-03 14:42:40 -0400
commit3ad80b828b2533f37c221e2df155774efd6ed814 (patch)
tree1621da76a8fa3d03550bab80cd9a09a86b1f1f4e
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
ASoC: adau1701: fix adau1701_reg_read()
Fix a long standing bug in the read register routing of adau1701. The bytes arrive in the buffer in big-endian, so the result has to be shifted before and-ing the bytes in the loop. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
-rw-r--r--sound/soc/codecs/adau1701.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index d71c59cf7bdd..370b742117ef 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -230,8 +230,10 @@ static int adau1701_reg_read(void *context, unsigned int reg,
230 230
231 *value = 0; 231 *value = 0;
232 232
233 for (i = 0; i < size; i++) 233 for (i = 0; i < size; i++) {
234 *value |= recv_buf[i] << (i * 8); 234 *value <<= 8;
235 *value |= recv_buf[i];
236 }
235 237
236 return 0; 238 return 0;
237} 239}