From patchwork Thu Oct 9 22:11:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 5062921 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2F7729F30B for ; Thu, 9 Oct 2014 22:12:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AC2320270 for ; Thu, 9 Oct 2014 22:12:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 19E21201FA for ; Thu, 9 Oct 2014 22:12:20 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2712626044D; Fri, 10 Oct 2014 00:12:19 +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=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B4BE826049B; Fri, 10 Oct 2014 00:11:58 +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 D881F26053B; Fri, 10 Oct 2014 00:11:57 +0200 (CEST) Received: from mail-pd0-f202.google.com (mail-pd0-f202.google.com [209.85.192.202]) by alsa0.perex.cz (Postfix) with ESMTP id 8E72C26044D for ; Fri, 10 Oct 2014 00:11:31 +0200 (CEST) Received: by mail-pd0-f202.google.com with SMTP id fp1so149260pdb.5 for ; Thu, 09 Oct 2014 15:11:29 -0700 (PDT) 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=Ii3FmvL6x5v6N1MzX6f2pdQFx5McEI5g9ez0wPtBtZA=; b=HMIRNu4mWSIK/swIY/xp5atBmSosqNHw5M2jjuZ19fEcOZC3O2gdYVbECh3JqoIVZA pRqMQBXa+oJLVxrPgSug6BhMicLVCm/Bg3K/YxAHtXSO6XYS3bxB9+IEqU/wLUrzBW+o XY7iVWUqGRSQX/+++Js88mpcX0qFSUebgl/j3XpXS8HyBjjXbOoGQGA9nNQCMtBQ2E2N h/HtDGZgKRsY9Aj8V7ew+9yShCR+SSPnEQeGiXnMuPB/JK1f25y89i7StMLhB5cZqlzu T0N/YDjlxXV1gykMuwzAugCMm/NZXrrQH4qddg5+w7G7fPvCqLVuPVY0uMpGCXK2PFvd Ykrw== X-Gm-Message-State: ALoCoQk1YJx1aYbNS+/Jbuw4V0ozHQxGstYRVg+1N0Zfni9NemIo/WdQEiKQ4439bmVt0wPunkzv4/BubAT9kO9huAFH9kZE2wcZ7eiLABuvYDdymg4fNb6akBmMxNRPSThU7ewOx+pZXvOWEcGGSjHyddTzhGPAGDUCQv3Aoc1d/uYP0t4wqiU= X-Received: by 10.66.188.104 with SMTP id fz8mr745083pac.6.1412892689725; Thu, 09 Oct 2014 15:11:29 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id e24si233308yhe.3.2014.10.09.15.11.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 15:11:29 -0700 (PDT) Received: from hojo20.mtv.corp.google.com ([172.22.65.103]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id d2JvtMZu.1; Thu, 09 Oct 2014 15:11:29 -0700 Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id ADE6A1C1A1D; Thu, 9 Oct 2014 15:11:28 -0700 (PDT) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Thu, 9 Oct 2014 15:11:27 -0700 Message-Id: <1412892687-1264-1-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 2.1.2.330.g565301e Cc: oder_chiou@realtek.com, anatol.pomozov@gmail.com, tiwai@suse.de, benzh@chromium.org, broonie@kernel.org, Dylan Reid Subject: [alsa-devel] [PATCH v2] ASoC: rt5677: make volume TLV closer to reality 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 The volume blocks have an step of 0.375dB, but TLV uses 0.01dB for units. Switch to use TLV_DB_MINMAX as this allows the minimum to be off by only 0.005dB. This is an improvement from the ~500dB is was misreported by before. Signed-off-by: Dylan Reid --- sound/soc/codecs/rt5677.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 16aa4d9..a4c71f9 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -538,9 +538,9 @@ static bool rt5677_readable_register(struct device *dev, unsigned int reg) } static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); -static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); +static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0); static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); -static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); +static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 0); static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); static const DECLARE_TLV_DB_SCALE(st_vol_tlv, -4650, 150, 0);