diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-02-17 17:30:27 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-02-17 17:30:32 +0300 |
commit | 2948f4a4e583a4d283a4b57b7b1101761daee5cc (patch) | |
tree | 4aba87e38659a58eb27c1d3ef2aba2da6d68bbe6 /sound/usb/mixer.c | |
parent | 8dc5efe3d17cd572328ac4f1ebde629c83317f54 (diff) | |
parent | 60081b35c68ba6a466dee08de581be06999c930a (diff) | |
download | linux-2948f4a4e583a4d283a4b57b7b1101761daee5cc.tar.xz |
Merge branch 'topic/usb-uac2-effect-unit' into for-next
Merging the UAC2 effect unit parser improvement. As it's based on the
previous usb-audio driver fix, it was deviated from for-next branch.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r-- | sound/usb/mixer.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 96e20488804d..d5c7283f6e9f 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -897,6 +897,21 @@ static int parse_term_proc_unit(struct mixer_build *state, return 0; } +static int parse_term_effect_unit(struct mixer_build *state, + struct usb_audio_term *term, + void *p1, int id) +{ + struct uac2_effect_unit_descriptor *d = p1; + int err; + + err = __check_input_term(state, d->bSourceID, term); + if (err < 0) + return err; + term->type = UAC3_EFFECT_UNIT << 16; /* virtual type */ + term->id = id; + return 0; +} + static int parse_term_uac2_clock_source(struct mixer_build *state, struct usb_audio_term *term, void *p1, int id) @@ -981,8 +996,7 @@ static int __check_input_term(struct mixer_build *state, int id, UAC3_PROCESSING_UNIT); case PTYPE(UAC_VERSION_2, UAC2_EFFECT_UNIT): case PTYPE(UAC_VERSION_3, UAC3_EFFECT_UNIT): - return parse_term_proc_unit(state, term, p1, id, - UAC3_EFFECT_UNIT); + return parse_term_effect_unit(state, term, p1, id); case PTYPE(UAC_VERSION_1, UAC1_EXTENSION_UNIT): case PTYPE(UAC_VERSION_2, UAC2_EXTENSION_UNIT_V2): case PTYPE(UAC_VERSION_3, UAC3_EXTENSION_UNIT): |