From patchwork Thu Nov 23 10:28:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jens Verwiebe X-Patchwork-Id: 10072611 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 D573A6056E for ; Thu, 23 Nov 2017 10:28:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7BB629F6A for ; Thu, 23 Nov 2017 10:28:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC9FB29F6E; Thu, 23 Nov 2017 10:28:27 +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 B590629F6A for ; Thu, 23 Nov 2017 10:28:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D50F3266B67; Thu, 23 Nov 2017 11:28:24 +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 A1116266D45; Thu, 23 Nov 2017 11:28:23 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id EE370266B38 for ; Thu, 23 Nov 2017 11:28:21 +0100 (CET) Received: from [192.168.178.21] ([85.179.205.209]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MJkO4-1eGioL1IFY-001DPf for ; Thu, 23 Nov 2017 11:28:21 +0100 To: alsa-devel@alsa-project.org From: Jens Verwiebe Message-ID: Date: Thu, 23 Nov 2017 11:28:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:QcPcxkY2NnefhQtEnr/mHPTNVd3jqh4BS68yG1Iac8pFP9uRYD1 9dDRbVhSXdCqsFUO6hEKGJb5EAeJ0rCE6rrl7SZ2YcxMYFPF4sd7myGLYyCcaZWyLV2cRmg IaaNuMXr1qjB+ExL4l5JbEYZsd+PoPSwdY5T46rmkh7BpgpK1Xx9XjCxRykzHCNGZnTDBTP UBW0qE3FyWF65uXaDqN4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:KGs+6Jo8fvE=:YNILIt0oc8jZEZCEy+UtTN nEDOtAgriHi1nK/rCRcMsekXEaS/0eo+UuH6qPDWgRPGM2m6buhrkKa1SG8bpULZQgNqVnYt8 pP4WZAZmJvtBZmnR1C06i74OqbcZ4O2z/8Hv6GuNjTr4nlDcquIg2qlevhEFZ8j8kLjjDM9vB sQYbRQZTQs7aLnbAyhVa95erIvVWFBiZ4YEJ/uXoBhOv8PhTTdGYDTjrQIY19n1xRBJPVm9qO 1eGM4mGCDNvuFPfXsl3xbLk9RR6FuEDK7tMugjvjJzZh9Ar1WA1/DbE376M1H/h4fsTjEAkP1 Idh0cvgmbDNQJM1GNWTYdkqLYOVEqeHIkgFrt+ILvqIc3gTcYGPA/NhQrIw/9XH0a/k/lTK4j 6bZrVfILY4ALqbKB2jnxI4moGE8n6DuXz0Qb+tzkkAjg1Cw8CJqDBTH5Jtl+knf9VKCdI4Uh+ X8Ne25wWQsKGXFL2sB64yIpzxmFUj7TAzpyZ2Hz60XE5srKz3DQOoaYWy3XOKZUgpukMhKalh k+2Vbuj/jyFTeCLRRM1m+8kyPRGw1fVWExO3LKd2jJeZmpIelpEnAtWLhFBNnRbyuBCrnQx1C 31WIuvn2DywlE1jtbCztQs1WWezuk6f5eez66omnse9DlUysifZ1BD534kbGvsfGUzAlMzlFJ goyDx4tBSNqVBoE0m9m1ZdTFWbC14Bx567GGfXLjwLaGq/00hguc1u5PyuMYXoMWPpByqV/Iq Y73L2qhltYsB5nSCOWZ8rQch/dNrWFHw2sIwaaOGFJAue4Z9PV2ClJ2ZKMU= Subject: [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 The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage. This patch introduces this functionality as to be seen in the mac or windows scarlett control. The correct address could already be found in the dump info, but was never used. Cheers ... Jens Signed-off-by: Jens Verwiebe      .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;          }      } diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 7438e7c..f3bdac3 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},      },