ALSA: usb-audio: Add minimal-mute notion in dB mapping table
authorTakashi Iwai <tiwai@suse.de>
Tue, 16 Nov 2021 06:54:14 +0000 (07:54 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 16 Nov 2021 06:55:15 +0000 (07:55 +0100)
Some devices do mute the volume at the minimal volume, and for such
devices, we need to set SNDRV_CTL_TLVT_DB_MINMAX_MUTE to the TLV
information.  It corresponds to setting usb_mixer_elem_info.min_mute
flag in the USB-audio driver.

This patch adds a new field min_mute in usbmix_dB_map so that the
mixer map entry can pass the flag.

Link: https://lore.kernel.org/r/20211116065415.11159-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c
sound/usb/mixer_maps.c

index 6e7bac8203baab3ade9fab9c0aad05f67293334d..5b9fd07ce2a26820712b9c96a63fac5142e0275b 100644 (file)
@@ -145,6 +145,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
        if (p && p->dB) {
                cval->dBmin = p->dB->min;
                cval->dBmax = p->dB->max;
+               cval->min_mute = p->dB->min_mute;
                cval->initialized = 1;
        }
 }
index 92c06b1bb9796e23fbc78063b758042d5bc59d80..9d71c569b14846346bd2d7e696fdf2a41bcd3515 100644 (file)
@@ -8,6 +8,7 @@
 struct usbmix_dB_map {
        int min;
        int max;
+       bool min_mute;
 };
 
 struct usbmix_name_map {