ASoC: rt9120: Fix 3byte read, valule offset typo
authorChiYuan Huang <cy_huang@richtek.com>
Thu, 19 May 2022 02:13:37 +0000 (10:13 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 19 May 2022 15:47:11 +0000 (16:47 +0100)
For RG 3byte read, the value order is  offset [0], [1], and [2].

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1652926418-8519-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt9120.c

index cdf8ad2..94d42be 100644 (file)
@@ -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);