Skip to content

Commit 2f33044

Browse files
Xu Raogregkh
authored andcommitted
ALSA: hda: Fix cached processing coefficient verbs
commit f67be28 upstream. Intel HD Audio defines Coefficient Index and Processing Coefficient as separate audio widget controls in the Audio Widget Verb Definitions: Coefficient Index selects the coefficient slot, while Processing Coefficient accesses the value at the selected slot. hda_reg_read_coef() selects the slot with AC_VERB_SET_COEF_INDEX, but then uses AC_VERB_GET_COEF_INDEX for the value read. That reads back the selected index instead of the coefficient value. hda_reg_write_coef() has the same issue and builds the value write from AC_VERB_GET_COEF_INDEX instead of AC_VERB_SET_PROC_COEF. This only affects the regmap coefficient cache path used by codecs that set codec->cache_coef. Direct coefficient helpers already use the normal SET_COEF_INDEX followed by GET_PROC_COEF or SET_PROC_COEF sequence, which is likely why this has not been noticed widely. Use AC_VERB_GET_PROC_COEF for cached coefficient reads and AC_VERB_SET_PROC_COEF for cached coefficient writes. Fixes: 40ba66a ("ALSA: hda - Add cache support for COEF read/write") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao <raoxu@uniontech.com> Link: https://patch.msgid.link/DB9023BF2920BA99+20260707132419.1731342-1-raoxu@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ae7f5b0 commit 2f33044

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/hda/core/regmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int hda_reg_read_coef(struct hdac_device *codec, unsigned int reg,
214214
err = snd_hdac_exec_verb(codec, verb, 0, NULL);
215215
if (err < 0)
216216
return err;
217-
verb = (reg & ~0xfffff) | (AC_VERB_GET_COEF_INDEX << 8);
217+
verb = (reg & ~0xfffff) | (AC_VERB_GET_PROC_COEF << 8);
218218
return snd_hdac_exec_verb(codec, verb, 0, val);
219219
}
220220

@@ -232,7 +232,7 @@ static int hda_reg_write_coef(struct hdac_device *codec, unsigned int reg,
232232
err = snd_hdac_exec_verb(codec, verb, 0, NULL);
233233
if (err < 0)
234234
return err;
235-
verb = (reg & ~0xfffff) | (AC_VERB_GET_COEF_INDEX << 8) |
235+
verb = (reg & ~0xfffff) | (AC_VERB_SET_PROC_COEF << 8) |
236236
(val & 0xffff);
237237
return snd_hdac_exec_verb(codec, verb, 0, NULL);
238238
}

0 commit comments

Comments
 (0)