Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: hda: cs35l56: Propagate ASP TX source control errors

cs35l56_hda_mixer_get() ignores regmap_read() and
cs35l56_hda_mixer_put() ignores regmap_update_bits_check().

This makes the ASP TX source controls report success when a regmap
access fails. The write path returns no change instead of an error,
and the read path continues after a failed read instead of aborting
the control callback.

Propagate the regmap errors, matching the posture and volume controls
in this driver.

Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
Cc: stable@vger.kernel.org
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260423-alsa-cs35l56-asp-tx-source-errors-v1-1-17ea7c62ec31@gmail.com

authored by

Cássio Gabriel and committed by
Takashi Iwai
0faacc08 254f4963

+14 -5
+14 -5
sound/hda/codecs/side-codecs/cs35l56_hda.c
··· 180 180 { 181 181 struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol); 182 182 unsigned int reg_val; 183 - int i; 183 + int i, ret; 184 184 185 185 cs35l56_hda_wait_dsp_ready(cs35l56); 186 186 187 - regmap_read(cs35l56->base.regmap, kcontrol->private_value, &reg_val); 187 + ret = regmap_read(cs35l56->base.regmap, kcontrol->private_value, 188 + &reg_val); 189 + if (ret) 190 + return ret; 191 + 188 192 reg_val &= CS35L56_ASP_TXn_SRC_MASK; 189 193 190 194 for (i = 0; i < CS35L56_NUM_INPUT_SRC; ++i) { ··· 207 203 struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol); 208 204 unsigned int item = ucontrol->value.enumerated.item[0]; 209 205 bool changed; 206 + int ret; 210 207 211 208 if (item >= CS35L56_NUM_INPUT_SRC) 212 209 return -EINVAL; 213 210 214 211 cs35l56_hda_wait_dsp_ready(cs35l56); 215 212 216 - regmap_update_bits_check(cs35l56->base.regmap, kcontrol->private_value, 217 - CS35L56_INPUT_MASK, cs35l56_tx_input_values[item], 218 - &changed); 213 + ret = regmap_update_bits_check(cs35l56->base.regmap, 214 + kcontrol->private_value, 215 + CS35L56_INPUT_MASK, 216 + cs35l56_tx_input_values[item], 217 + &changed); 218 + if (ret) 219 + return ret; 219 220 220 221 return changed; 221 222 }