Skip to content

Commit 409fb34

Browse files
CassivsGabriellisgregkh
authored andcommitted
ALSA: hda: cs35l56: Propagate ASP TX source control errors
[ Upstream commit 0faacc0 ] 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: 73cfbfa ("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 [ adjusted path to sound/pci/hda/ and dropped cs35l56_hda_wait_dsp_ready() context ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 247ed8a commit 409fb34

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

sound/pci/hda/cs35l56_hda.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,13 @@ static int cs35l56_hda_mixer_get(struct snd_kcontrol *kcontrol,
176176
{
177177
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
178178
unsigned int reg_val;
179-
int i;
179+
int i, ret;
180+
181+
ret = regmap_read(cs35l56->base.regmap, kcontrol->private_value,
182+
&reg_val);
183+
if (ret)
184+
return ret;
180185

181-
regmap_read(cs35l56->base.regmap, kcontrol->private_value, &reg_val);
182186
reg_val &= CS35L56_ASP_TXn_SRC_MASK;
183187

184188
for (i = 0; i < CS35L56_NUM_INPUT_SRC; ++i) {
@@ -197,13 +201,18 @@ static int cs35l56_hda_mixer_put(struct snd_kcontrol *kcontrol,
197201
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
198202
unsigned int item = ucontrol->value.enumerated.item[0];
199203
bool changed;
204+
int ret;
200205

201206
if (item >= CS35L56_NUM_INPUT_SRC)
202207
return -EINVAL;
203208

204-
regmap_update_bits_check(cs35l56->base.regmap, kcontrol->private_value,
205-
CS35L56_INPUT_MASK, cs35l56_tx_input_values[item],
206-
&changed);
209+
ret = regmap_update_bits_check(cs35l56->base.regmap,
210+
kcontrol->private_value,
211+
CS35L56_INPUT_MASK,
212+
cs35l56_tx_input_values[item],
213+
&changed);
214+
if (ret)
215+
return ret;
207216

208217
return changed;
209218
}

0 commit comments

Comments
 (0)