6 Aug
2024
6 Aug
'24
12:37 p.m.
On Fri, 02 Aug 2024 16:24:39 +0200, Stefan Stistrup wrote:
Add missing input gain and master output mixer controls for RME Babyface Pro
This patch implements:
- Input gain controls for 2 mic and 2 line inputs
- Master output volume controls for all 12 output channels
These additions allow for more complete control of the Babyface Pro under Linux.
Signed-off-by: Stefan Stistrup sstistrup@gmail.com +static int snd_bbfpro_gain_update(struct usb_mixer_interface *mixer,
u8 channel, u8 gain)
+{
- int err;
- struct snd_usb_audio *chip = mixer->chip;
An unneeded blank line. There are a few other coding style issues, as it seems. Please correct the errors reported by checkpatch.pl.
+static int snd_bbfpro_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
+{
- int pv, channel, old_value, value, err;
- struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
- struct usb_mixer_interface *mixer = list->mixer;
- pv = kcontrol->private_value;
- channel = (pv >> SND_BBFPRO_GAIN_CHANNEL_SHIFT) &
SND_BBFPRO_GAIN_CHANNEL_MASK;
- old_value = pv & SND_BBFPRO_GAIN_VAL_MASK;
- value = ucontrol->value.integer.value[0];
- if (channel < 2) {
if (value > SND_BBFPRO_GAIN_VAL_MIC_MAX)
return -EINVAL;
Also check an invalid negative value, too.
thanks,
Takashi