Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp241036pxf; Wed, 10 Mar 2021 05:27:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnbFCQjRuAkLQrugxcpYifW9fp1U86HkUAhLZFg9M0B9E1W1Y/enAzovMXQhZK994uSofD X-Received: by 2002:a05:6402:b70:: with SMTP id cb16mr3281720edb.11.1615382849153; Wed, 10 Mar 2021 05:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615382849; cv=none; d=google.com; s=arc-20160816; b=JKmoYEf23//vcoi5QXGZY5w+NgfQBse/DeFGkF+6nEcdfyUAcA2TnBkbzFCrcsLs85 bhXjKYF0xaVV/1cJIf9c/rbLIm2KrjYEGhTXLmucXc8NuNQ2jaPXd0C5mX4xFKeD2k0g moeeW6Oo4alkcEuHDDD6ttodht1zv/9mYGd8IsQ3pm2aoBZ3xkqzPODdtZE6D008HLx7 3eZHnR7X56kSM8P9tT5qogPweyOFca1IQC8y3NPx63ribW1JFrzEWNlGr0Gfq4x++RS0 4k1Wj+yEhlBaZ7iJelwl/1bLCQ3DXguuZCChc+J2oGGZG1yXvyekVE0n4ZnMbl2cIn5b aY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3jsMWecSbL+uEifmFPfqDBdcP7nkqZ1QFZ+IFdBIkU0=; b=RalvwEbqfwacjFUjSTLRa1nkCfvGLkkL1jfhZcE7Cjc2P67fotMn7s5rj3YURHrNMJ Jhgwrn93yBHgsBviG6klU/hJCXq9v01OYYZUI6FtXuMk1CS3lqBftq4pqtWxPf7xIBBk eUdsGipkBRYcBnQoTN/mn2MiXDGVziFga+lRa3jNsnmHnlqkh4YbK0/W91cGb/etPHNg Z0AePdQ7ANEO0rA0Rlg13hzqPjtQpMj3FaWCEgKjTzc1oam8rWAEOCXVhiFz7wAZtRtX 9Sepz6tXRYy14Gp//KlRa4/rKBFPzS8Kxt+22TFEM2JE8t54aHnxNexRUrPMUn1x5MCH QV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U+eiN8Xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i15si11725666edl.581.2021.03.10.05.27.06; Wed, 10 Mar 2021 05:27:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U+eiN8Xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233752AbhCJN0I (ORCPT + 99 others); Wed, 10 Mar 2021 08:26:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:46068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232989AbhCJNYo (ORCPT ); Wed, 10 Mar 2021 08:24:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64FB664FE0; Wed, 10 Mar 2021 13:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382684; bh=wiR4hiq4vtsiddQOGhmpDJqkYXtor3dcc/mcVWvEhmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+eiN8XvgWA0li8SOalURrVA32yZIRndFMYw7NBTrAQ0pGm5+vbcbwoH3LpnwYiIe Mefg6g1QsNWwr8OEjbb7Qj1AX68dPvz4WbRNPQRmYj0Priw8BbdF/PUZHhJa+iWANC yLolSI4TTi8mbkFxnbqMefPdbPMTGiQ5zHCyZnD8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Lesniak , Takashi Iwai , Sasha Levin Subject: [PATCH 5.11 28/36] ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2 Date: Wed, 10 Mar 2021 14:23:41 +0100 Message-Id: <20210310132321.390661575@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.510840709@linuxfoundation.org> References: <20210310132320.510840709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Fabian Lesniak [ Upstream commit fee03efc69345344c8851596d74d93199b175bfe ] This commit adds mixer quirks for the Pioneer DJM-900NXS2 mixer. This device has 6 capture channels, 5 of them allow setting the signal source. This adds controls for these, similar to the DJM-250Mk2. However, playpack channels are not controllable via software like on the 250Mk2, as they can only be set manually on the mixing console. Read-only controls showing the currently selected playback channels are omitted. Signed-off-by: Fabian Lesniak Link: https://lore.kernel.org/r/20210205215116.258724-2-fabian@lesniak-it.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/mixer_quirks.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 788b75cb9447..448de77f43fd 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -2618,6 +2618,7 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) // Capture types #define SND_DJM_CAP_LINE 0x00 #define SND_DJM_CAP_CDLINE 0x01 +#define SND_DJM_CAP_DIGITAL 0x02 #define SND_DJM_CAP_PHONO 0x03 #define SND_DJM_CAP_PFADER 0x06 #define SND_DJM_CAP_XFADERA 0x07 @@ -2628,6 +2629,8 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) #define SND_DJM_CAP_NONE 0x0f #define SND_DJM_CAP_CH1PFADER 0x11 #define SND_DJM_CAP_CH2PFADER 0x12 +#define SND_DJM_CAP_CH3PFADER 0x13 +#define SND_DJM_CAP_CH4PFADER 0x14 // Playback types #define SND_DJM_PB_CH1 0x00 @@ -2648,6 +2651,7 @@ static int snd_bbfpro_controls_create(struct usb_mixer_interface *mixer) // device table index #define SND_DJM_250MK2_IDX 0x0 #define SND_DJM_750_IDX 0x1 +#define SND_DJM_900NXS2_IDX 0x2 #define SND_DJM_CTL(_name, suffix, _default_value, _windex) { \ @@ -2692,6 +2696,7 @@ static const char *snd_djm_get_label_cap(u16 wvalue) switch (wvalue & 0x00ff) { case SND_DJM_CAP_LINE: return "Control Tone LINE"; case SND_DJM_CAP_CDLINE: return "Control Tone CD/LINE"; + case SND_DJM_CAP_DIGITAL: return "Control Tone DIGITAL"; case SND_DJM_CAP_PHONO: return "Control Tone PHONO"; case SND_DJM_CAP_PFADER: return "Post Fader"; case SND_DJM_CAP_XFADERA: return "Cross Fader A"; @@ -2702,6 +2707,8 @@ static const char *snd_djm_get_label_cap(u16 wvalue) case SND_DJM_CAP_NONE: return "None"; case SND_DJM_CAP_CH1PFADER: return "Post Fader Ch1"; case SND_DJM_CAP_CH2PFADER: return "Post Fader Ch2"; + case SND_DJM_CAP_CH3PFADER: return "Post Fader Ch3"; + case SND_DJM_CAP_CH4PFADER: return "Post Fader Ch4"; default: return NULL; } }; @@ -2774,9 +2781,32 @@ static const struct snd_djm_ctl snd_djm_ctls_750[] = { }; +// DJM-900NXS2 +static const u16 snd_djm_opts_900nxs2_cap1[] = { + 0x0100, 0x0102, 0x0103, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a }; +static const u16 snd_djm_opts_900nxs2_cap2[] = { + 0x0200, 0x0202, 0x0203, 0x0206, 0x0207, 0x0208, 0x0209, 0x020a }; +static const u16 snd_djm_opts_900nxs2_cap3[] = { + 0x0300, 0x0302, 0x0303, 0x0306, 0x0307, 0x0308, 0x0309, 0x030a }; +static const u16 snd_djm_opts_900nxs2_cap4[] = { + 0x0400, 0x0402, 0x0403, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a }; +static const u16 snd_djm_opts_900nxs2_cap5[] = { + 0x0507, 0x0508, 0x0509, 0x050a, 0x0511, 0x0512, 0x0513, 0x0514 }; + +static const struct snd_djm_ctl snd_djm_ctls_900nxs2[] = { + SND_DJM_CTL("Capture Level", cap_level, 0, SND_DJM_WINDEX_CAPLVL), + SND_DJM_CTL("Ch1 Input", 900nxs2_cap1, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch2 Input", 900nxs2_cap2, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch3 Input", 900nxs2_cap3, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch4 Input", 900nxs2_cap4, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch5 Input", 900nxs2_cap5, 3, SND_DJM_WINDEX_CAP) +}; + + static const struct snd_djm_device snd_djm_devices[] = { SND_DJM_DEVICE(250mk2), - SND_DJM_DEVICE(750) + SND_DJM_DEVICE(750), + SND_DJM_DEVICE(900nxs2) }; @@ -3015,6 +3045,9 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) case USB_ID(0x08e4, 0x017f): /* Pioneer DJ DJM-750 */ err = snd_djm_controls_create(mixer, SND_DJM_750_IDX); break; + case USB_ID(0x2b73, 0x000a): /* Pioneer DJ DJM-900NXS2 */ + err = snd_djm_controls_create(mixer, SND_DJM_900NXS2_IDX); + break; } return err; -- 2.30.1