Skip to content

Commit 636535b

Browse files
jbodzaystuhenderson
authored andcommitted
ASoC: wm_adsp: Fix halo scratch register reading.
Halo register addresses increment by 8 instead of the usual 4. Read sequential scratch registers accordingly. Signed-off-by: James Bodzay <[email protected]> Signed-off-by: Richard Fitzgerald <[email protected]> Change-Id: I88294fa44ba1748b5127824b708bbbf8122dcfc8
1 parent 11631ca commit 636535b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,21 +1084,21 @@ static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp)
10841084

10851085
static void wm_halo_show_fw_status(struct wm_adsp *dsp)
10861086
{
1087-
u32 scratch[4];
1088-
int ret;
1087+
unsigned int scratch[4];
1088+
unsigned int addr = dsp->base + HALO_SCRATCH1;
1089+
int ret, i;
10891090

1090-
ret = regmap_raw_read(dsp->regmap, dsp->base + HALO_SCRATCH1,
1091-
scratch, sizeof(scratch));
1092-
if (ret) {
1093-
adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret);
1094-
return;
1091+
for (i = 0; i < ARRAY_SIZE(scratch); i++) {
1092+
ret = regmap_read(dsp->regmap, addr, &scratch[i]);
1093+
addr += 8;
1094+
if (ret) {
1095+
adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret);
1096+
return;
1097+
}
10951098
}
10961099

10971100
adsp_dbg(dsp, "FW SCRATCH 1:0x%x 2:0x%x 3:0x%x 4:0x%x\n",
1098-
be32_to_cpu(scratch[0]),
1099-
be32_to_cpu(scratch[1]),
1100-
be32_to_cpu(scratch[2]),
1101-
be32_to_cpu(scratch[3]));
1101+
scratch[0], scratch[1], scratch[2], scratch[3]);
11021102
}
11031103

11041104
static inline struct wm_coeff_ctl *bytes_ext_to_ctl(struct soc_bytes_ext *ext)

0 commit comments

Comments
 (0)