From patchwork Thu Dec 14 23:33:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 178972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8921977dys; Thu, 14 Dec 2023 15:34:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG02ZMZcFjVC6JWREao52DqGdaOHysLIg1REzUrXVy6+CJZrgLm2FVyuQXWXjvd8QgCtaSS X-Received: by 2002:a05:6a20:320f:b0:18f:97c:6177 with SMTP id hl15-20020a056a20320f00b0018f097c6177mr10811227pzc.116.1702596844165; Thu, 14 Dec 2023 15:34:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702596844; cv=none; d=google.com; s=arc-20160816; b=pZCWmmOigZOtL6dldoUPKNRK0TwsMWSVIK63u7VDqdYPMOHSFCRcJxCUSVvkJHbiWT ajR593e0zvP/kLT8zfyOOsRR5tA/TAQUijqQZCNt+wOHCaxCiSCfKenxO91VB0SZf+c+ vO5mLHfedaL2Lq1GZ1j9gwcuN9eK0y68tAWguBzoHhx2a1B9BC4B4P9GFTiStfF7I7DD 3f9LW6/vgNGHWbyH6X0CJcFuxz2ffq4H2FrJ6bxz82WEX7WrmYA45kk25bdRtjie6CQ6 p9Ia+dsUFeL7vmkR+cQkQPoL+sfFkzG3iNY0kWvdFe2ML0HjSrGFuJthmIavMUF+bs0u y7+Q== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from; bh=RGnb44/WbvYjq/MRq0t1jjTNQFXnbR+Hk+9ru+OtEng=; fh=AtUyipZqf9Wt3VmKECtwTscIVbxtj0bqEzvKFfEmcRc=; b=M8Yt358pNZZyxoH2g6mlhMa/zP546NvF/+80+91m4X57K2Fs7AgsIaoRb9CNNSV1/w c3cJC+kDYLODPQS7ovX8VWIYT3aNoV6uu8qX/ub/EHbwqFHKUfvCdn3eCv3VO6zGvhVv S+4scIc+/3+W8s1l44d7q6XPg24J5XtLHiASuqZuGeCMgX1DXMpezQ4Qc2hOZzkAmZBJ KdFRwQudsCqbjGUV9yE+6B+8OXK7CIsRc7aQl+X0TjpZoMWXWDi6V6MhWNH93eMDfxHA M/pi2iW2qvQ84SMiYcXEDtc3r8MShlFBZ4ta3HZg2aOa66mZQKJxhm+pvYXoWJGYsqXg TNXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-250-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-250-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t7-20020a6564c7000000b005be1f24c951si11578141pgv.838.2023.12.14.15.34.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 15:34:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-250-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-250-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-250-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 846FAB217F3 for ; Thu, 14 Dec 2023 23:34:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C3102DB67; Thu, 14 Dec 2023 23:33:44 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 82DD96C6C8; Thu, 14 Dec 2023 23:33:40 +0000 (UTC) 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 (51b687c3.dsl.pool.telekom.hu [::ffff:81.182.135.195]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000710F7.00000000657B90D2.0012CE04; Fri, 15 Dec 2023 00:33:38 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles , stable@vger.kernel.org Subject: [PATCH] ALSA: hda/tas2781: select program 0, conf 0 by default Date: Fri, 15 Dec 2023 00:33:27 +0100 Message-ID: <038add0bdca1f979cc7abcce8f24cbcd3544084b.1702596646.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785302188369358012 X-GMAIL-MSGID: 1785302188369358012 Currently, cur_prog/cur_conf remains at the default value (-1), while program 0 has been loaded into the amplifiers. In the playback hook, tasdevice_tuning_switch tries to restore the cur_prog/cur_conf. In the runtime_resume/system_resume, tasdevice_prmg_load tries to load the cur_prog as well. Set cur_prog and cur_conf to 0 if available in the firmware. 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 | 4 ++++ 1 file changed, 4 insertions(+) base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index fb802802939e..e974510367e3 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -543,6 +543,10 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context) tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; tasdevice_prmg_load(tas_priv, 0); + if (tas_priv->fmw->nr_programs > 0) + tas_priv->cur_prog = 0; + if (tas_priv->fmw->nr_configurations > 0) + tas_priv->cur_conf = 0; /* If calibrated data occurs error, dsp will still works with default * calibrated data inside algo.