From a66d2accdafd9e4fe3d4d7c5c595884e1a45ebf5 Mon Sep 17 00:00:00 2001 From: jbodzay Date: Mon, 27 Aug 2018 16:40:31 +0100 Subject: [PATCH] ASoC: wm_adsp: Fix halo scratch register reading. 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 Signed-off-by: Richard Fitzgerald 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 --- sound/soc/codecs/wm_adsp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index a86fcea33073..1a7830d02a9a 100755 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -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) -- 2.20.1