mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
ALSA: usb-audio: Update Babyface Pro control caches only after successful writes
snd_bbfpro_ctl_put() and snd_bbfpro_vol_put()
cache the requested packed control state in
kcontrol->private_value before issuing the USB write.
Their get and resume paths use that cached value directly,
so a failed write can leave the driver reporting and later
replaying a setting the hardware never accepted.
Update the cached state only after a successful USB write.
Fixes: 3e8f3bd047 ("ALSA: usb-audio: RME Babyface Pro mixer patch")
Cc: stable@vger.kernel.org
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260429-alsa-usb-quirks-cache-rollback-v1-2-01b35c688b80@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
6380957fa2
commit
d8f802ccf1
|
|
@ -3027,12 +3027,14 @@ static int snd_bbfpro_ctl_put(struct snd_kcontrol *kcontrol,
|
|||
if (val == old_value)
|
||||
return 0;
|
||||
|
||||
err = snd_bbfpro_ctl_update(mixer, reg, idx, val);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
kcontrol->private_value = reg
|
||||
| ((idx & SND_BBFPRO_CTL_IDX_MASK) << SND_BBFPRO_CTL_IDX_SHIFT)
|
||||
| ((val & SND_BBFPRO_CTL_VAL_MASK) << SND_BBFPRO_CTL_VAL_SHIFT);
|
||||
|
||||
err = snd_bbfpro_ctl_update(mixer, reg, idx, val);
|
||||
return err < 0 ? err : 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int snd_bbfpro_ctl_resume(struct usb_mixer_elem_list *list)
|
||||
|
|
@ -3217,11 +3219,13 @@ static int snd_bbfpro_vol_put(struct snd_kcontrol *kcontrol,
|
|||
|
||||
new_val = uvalue & SND_BBFPRO_MIXER_VAL_MASK;
|
||||
|
||||
err = snd_bbfpro_vol_update(mixer, idx, new_val);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
kcontrol->private_value = idx
|
||||
| (new_val << SND_BBFPRO_MIXER_VAL_SHIFT);
|
||||
|
||||
err = snd_bbfpro_vol_update(mixer, idx, new_val);
|
||||
return err < 0 ? err : 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int snd_bbfpro_vol_resume(struct usb_mixer_elem_list *list)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user