Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3447330lqp; Tue, 26 Mar 2024 09:19:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU03AKtkfAQSGNK6NF7vMtb1o4O6B0r0P7pQT8CwckyXXGh/c6TyoMWGy82fXlSVMAWNkegNVf1g47wrb23EXjRq8pXRAIg5ncdLXYtwg== X-Google-Smtp-Source: AGHT+IFhrplTUv8lXk1FC+9Lyri1fYfGIc3t5yVJkfJY7hf9FHdkYSTIYL072bQRlEVEe5Ey6nAF X-Received: by 2002:a05:6a00:3d02:b0:6e7:3d21:e629 with SMTP id lo2-20020a056a003d0200b006e73d21e629mr13485654pfb.32.1711469974345; Tue, 26 Mar 2024 09:19:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711469974; cv=pass; d=google.com; s=arc-20160816; b=BK2E9HYX3pekSctcveahOF2iup4OMbSH/gCsIBLsgk5UHMu9/HYe1ouPo/u19SgP9A lHeK+qiYzJtQDY0xH7JjIXk2k50Bv7KM4/wKO0s1E5vq7gmJYs9TBOWKfpW207J0Xces vY+hVMvrhCsdlQdnf+4BI5LowgmWglby3QVkjXYkVM8L9RTyGwfv6RApMOBJMkOSIODk sNvXs0iWYV9JamBTEHEZbxey4zUlf10xkjBNhRdguDKFs2O5LfrwZqA/I4WU8pwEtrt0 4rJX64VyyQjkwZ1v3MS9aZlRsYIqRBYPTIvJiSwYCBhpXy2L/c7QGjBcCZywN3Rsg6cd Y/9g== 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=fPSqJLKaovHkDFUUv/Y0cWZEFnx3wwoov4hFhNoFlnc=; fh=SeSIMHrnkavN+5kmCbDPO456qxSaOMS6PPqH9xoEKvo=; b=B3DLdVb4nTtxQ09x95ymdiUudGauB1nuHNpskawFbst0ya6Z1JVkuMYhr9xYc0ZDl2 eqZvYFopKTAj3rJ6LwowLY5GLLmOpQV6lvZ+J7ixRtjRtYDjAw0Ue7LIDahm++uKhhNs Lxp47dXAI68BG+ZtvRdq5St0FGPikqclJSEN9CXf+2obsoXGjvv2ipPvjX8/0Nha86sK VPVFUmZMwbvrulFrvd7NNdmsmKI28hWIVbecAZXR1yiqRk9alop/hojpeBCfyZBCcvvq CREX7Eu6nxu9lLvWHQvcxMRKX7OJoBAsVqYDQnRVaLb6y20lU4av2EzjeJsHRN6rYqlD tEaw==; 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-119440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x25-20020a056a00271900b006e5812351e7si7469116pfv.211.2024.03.26.09.19.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 09:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-119440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119440-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E659C306B7F for ; Tue, 26 Mar 2024 16:19:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B43E313CAAD; Tue, 26 Mar 2024 16:19:03 +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 8A82413C8E8; Tue, 26 Mar 2024 16:19:00 +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=1711469943; cv=none; b=QfqC7Js2k11rhOeTz+BjtFqTQ7FW2giG0eSzDsM5ZfgqoZmhKYrutd6zF7xOZ+EanLHD4vfEijO7EF8oX1qxCRptFL+YCNTa3NIFKTTtzIM/ZMJbXnx0ZSnobUSAVqV1wYmNK2T9bBALJdvekkDhRPfm4DBAWQTZgMzziktCaz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711469943; c=relaxed/simple; bh=9sS/jISAgyu61lXomWChV7j5u4qUbSmNT3mVkkIqqbg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Type; b=Q8OXC3XO4fMRylOy3odu0fu8GzGDtILrMXjj5L7Av714JkrBNjh8nQI0jbugucQcmpu51QbdynJvSSzjB+s402nb7fIKYhnUTP5DU6UXfXrq2Dn+EtD6l5zl21jvziJYmFdnIQIN+45GekyvuFsUNl3ksRH6ezG51hW380tDJl4= 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 0000000000077336.000000006602F571.0023D3A2; Tue, 26 Mar 2024 17:18:54 +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 v2 1/4] ALSA: hda/tas2781: remove digital gain kcontrol Date: Tue, 26 Mar 2024 17:18:45 +0100 Message-ID: <741fc21db994efd58f83e7aef38931204961e5b2.1711469583.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 --- sound/pci/hda/tas2781_hda_i2c.c | 37 +-------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) 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