aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Sanjuan <jorge.sanjuan@codethink.co.uk>2018-06-14 10:05:57 -0400
committerTakashi Iwai <tiwai@suse.de>2018-06-14 12:03:52 -0400
commit3528cd8f6a902c0c8597cc97f91371f0bc16ab7b (patch)
tree089ae81d89b6841b1e1a607cb0d0fdec5d7e8bd8
parent167e1fb1218d0526e65f2dd00b62ed08866dcfff (diff)
ALSA: usb-audio: Add insertion control for UAC3 BADD
The HEADSET ADAPTER profile for BADD devices is meant to support Insertion Control for the Input and Output Terminals of the headset. This patch defines the BADD inferred input and output terminals and builds the connector controls. Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/mixer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 34fef71e0330..03b8a2ac93c8 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2918,6 +2918,23 @@ static int snd_usb_mixer_controls_badd(struct usb_mixer_interface *mixer,
2918 UAC3_BADD_FU_ID7, map->map); 2918 UAC3_BADD_FU_ID7, map->map);
2919 } 2919 }
2920 2920
2921 /* Insertion Control */
2922 if (f->subclass == UAC3_FUNCTION_SUBCLASS_HEADSET_ADAPTER) {
2923 struct usb_audio_term iterm, oterm;
2924
2925 /* Input Term - Insertion control */
2926 memset(&iterm, 0, sizeof(iterm));
2927 iterm.id = UAC3_BADD_IT_ID4;
2928 iterm.type = UAC_BIDIR_TERMINAL_HEADSET;
2929 build_connector_control(mixer, &iterm, true);
2930
2931 /* Output Term - Insertion control */
2932 memset(&oterm, 0, sizeof(oterm));
2933 oterm.id = UAC3_BADD_OT_ID3;
2934 oterm.type = UAC_BIDIR_TERMINAL_HEADSET;
2935 build_connector_control(mixer, &oterm, false);
2936 }
2937
2921 return 0; 2938 return 0;
2922} 2939}
2923 2940