Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6332850rdb; Thu, 14 Dec 2023 15:33:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVr5qnOBV8HIoDHMzg7Xfz5v9fiMu+zPoNwMueSuU5+5mWFDGvnV0hOMMNJr1EjcCFGhBw X-Received: by 2002:a05:620a:450e:b0:77f:2878:52e6 with SMTP id t14-20020a05620a450e00b0077f287852e6mr11757233qkp.155.1702596831487; Thu, 14 Dec 2023 15:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702596831; cv=none; d=google.com; s=arc-20160816; b=LwfUNda2+ZCvIWr79xWyj+SibAqx3/Hn4lW3Upj/Vego1B5uikjIH1BsqiJUjRU/xC lwofheruQm7GIlHzaT+p6luV75BhHBCktuGYeHQZgFzM76ZBOpuUzkpK0KqNttwsCvXy Z3gFqroQmTs/SQRrURmUSeMyz/uIqONpeT2nE62RanlkZs3Ot30IoStel9wB8BYD7Dln F+ahOFzd6ZlwkNQ11dL2HATSbabNIrd9KwphTqaOlAc4TwUJH5Zdo/NtGX0LG1ClS1cA 5FYqo1CwHfK06LeCr6J0nh2rwv6mJUhHRfzreAqTaUuNBfW9/UZtY8Kqnr3ie6TQWOsa 8Rpg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-250-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 c4-20020a37e104000000b0077d9591c7f6si6042418qkm.107.2023.12.14.15.33.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 15:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-250-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; spf=pass (google.com: domain of linux-kernel+bounces-250-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-250-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 3A5231C21E37 for ; Thu, 14 Dec 2023 23:33:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DBBC6C6F3; Thu, 14 Dec 2023 23:33:43 +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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 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(+) 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. base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa -- 2.43.0