Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2955193lqp; Mon, 25 Mar 2024 14:26:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhrvrxAhlrfv9RRmspKJHHFMwD+jh20tjQvN9rI0dKL9rDpwyRHZBuKas2F8NpL1yjRMhTEm77SowFlBOhf0qAkEncF1Mx/fuiOukEFQ== X-Google-Smtp-Source: AGHT+IGn36JvqWjmgFgzaHTxhAOyg2wbOB7cUTJ4Wd36kdv8hD2TaGnIqf9TJ3Ox3MiotfWBfBY8 X-Received: by 2002:ac8:5cd2:0:b0:431:3b78:39ac with SMTP id s18-20020ac85cd2000000b004313b7839acmr9675714qta.19.1711401979647; Mon, 25 Mar 2024 14:26:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711401979; cv=pass; d=google.com; s=arc-20160816; b=xtRl9Zbrl5iBAEn9U1wFw82dyY8IXCeBlfErlR61Mi8+Ym4Hu8UXIEG++9F8CCWBqg 9a2Z9Q2nv4FAU5fu2+jrZqTVFW0sLlBEY22VKU8ZBkoIFNTsn2rRoXg1nPlfLJ9ijX1A 9jyrYNibx1NS710G9XITGqWS0r5apFz/7JRqPhBoP85txM3l2XASB0j+MeJnWPiJbt5G Xmf7QrTv5SFLK6qyFD8ZuZW5cKZ8nqTv4tB5RHXCLLzu3LxVT45tXQOlyiVEwiIIzgUd r1XkeZt4GxROn1RkeD1+k2BwP8sGMuOCo+zYs/N5of78Efud9aZ45vRftzyveNOkVnA7 2YUA== 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; bh=E0Q9uLsOzZAqLWZio6XfnEXuKQVtkeFN0ZpbVhln2Co=; fh=SeSIMHrnkavN+5kmCbDPO456qxSaOMS6PPqH9xoEKvo=; b=AzKX2n1E73sXVElTo/dniQBVXBB+Hb4PBs/Vm1hiCJoyJILIT5dDSr5umuhO64ABKI Md4A6GFlEsWKmUw7Dq6Mb5i4OgUnRPqEGSeqpUsNDiRfW0HL7ZirPEDUSCqo5wJr5PBk 4eGmIv2l1XQuiO5PiIstr6DW02lhr7gkpAwF5tgfdFg1bIwhG5Ssfu4QPqMqtIko23Ps MetXM8YUinc4cv0Be+Be2ODS82gPeA+dms80USma0llTU27erm+Z4VUNxmaH9ItavmAw Llbx3q3EaVWZ4847XsBgNvXkXGxd5w8mNQuIcJ4Mx9RmTyRfJfItOYxeFGWcERHxRg03 Knkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-118034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l19-20020a05622a175300b0042ef1df37e8si6271154qtk.20.2024.03.25.14.26.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:26:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118034-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; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-118034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu 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 617C01C3E39B for ; Mon, 25 Mar 2024 21:26:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A0FC6F085; Mon, 25 Mar 2024 21:26:02 +0000 (UTC) Received: from irl.hu (irl.hu [95.85.9.111]) (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 AAD896D1CC; Mon, 25 Mar 2024 21:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.85.9.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711401961; cv=none; b=Dr0GCZPfRg22dAniXMaz/TxQtUiZHoOnjo7tdH6Gd0wIj1c+uxr4wCvMPKG2lKBX4Z3h/GUlCr+4NA5y5Oa+hwVvLGyvfiCABINlATAMUnh0+EyZ4LMJlAc7xHjXjHk16/j8un1SwBXEYUr/pHZWSYUHUfEVwSzSEdqS+TCsL3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711401961; c=relaxed/simple; bh=AJHi0yEoUy7xt9EwDVeVmYbzGiFayqXL/wNoZ+TUfYg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Type; b=FH3VM2IPH1a+N2FvtPTbwIpHOFSBx3wH7E4rUB7idf+7MPbknjHqC5XLbYw+kU/ZTMzrYFNEARQagx4elUxzw/PH0zS53ItR6odIx5l2TTuj5CcTO/3CaGNqzU9OYZ0KsTo9zid0sOO2Lc1ogTLvvFFwwgdIzyIbM4TMvGZ4wv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu; spf=pass smtp.mailfrom=irl.hu; arc=none smtp.client-ip=95.85.9.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=irl.hu Received: from fedori.lan (51b68717.dsl.pool.telekom.hu [::ffff:81.182.135.23]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000770AE.000000006601EBE5.0023A884; Mon, 25 Mar 2024 22:25:49 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Gergo Koteles , stable@vger.kernel.org Subject: [PATCH 1/3] ALSA: hda/tas2781: remove digital gain kcontrol Date: Mon, 25 Mar 2024 22:25:33 +0100 Message-ID: <313e00499eb2caadd23a92284fdec418b650b7f4.1711401621.git.soyer@irl.hu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 The "Speaker Digital Gain" kcontrol controls the TAS2781_DVC_LVL (0x1A) register. Unfortunately the tas2563 does not have DVC_LVL, but has INT_MASK0 in 0x1A, which has been misused so far. Since commit c1947ce61ff4 ("ALSA: hda/realtek: tas2781: enable subwoofer volume control") the volume of the tas2781 amplifiers can be controlled by the master volume, so this digital gain kcontrol is not needed. Remove it. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles --- include/sound/tas2781-tlv.h | 1 - sound/pci/hda/tas2781_hda_i2c.c | 37 +-------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/include/sound/tas2781-tlv.h b/include/sound/tas2781-tlv.h index 4038dd421150..a29bcfb5bb2b 100644 --- a/include/sound/tas2781-tlv.h +++ b/include/sound/tas2781-tlv.h @@ -15,7 +15,6 @@ #ifndef __TAS2781_TLV_H__ #define __TAS2781_TLV_H__ -static const DECLARE_TLV_DB_SCALE(dvc_tlv, -10000, 100, 0); static const DECLARE_TLV_DB_SCALE(amp_vol_tlv, 1100, 50, 0); #endif diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 4475cea8e9f7..5acb475c10a7 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -89,7 +89,7 @@ struct tas2781_hda { struct snd_kcontrol *dsp_prog_ctl; struct snd_kcontrol *dsp_conf_ctl; struct snd_kcontrol *prof_ctl; - struct snd_kcontrol *snd_ctls[3]; + struct snd_kcontrol *snd_ctls[2]; }; static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data) @@ -294,27 +294,6 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol, return ret; } -/* - * tas2781_digital_getvol - get the volum control - * @kcontrol: control pointer - * @ucontrol: User data - * Customer Kcontrol for tas2781 is primarily for regmap booking, paging - * depends on internal regmap mechanism. - * tas2781 contains book and page two-level register map, especially - * book switching will set the register BXXP00R7F, after switching to the - * correct book, then leverage the mechanism for paging to access the - * register. - */ -static int tas2781_digital_getvol(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol); - struct soc_mixer_control *mc = - (struct soc_mixer_control *)kcontrol->private_value; - - return tasdevice_digital_getvol(tas_priv, ucontrol, mc); -} - static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -325,17 +304,6 @@ static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol, return tasdevice_amp_getvol(tas_priv, ucontrol, mc); } -static int tas2781_digital_putvol(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol); - struct soc_mixer_control *mc = - (struct soc_mixer_control *)kcontrol->private_value; - - /* The check of the given value is in tasdevice_digital_putvol. */ - return tasdevice_digital_putvol(tas_priv, ucontrol, mc); -} - static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -381,9 +349,6 @@ static const struct snd_kcontrol_new tas2781_snd_controls[] = { ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL, 1, 0, 20, 0, tas2781_amp_getvol, tas2781_amp_putvol, amp_vol_tlv), - ACARD_SINGLE_RANGE_EXT_TLV("Speaker Digital Gain", TAS2781_DVC_LVL, - 0, 0, 200, 1, tas2781_digital_getvol, - tas2781_digital_putvol, dvc_tlv), ACARD_SINGLE_BOOL_EXT("Speaker Force Firmware Load", 0, tas2781_force_fwload_get, tas2781_force_fwload_put), }; -- 2.44.0