diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-04-20 08:20:36 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-04-20 08:21:28 +0200 |
commit | a43c1c41bc5145971d06edc42a6b1e8faa0e2bc3 (patch) | |
tree | dbfb9a1aa53bd66bb99e0dbee4e3cb4b4b9f90cf /sound/usb/mixer.c | |
parent | a8cf44f085ac12c0b5b8750ebb3b436c7f455419 (diff) | |
download | linux-a43c1c41bc5145971d06edc42a6b1e8faa0e2bc3.tar.gz linux-a43c1c41bc5145971d06edc42a6b1e8faa0e2bc3.tar.bz2 linux-a43c1c41bc5145971d06edc42a6b1e8faa0e2bc3.zip |
ALSA: usb-audio: Add static mapping table for ALC1220-VB-based mobos
TRX40 mobos from MSI and others with ALC1220-VB USB-audio device need
yet more quirks for the proper control names.
This patch provides the mapping table for those boards, correcting the
FU names for volume and mute controls as well as the terminal names
for jack controls. It also improves build_connector_control() not to
add the directional suffix blindly if the string is given from the
mapping table.
With this patch applied, the new UCM profiles will be effective.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873
Link: https://lore.kernel.org/r/20200420062036.28567-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r-- | sound/usb/mixer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index e7b9040a54e6..ecd5036a0b44 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1776,8 +1776,10 @@ static void build_connector_control(struct usb_mixer_interface *mixer, { struct snd_kcontrol *kctl; struct usb_mixer_elem_info *cval; + const struct usbmix_name_map *map; - if (check_ignored_ctl(find_map(imap, term->id, 0))) + map = find_map(imap, term->id, 0); + if (check_ignored_ctl(map)) return; cval = kzalloc(sizeof(*cval), GFP_KERNEL); @@ -1809,8 +1811,12 @@ static void build_connector_control(struct usb_mixer_interface *mixer, usb_mixer_elem_info_free(cval); return; } - get_connector_control_name(mixer, term, is_input, kctl->id.name, - sizeof(kctl->id.name)); + + if (check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name))) + strlcat(kctl->id.name, " Jack", sizeof(kctl->id.name)); + else + get_connector_control_name(mixer, term, is_input, kctl->id.name, + sizeof(kctl->id.name)); kctl->private_free = snd_usb_mixer_elem_free; snd_usb_mixer_add_control(&cval->head, kctl); } |