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: scarlett2: Fix Scarlett 4th Gen input gain range again

The 4th Gen input preamp gain range is 0dB to +69dB, although the
control values range from 0 to 70. Replace SCARLETT2_MAX_GAIN with
SCARLETT2_MAX_GAIN_VALUE and SCARLETT2_MAX_GAIN_DB, and update the TLV
again.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: a45cf0a08347 ("ALSA: scarlett2: Fix Scarlett 4th Gen input gain range")
Message-ID: <Ze7OMA8ntG7KteGa@m.b4.vu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Geoffrey D. Bennett and committed by
Takashi Iwai
6719cd5e a45cf0a0

+7 -4
+7 -4
sound/usb/mixer_scarlett2.c
··· 174 174 /* some gui mixers can't handle negative ctl values */ 175 175 #define SCARLETT2_VOLUME_BIAS 127 176 176 177 - /* maximum preamp input gain */ 178 - #define SCARLETT2_MAX_GAIN 70 177 + /* maximum preamp input gain and value 178 + * values are from 0 to 70, preamp gain is from 0 to 69 dB 179 + */ 180 + #define SCARLETT2_MAX_GAIN_VALUE 70 181 + #define SCARLETT2_MAX_GAIN_DB 69 179 182 180 183 /* mixer range from -80dB to +6dB in 0.5dB steps */ 181 184 #define SCARLETT2_MIXER_MIN_DB -80 ··· 3469 3466 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 3470 3467 uinfo->count = elem->channels; 3471 3468 uinfo->value.integer.min = 0; 3472 - uinfo->value.integer.max = SCARLETT2_MAX_GAIN; 3469 + uinfo->value.integer.max = SCARLETT2_MAX_GAIN_VALUE; 3473 3470 uinfo->value.integer.step = 1; 3474 3471 3475 3472 unlock: ··· 3546 3543 } 3547 3544 3548 3545 static const DECLARE_TLV_DB_MINMAX( 3549 - db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100 3546 + db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN_DB * 100 3550 3547 ); 3551 3548 3552 3549 static const struct snd_kcontrol_new scarlett2_input_gain_ctl = {