Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2395335lqp; Sun, 24 Mar 2024 17:36:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKpVd8WLfRCavGLV66ey4ii4jW3yrgXylb1gkx0WRWp116waaiLQPlIDVU/EKRLZzY/01RtqcDGfDktzkEbVxO/dIbecHMOmUHjOenxA== X-Google-Smtp-Source: AGHT+IGrehPE9SThlmqeFeFJCuWQIztwdlgsxgHweLnCWAaSMZKDqID4hNnK+Aowc7OcJCCZ5PdB X-Received: by 2002:a25:850d:0:b0:dcc:933f:ea83 with SMTP id w13-20020a25850d000000b00dcc933fea83mr2882772ybk.30.1711326994618; Sun, 24 Mar 2024 17:36:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711326994; cv=pass; d=google.com; s=arc-20160816; b=jfyIuMLS4/MlA1qKbWmsOwziDe8OOV1C2T88qdkEOL/mAMs6eKoYK8WRcJjElAPMrM ro4TBcwpw7aP/oHHlViv8n8drjeEcMTAYaq4fbI12SEy5T3eA0uC6Vkf37z/Hc6bSKZf 9seddO5zelm/8rHgS01wuaJHae/oeHN0Z3+5+5fIWFYcT+9sRnWOKN2PXD7VIzu3YmH8 PMwSUY4kFZd0BSNlrJuGZjAeIvhve/a0t+05pEW/+p5PfICHIyUWOEC4HtmA96un8DJw Z5tFA6cR98t4PHi4IZaIEAdQVKPGv52U8bjyq86Y4FWImKkdRtPhzOIhvgjOOUx5F4I+ zO4g== 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=4jvKQTjDHzOibjynfZsCzqub8IIO1BNpWJ2sE0QU2Vo=; fh=mJqZkc7mIR+khSfSRssgUh+iEZITyD6NdJVSy2QWmQU=; b=bc0Z7gqVDxHU9/g+2P0SReIVLLZec1CEq/Qi1ATGpcq3JxS/SgvWIfPDiOSXQIFBMm TRG+ib88GDeQriG/QX9cQ7yaeROf+voSmdbDBOFVChV2vWRfqAdBPO85Yo3ZCnM2CQw6 e0kyAx+qs8IBWMACnUfpS3zJNmzs18Idef9PMNGVVuEcPRX+iBl4mL6gqFenSVVnYj4v D+4yvIJm5eeYHsM74thHk4zlZJEcw1tV/6hI7lsq8wVUgT1gituoptCbHTiNK4xx8Zzc csTikGcyJxVnz3MlIeI7KxeReDqDeXKforo3nXsrmiJALK4s/uk1eUsASAEgkSjECrjO 1tMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4hvAIWd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id im9-20020a056214246900b006968e89f6bbsi1020426qvb.532.2024.03.24.17.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4hvAIWd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113437-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 56B181C23CE4 for ; Mon, 25 Mar 2024 00:36:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E8D41ABFB1; Sun, 24 Mar 2024 22:44:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O4hvAIWd" 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 551BE1AB8FA; Sun, 24 Mar 2024 22:43:59 +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=1711320239; cv=none; b=fnSlcXModtlcGGdDJV9zgnPAMSIqvaq5aS2LVZSZJ0tIbM8E4qO4m+2eHXr2b3CEfSjSVS3ncdQAjzkPkKYxhvOa/OTgJgnJWSQCdXqUk5LrN9D+Tj3cN34z9+aJb7Ub7l0Rz955u1iD+NwMRHzrlhU+S0r9/q+5Aia8zL9tdVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320239; c=relaxed/simple; bh=zU/rO6XE8qAJSa5ClpHRDF8bcja9FTesbxaqSZ165Ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X0ChPoN13YY5h4x7thhciW4xk1rEIwChSEJXwC50xMqwEBZ7WKvrCCfqEKiOFplaSSMdGXHzK72G+LDRb6v4zLLKC+Io1/N1GxYzXbzCIciV4AHotIE4Aa3Gpe/lU/OhsAK2JODzxLAK+xwIyEYNHorGUR6X1oxGMGIZKRtV5uM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O4hvAIWd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 962DDC43390; Sun, 24 Mar 2024 22:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320239; bh=zU/rO6XE8qAJSa5ClpHRDF8bcja9FTesbxaqSZ165Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O4hvAIWdAOe4lIhGNOcnKs6eW6oQXqhBMriM8qUgRZncBYgwopyl5fyd+oaBffSeO CqL+L+kqc6vuwKF0wHIuEoSRKn6NOKVTrgV/6qqPrSQe2/Of4wve+XUFiCoUpvnDaP KMfKYw2JWp4cWWnsLviKFBiy7/ICZevjbx9Yh4dQ0bxgFZsUwSRFCpFOrKrYLl+3IF lLcKE4MjXNKMTkAMpmA1wR9C8F6dy+NuljsNz1KgWOb0oSmgE3cT58lToX9QlbZeGP 2+y+Q9bJiG2GOXwDh0uvlZ0FVRadfvOqtvII++paggxvP/s4Ds3dxAJGLWE6pi4yvs r4z6tlEzDE8Gg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Geoffrey D. Bennett" , Takashi Iwai , Sasha Levin Subject: [PATCH 6.8 546/715] ALSA: scarlett2: Fix Scarlett 4th Gen input gain range Date: Sun, 24 Mar 2024 18:32:05 -0400 Message-ID: <20240324223455.1342824-547-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: "Geoffrey D. Bennett" [ Upstream commit a45cf0a0834779c741ac204c0320469e9aaef006 ] The input gain range TLV was declared as -70dB to 0dB, but the preamp gain range is actually 0dB to +70dB. Rename SCARLETT2_GAIN_BIAS to SCARLETT2_MAX_GAIN and update the TLV to fix. Signed-off-by: Geoffrey D. Bennett Fixes: 0a995e38dc44 ("ALSA: scarlett2: Add support for software-controllable input gain") Signed-off-by: Takashi Iwai Message-ID: <9168317b5ac5335943d3f14dbcd1cc2d9b2299d0.1710047969.git.g@b4.vu> Signed-off-by: Sasha Levin --- sound/usb/mixer_scarlett2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 3815ce1d216e6..ffb8bcebf9ad6 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -173,7 +173,9 @@ /* some gui mixers can't handle negative ctl values */ #define SCARLETT2_VOLUME_BIAS 127 -#define SCARLETT2_GAIN_BIAS 70 + +/* maximum preamp input gain */ +#define SCARLETT2_MAX_GAIN 70 /* mixer range from -80dB to +6dB in 0.5dB steps */ #define SCARLETT2_MIXER_MIN_DB -80 @@ -3464,7 +3466,7 @@ static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl, uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = elem->channels; uinfo->value.integer.min = 0; - uinfo->value.integer.max = SCARLETT2_GAIN_BIAS; + uinfo->value.integer.max = SCARLETT2_MAX_GAIN; uinfo->value.integer.step = 1; unlock: @@ -3541,7 +3543,7 @@ static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl, } static const DECLARE_TLV_DB_MINMAX( - db_scale_scarlett2_gain, -SCARLETT2_GAIN_BIAS * 100, 0 + db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100 ); static const struct snd_kcontrol_new scarlett2_input_gain_ctl = { -- 2.43.0