From patchwork Thu Nov 23 15:04:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Verwiebe X-Patchwork-Id: 10072959 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 AF64860353 for ; Thu, 23 Nov 2017 15:05:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 988B22A0F2 for ; Thu, 23 Nov 2017 15:05:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D75E2A123; Thu, 23 Nov 2017 15:05:09 +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 BF70B2A0F2 for ; Thu, 23 Nov 2017 15:05:07 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 30B2B267879; Thu, 23 Nov 2017 16:05:04 +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 1761126787A; Thu, 23 Nov 2017 16:05:03 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by alsa0.perex.cz (Postfix) with ESMTP id 6C8B3266B02 for ; Thu, 23 Nov 2017 16:05:01 +0100 (CET) Received: from [192.168.178.21] ([85.179.205.209]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M7PiZ-1f2ikN37zD-00xJRg for ; Thu, 23 Nov 2017 16:05:00 +0100 To: alsa-devel@alsa-project.org From: Jens Verwiebe Message-ID: <5a1a63fe-10dd-3022-5932-dc933130125e@jensverwiebe.de> Date: Thu, 23 Nov 2017 16:04:59 +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:tbJfV+YZeJT6bAOrrkaKkMaJCTZPYXV0R3QuAoyB+yd8/IkmrHV whoN6EZhTJ20RWVhwvYJ6/F9A7IrLbeo72inI2AXozUpazVWtoeeHiRMoPDff4FaZKMK+od gNnWuqFlqNWyI+4QPq/mr4/BouLJTkfwDlWVcEZlmeXVxzZXBe4x//NZ1cJPCcZUvME9EGe V3smb7Zw817wYzfmaXf7w== X-UI-Out-Filterresults: notjunk:1; V01:K0:mYy7xPFHTPo=:FH+wNi9SozrPoE7dc6tYFG dsJWvnx0E62mTfxKfawX6AHYdKPiClRM5ZfG+DL+v4zFPE51xxPsmQM2GQ2dCKeBU01OQj3h5 fdBA+cJPXNKtVpUJt0mT/nhjBPuk2X52tTmiupG4a1lf0ftNHyTgO54YfM8SagV+zZLhwR4aT IJbf2CtSqzQMoY1qbcY2Cgtbi7gFoHTTUCF1Sj0TzqJA3iY+pb4e4akLf3JVWvB0tCwtJNx2G yca4HWhwclLOI9q8BTKXz/NiPkPNXvUFmrrlb5bbbHdfYY1TJwm9xgu32RsBFMwaxXesabfp+ KAg6G7nh0u5AYJJCwYnLe5WCDo5KSLdgcxZb5XLlq3pzIf1gI0DvD4RI3VwG6hzobiG5XbWQX i05XOqILUsxtjsmKbxSubjVOjWzNCccHcW/+gYGq5RQgIH0udBaXG7RCWgl4g9zuUMSlJA9T8 bLNKyqpnpa9PUPpRg+nbHjYsx2GbKf6mpQ9Yw6IdsyOVFt9bimnCPTTL+jZLtX5Krbj9ZvbDt 4Oup9Y8r3Et4kRK1nbs3DtR8ABxCZ0kNn9xzRrnpyHxYZDNqpjlIo9S6VSo1v6WQDGZhF/zut hETpzNRaxZPXkogD+l/3pwWCb16ugSygEJLbQlnkeTelR75DXvQ5ILO2p83+o2Vm+LkW+eeBo R6e2PpOWdR9T6pvmIUgF+6FGJpQM5bbSyMHmuTc4EamTTCUEwNvcHp6wX2wtVbR4Tozie/CLB 1o9FTA9vt3DuF+yKuuK0cY7pC97JpsZjBHQfVg== 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 Dammit, sorry, i better add the patch as textfile (?) Formatting looks good here, but ml shows spaces where i expect tabs. New try: The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage (Low/Hi). Adding this functionality Signed-off-by: Jens Verwiebe 1 file changed, 21 insertions(+), 2 deletions(-) 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; } }