ASoC: wm_adsp: Fix halo scratch register reading.
authorjbodzay <james.bodzay@cirrus.com>
Mon, 27 Aug 2018 15:40:31 +0000 (16:40 +0100)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:37:03 +0000 (17:37 +0800)
Halo register addresses increment by 8 instead of the usual 4. Read
sequential scratch registers accordingly.

MOT-CRs-fixed: (CR)
Signed-off-by: James Bodzay <jbodzay@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Change-Id: I88294fa44ba1748b5127824b708bbbf8122dcfc8
Reviewed-on: https://gerrit.mot.com/1383853
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Zhengming Yao <yaozm1@mt.com>
sound/soc/codecs/wm_adsp.c

index a86fcea330738b04d798fd72aa496c6e0b027a04..1a7830d02a9a5117d6c4b44d30ef216b21b1f534 100755 (executable)
@@ -1077,21 +1077,21 @@ static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp)
 
 static void wm_halo_show_fw_status(struct wm_adsp *dsp)
 {
-       u32 scratch[4];
-       int ret;
+       unsigned int scratch[4];
+       unsigned int addr = dsp->base + HALO_SCRATCH1;
+       int ret, i;
 
-       ret = regmap_raw_read(dsp->regmap, dsp->base + HALO_SCRATCH1,
-                             scratch, sizeof(scratch));
-       if (ret) {
-               adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret);
-               return;
+       for (i = 0; i < ARRAY_SIZE(scratch); i++) {
+               ret = regmap_read(dsp->regmap, addr, &scratch[i]);
+               addr += 8;
+               if (ret) {
+                       adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret);
+                       return;
+               }
        }
 
        adsp_dbg(dsp, "FW SCRATCH 1:0x%x 2:0x%x 3:0x%x 4:0x%x\n",
-                be32_to_cpu(scratch[0]),
-                be32_to_cpu(scratch[1]),
-                be32_to_cpu(scratch[2]),
-                be32_to_cpu(scratch[3]));
+                scratch[0], scratch[1], scratch[2], scratch[3]);
 }
 
 static inline struct wm_coeff_ctl *bytes_ext_to_ctl(struct soc_bytes_ext *ext)