diff mbox series

[1/2] ASoC: rt9120: Fix 3byte read, valule offset typo

Message ID 1652926418-8519-2-git-send-email-u0084500@gmail.com (mailing list archive)
State Accepted
Commit 57f68f2168988e574133fb5abcd73949bf1d1df2
Headers show
Series ASoC: rt9120: Fix 3byte read logic and optimize 'PWDN' control | expand

Commit Message

ChiYuan Huang May 19, 2022, 2:13 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com>

For RG 3byte read, the value order is  offset [0], [1], and [2].

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 sound/soc/codecs/rt9120.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt9120.c b/sound/soc/codecs/rt9120.c
index cdf8ad2..94d42be 100644
--- a/sound/soc/codecs/rt9120.c
+++ b/sound/soc/codecs/rt9120.c
@@ -372,7 +372,7 @@  static int rt9120_reg_read(void *context, unsigned int reg, unsigned int *val)
 		*val = be32_to_cpup((__be32 *)raw);
 		break;
 	case 3:
-		*val = raw[0] << 16 | raw[1] << 8 | raw[0];
+		*val = raw[0] << 16 | raw[1] << 8 | raw[2];
 		break;
 	case 2:
 		*val = be16_to_cpup((__be16 *)raw);