Message ID | 20240119112420.7446-2-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp941341dyb; Fri, 19 Jan 2024 03:28:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7Qnn+LJxvrrLcWf41A5ckyZzVcWEX4jkRZGRhywWrOjmtgB0TaUixl0GnvEWAw3mPbqZE X-Received: by 2002:a17:90a:8b81:b0:28d:1581:29e6 with SMTP id z1-20020a17090a8b8100b0028d158129e6mr1072759pjn.13.1705663693253; Fri, 19 Jan 2024 03:28:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705663693; cv=pass; d=google.com; s=arc-20160816; b=y6BcnLVmSwfRFWjKJEdZhh7/g5WmjL/ER1VHm4D4vWuQWZlD1dXcHMEPEc0S4/R/tn MVrKTwQeyqkuMNDFL9tj9yhtBYpF25Fv7Xbj3GjvhFu7a3JjC7bx+c5QRgs+HIUcir6m pgIvRQEc4fl6uFesmKJSWzLkdEDSmpkT4M3ZzufQXz0iw36c/fXk39MNZ8f0aOiSdIDW zquW6BX/y0/cVtZ2ANiK8RkCM+JK4B84GZui1V4w9H+ltY0OhijMAO9sd9F2pa96vZAW 361VnwcXhxv2YntxldL2q0OQT5z/oci/kXfYcPkZ+1ASiFwBl+Mw1+id6plAi/8l/Gl6 bqjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+tD8xx6wnRasw0MDbT+SJ5aPXuP6QPNhTnjqoHY1NgA=; fh=KBIhiGdu1Ygtr3M+FTFcsBcOHAnQgw4Q3/a7frwkCBE=; b=QPlNUKpj00LIXgSfLLZxCf68yYo7E1obzJ8khxjPOAvzMg8ka/R2duHpZzNSdVNoRN 2eTCmeP+BH6QkfEkYwtoxAFU56mTp97MvLm2/hXJauodPPOypTA3DO/B3HSkKQSHCkek 0mY+tgJk30lutUjH7po0ZGCa4n6YcZ69Fj9Oaf5zh+ZAGHyhVJw4DLdclvs92U06UrUL FYfhA9TXnDTs24/9cUFClifBinwbVp5QdJay0xiWEtrBOwH4U5jJ3m62j4Ipp6hLvll6 n3mp4heJQHivliR0VLzYTK9pVHQBNR5m2LNKYntJlbnmuY9lUIIdMT/6p8GfHldcFqZG JAAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADbkUCsi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w8-20020a17090aaf8800b002900e75d10csi3250156pjq.92.2024.01.19.03.28.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:28:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADbkUCsi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31091-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0B96A285550 for <ouuuleilei@gmail.com>; Fri, 19 Jan 2024 11:28:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48F324E1A8; Fri, 19 Jan 2024 11:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ADbkUCsi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C56A4CB4E; Fri, 19 Jan 2024 11:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705663615; cv=none; b=TfJA7haXPBhD+etezCZd4WFqblZ1Rdbpj1AeigbNp4t9o0LSFs2/iaP2WmK1PedyVybe38ABdAkPYPP4sXVwMaJ+qH+80MQBIG871DKIgZ+FYTNHiRDj4QUX8EKnbl3ekS+hEcFisGfwnJFFEGUftl1l828STzyFWjd2///mDqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705663615; c=relaxed/simple; bh=7FAxMSZYO+6rp+32a2jHSpUGNLMh3wVgFHZWk8Irimk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kopNSqpsbRQVKqzQS8YrWf+VAjeCHvP29naXntVFNq22+qRbjvrgBZpjeiUC5wn3OfU+4T+0KxsMF2BZPXrMFsooqbEjyqPdfuCMEIpiFBRehxRAj6qvGgz0fgWFJLvgPPGS87cDCWFNphzNWIepUjJTgNte0d+azLzEpq954LI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ADbkUCsi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2516BC43390; Fri, 19 Jan 2024 11:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705663615; bh=7FAxMSZYO+6rp+32a2jHSpUGNLMh3wVgFHZWk8Irimk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADbkUCsi+gQ1V2GpTItDg1bSvrT+UDjAIdH8Caif9AX6/QklxHnXtFj9V2PwLYXrN +rr++YYQLjOVEmSPlmRA9YRO6tzcsJSjuQ0rJZCQNybWvQIApMUyAtE3YcWFLuXJ1i 46VSQHXGXxM9/0uy577nOpXGEIvfTGnpNHUpEmYboHUSo97p3DfJMyt09cXmfwMNMb qvCp3h2J48QXN3oUyaP2Xwej7iF8R+QDzI3MgXJ0oopYKRzmNbETZJXHAoaCnI7ZDX YRLoZkRih5NxYqvH0qec6PIJzE+/Ra6OnWNQLjJXT27wS15etRRROmLfOXSvZmQLNi yPoKG/ATmo8VQ== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from <johan+linaro@kernel.org>) id 1rQn1b-0001xJ-2g; Fri, 19 Jan 2024 12:27:03 +0100 From: Johan Hovold <johan+linaro@kernel.org> To: Mark Brown <broonie@kernel.org> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Banajit Goswami <bgoswami@quicinc.com>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, stable@vger.kernel.org Subject: [PATCH v4 1/4] ASoC: codecs: wsa883x: fix PA volume control Date: Fri, 19 Jan 2024 12:24:17 +0100 Message-ID: <20240119112420.7446-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240119112420.7446-1-johan+linaro@kernel.org> References: <20240119112420.7446-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788518012796947466 X-GMAIL-MSGID: 1788518012796947466 |
Series | ASoC: qcom: volume fixes and codec cleanups | |
Commit Message
Johan Hovold
Jan. 19, 2024, 11:24 a.m. UTC
The PA gain can be set in steps of 1.5 dB from -3 dB to 18 dB, that is,
in 15 levels.
Fix the dB values for the PA volume control as experiments using wsa8835
show that the first 16 levels all map to the same lowest gain while the
last three map to the highest gain.
These values specifically need to be correct for the sound server to
provide proper volume control.
Note that level 0 (-3 dB) does not mute the PA so the mute flag should
also not be set.
Fixes: cdb09e623143 ("ASoC: codecs: wsa883x: add control, dapm widgets and map")
Cc: stable@vger.kernel.org # 6.0
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
sound/soc/codecs/wsa883x.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index cb83c569e18d..a2e86ef7d18f 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -1098,7 +1098,11 @@ static int wsa_dev_mode_put(struct snd_kcontrol *kcontrol, return 1; } -static const DECLARE_TLV_DB_SCALE(pa_gain, -300, 150, -300); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(pa_gain, + 0, 14, TLV_DB_SCALE_ITEM(-300, 0, 0), + 15, 29, TLV_DB_SCALE_ITEM(-300, 150, 0), + 30, 31, TLV_DB_SCALE_ITEM(1800, 0, 0), +); static int wsa883x_get_swr_port(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)