From patchwork Thu Nov 23 11:59:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Verwiebe X-Patchwork-Id: 10072705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02AD76056E for ; Thu, 23 Nov 2017 11:59:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD83629FC0 for ; Thu, 23 Nov 2017 11:59:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1B3629FC3; Thu, 23 Nov 2017 11:59:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A768829FC0 for ; Thu, 23 Nov 2017 11:59:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 324F926731F; Thu, 23 Nov 2017 12:59:39 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5FA6C267856; Thu, 23 Nov 2017 12:59:38 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id A4BD1266DF5 for ; Thu, 23 Nov 2017 12:59:36 +0100 (CET) Received: from [192.168.178.21] ([85.179.205.209]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MEKbo-1eONbj3stc-00FPKt for ; Thu, 23 Nov 2017 12:59:36 +0100 From: Jens Verwiebe To: alsa-devel@alsa-project.org References: Message-ID: Date: Thu, 23 Nov 2017 12:59:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K0:clobshod0TP+r0h9W8+SJy2kllzzUy3JpXXHuzNmlfcbmHza2FF gdq+HgqEoboNJElOchR2trjh4NbVKMvczQSlf6gF/2YRivdvb/emX0kA2tKMTMoI3Pyj9w+ UULCW63yHfPEfRlW3okKu9gpgP0RbmZYeKLjOJfNwnIAIk2YEUSQGK6HRbs7cZJDLEsoI6e hQ3TAreGrxKhGVqP9ZrSQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:jOIeJPF8Nos=:7bpkwObFP7SfihOHazLRhg ig/7TxfK+BbPUUB3i9EMmxpmX5sPchSNRgWOyvIGyFsviSJeKPX/XfA0EyuhqbB/qHGr/jg6m PDaVIrZkxHOD5mIwaxtjWvhTHX9+qItFNY75h0JqzvY5dQQE9ceQ8ZB/ZsA/EkWqjVb8GLPea SIwAifvQjuzP74Yo5RCvUYC4csznNse+QbA/Xp+Nf40C5SZxDLD0lyE+QwBwf1GANYyzyeI8O VMhWHIxZuY/IPBLicbyFhJrHMc/w+Ul3TAZC+ljRZ2G0sczUQyBDNj6EtvgSUZUMVzo5WehoM K6+g56rLU55moEEgkm62La9UX+jFkgfesP/fc/9I5xPFx1zc5pecJQCTRp/KK6ceCghocPd0h Ig2uSgjFys1p3zthZaVXtq+YPYrIPFtsSbI33FxmE9WXo4eZUHaU3VzYAzDtgeWpRkmeZuy96 1skVpwKDTKcg2AR3NmRHJksKXA9GvpDcF1zNUbd1r4HYXfmSwI7nj19aVXY1gKvrZM82X4uOb Ao7Z9uGCaCK0cL90ezrxGujxz/cYCBs4zhesqoU5+Ecq8R1ElhCV7ZMd7PwJQ4VfkJGT1qzS4 MYlwn6YRdSwe1Vm5CR9rJAN6N1jrw2VSA6QkdUA8BmSvJSo5kH817lXbSSqETzWfoGpgOjpsl SLgmmlFaV4Z4Ltj70JLvQvWbemuVWdK8jL0fYR/VRz/tJu3M3c/leiOu+4rk4iRe1xemwR8cz EBVhqlGj6+Tfj+SLf308XL0kwD3OoGXj3MFihjX6Bgs+9inONgs2uk3nJp4= Subject: Re: [alsa-devel] Focusrite Scarlett 6i6 gen1 - input handling fix X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Ups, cleanup own indentation/formatting mistake. Signed-off-by: Jens Verwiebe diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 7438e7c..2c86d595 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -152,6 +152,7 @@ enum { SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, }; enum { @@ -202,6 +203,15 @@ struct scarlett_device_info { } }; +static const struct scarlett_mixer_elem_enum_info opt_gain = { + .start = 0, + .len = 2, + .offsets = {}, + .names = (char const * const []){ + "Lo", "Hi" + } +}; + static const struct scarlett_mixer_elem_enum_info opt_impedance = { .start = 0, .len = 2, @@ -664,8 +674,8 @@ static int add_output_ctls(struct usb_mixer_interface *mixer, { .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL}, { .num = 2, .type = SCARLETT_SWITCH_IMPEDANCE, .name = NULL}, { .num = 2, .type = SCARLETT_SWITCH_PAD, .name = NULL}, - { .num = 3, .type = SCARLETT_SWITCH_PAD, .name = NULL}, - { .num = 4, .type = SCARLETT_SWITCH_PAD, .name = NULL}, + { .num = 3, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, + { .num = 4, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, }, .matrix_mux_init = { @@ -895,6 +905,15 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer, if (err < 0) return err; break; + case SCARLETT_SWITCH_GAIN: + sprintf(mx, "Input %d Gain Switch", ctl->num); + err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, + scarlett_ctl_enum_resume, 0x01, + 0x08, ctl->num, USB_MIXER_S16, 1, mx, + &opt_gain, &elem); + if (err < 0) + return err; + break; } }