hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/sound/usb/mixer_scarlett.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Scarlett Driver for ALSA
34 *
....@@ -12,17 +13,6 @@
1213 *
1314 * Code cleanup:
1415 * David Henningsson <david.henningsson at canonical.com>
15
- *
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation; either version 2 of the License, or
19
- * (at your option) any later version.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- * GNU General Public License for more details.
25
- *
2616 */
2717
2818 /*
....@@ -152,6 +142,7 @@
152142 SCARLETT_OUTPUTS,
153143 SCARLETT_SWITCH_IMPEDANCE,
154144 SCARLETT_SWITCH_PAD,
145
+ SCARLETT_SWITCH_GAIN,
155146 };
156147
157148 enum {
....@@ -199,6 +190,15 @@
199190 .offsets = {},
200191 .names = (char const * const []){
201192 "0dB", "-10dB"
193
+ }
194
+};
195
+
196
+static const struct scarlett_mixer_elem_enum_info opt_gain = {
197
+ .start = 0,
198
+ .len = 2,
199
+ .offsets = {},
200
+ .names = (char const * const []){
201
+ "Lo", "Hi"
202202 }
203203 };
204204
....@@ -662,8 +662,8 @@
662662 { .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL},
663663 { .num = 2, .type = SCARLETT_SWITCH_IMPEDANCE, .name = NULL},
664664 { .num = 2, .type = SCARLETT_SWITCH_PAD, .name = NULL},
665
- { .num = 3, .type = SCARLETT_SWITCH_PAD, .name = NULL},
666
- { .num = 4, .type = SCARLETT_SWITCH_PAD, .name = NULL},
665
+ { .num = 3, .type = SCARLETT_SWITCH_GAIN, .name = NULL},
666
+ { .num = 4, .type = SCARLETT_SWITCH_GAIN, .name = NULL},
667667 },
668668
669669 .matrix_mux_init = {
....@@ -893,6 +893,15 @@
893893 if (err < 0)
894894 return err;
895895 break;
896
+ case SCARLETT_SWITCH_GAIN:
897
+ sprintf(mx, "Input %d Gain Switch", ctl->num);
898
+ err = add_new_ctl(mixer, &usb_scarlett_ctl_enum,
899
+ scarlett_ctl_enum_resume, 0x01,
900
+ 0x08, ctl->num, USB_MIXER_S16, 1, mx,
901
+ &opt_gain, &elem);
902
+ if (err < 0)
903
+ return err;
904
+ break;
896905 }
897906 }
898907