From patchwork Wed Jul 29 07:13:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao-Wen Mao X-Patchwork-Id: 6890051 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B97DC9F39D for ; Wed, 29 Jul 2015 07:14:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2DF6206AC for ; Wed, 29 Jul 2015 07:14:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CF7872073C for ; Wed, 29 Jul 2015 07:14:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C32202658B7; Wed, 29 Jul 2015 09:14:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 51D86260574; Wed, 29 Jul 2015 09:14:11 +0200 (CEST) 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 DDE56265888; Wed, 29 Jul 2015 09:14:09 +0200 (CEST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by alsa0.perex.cz (Postfix) with ESMTP id D846D260565 for ; Wed, 29 Jul 2015 09:14:02 +0200 (CEST) Received: by pdbnt7 with SMTP id nt7so1012010pdb.0 for ; Wed, 29 Jul 2015 00:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=aVU+e+7YJVjPxismekY8zKU9hz+CHvq1anGSwzpNtlM=; b=TVYRsKJGIDKn5Or5ZwGadFmbJMPRA72/VFPPmzfHpSAUt/2rpHJHrA25PmDsqoXKj1 +MMcjjRqCJ7RaRogh/wjDYQDT07T2CwuKiAW0Y3m4fSvxAUUgj66EE1/MY14XL5czUfr 6GCJrB+YHQz6kfFG0mG990zG8GdTv9tj7jU2ksTqPfE5/hURvO4LwkMWLGoWXR867X3C mllYtJ4vtX0VAKpP5UVHT4UQ0e78mEtT6BK6u0JRAjbj7hfbtisMatgrNpWTId7i4iRs 6EKj/qVDZg8TLbgO87mEiwYK/yxecGUYfCtWK2f3Zxhq4uo40wRS0mER4JBTrrDmRq+M cotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aVU+e+7YJVjPxismekY8zKU9hz+CHvq1anGSwzpNtlM=; b=LhNALH3O56jQgUvXZrinmjfYy4Z/Mwg/1byypDR8qOOOIT1TstY6cKtvy/RAT0bzve c5bp2bZG81kETBJ9LRH+PGeq9VcRgCJo4LO1LXdHANtPxHWyjBgUExozzEIIiCWImve2 oBhfwRjGNRZycWmondgyW/mHoV3/PtNrgbLi6HIt2Jl7xmX5L2QVdQALR3yeH0IYVZDj Ebx/0N6W/LrwxICwuyRbYy+c++W7mOSWXuKTOD9OFW2XvAygfre61PljTBf9HzJKvP+4 KSMu/RQG48GzAkESrZ1Rn1+WvF8DS8Kkr3NNaRDuyfSGopPJfHt4RKhubhpnz/5SYp1t txzQ== X-Gm-Message-State: ALoCoQmQ19+rwOg0KdPzGjNJ1PaCNFfmk8bpVHv4Xya2IEKDDnxD3MSkTurzbcqL7x7QyH2lxaCy X-Received: by 10.70.30.161 with SMTP id t1mr91408705pdh.138.1438154041320; Wed, 29 Jul 2015 00:14:01 -0700 (PDT) Received: from yaowen.tpe.corp.google.com ([172.30.210.202]) by smtp.gmail.com with ESMTPSA id br14sm34236800pdb.47.2015.07.29.00.13.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jul 2015 00:14:00 -0700 (PDT) From: Yao-Wen Mao To: tiwai@suse.com, perex@perex.cz, alsa-devel@alsa-project.org Date: Wed, 29 Jul 2015 15:13:54 +0800 Message-Id: <1438154034-112595-1-git-send-email-yaowen@google.com> X-Mailer: git-send-email 2.5.0.rc2.392.g76e840b Cc: dgreid@chromium.org, Yao-Wen Mao Subject: [alsa-devel] [PATCH] sound/usb: add dB range mapping for some devices. 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2. Signed-off-by: Yao-Wen Mao --- sound/usb/mixer_maps.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c index e5000da..f0c9e49 100644 --- a/sound/usb/mixer_maps.c +++ b/sound/usb/mixer_maps.c @@ -339,6 +339,19 @@ static struct usbmix_name_map gamecom780_map[] = { static const struct usbmix_name_map scms_usb3318_map[] = { { 10, NULL }, { 0 } + +/* Bose companion 5, the dB conversion factor is 16 instead of 256 */ +static struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; +static struct usbmix_name_map bose_companion5_map[] = { + { 3, NULL, .dB = &bose_companion5_dB }, + { 0 } /* terminator */ +}; + +/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */ +static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000}; +static struct usbmix_name_map dragonfly_1_2_map[] = { + { 7, NULL, .dB = &dragonfly_1_2_dB }, + { 0 } /* terminator */ }; /* @@ -451,6 +464,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { .id = USB_ID(0x25c4, 0x0003), .map = scms_usb3318_map, }, + { + /* Bose Companion 5 */ + .id = USB_ID(0x05a7, 0x1020), + .map = bose_companion5_map, + }, + { + /* Dragonfly DAC 1.2 */ + .id = USB_ID(0x21b4, 0x0081), + .map = dragonfly_1_2_map, + }, { 0 } /* terminator */ };