linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/tas2781: select program 0, conf 0 by default
@ 2023-12-14 23:33 Gergo Koteles
  2023-12-15  7:13 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Gergo Koteles @ 2023-12-14 23:33 UTC (permalink / raw)
  To: Shenghao Ding, Kevin Lu, Baojun Xu, Jaroslav Kysela, Takashi Iwai
  Cc: linux-kernel, alsa-devel, Gergo Koteles, stable

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 <soyer@irl.hu>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: hda/tas2781: select program 0, conf 0 by default
  2023-12-14 23:33 [PATCH] ALSA: hda/tas2781: select program 0, conf 0 by default Gergo Koteles
@ 2023-12-15  7:13 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-12-15  7:13 UTC (permalink / raw)
  To: Gergo Koteles
  Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Jaroslav Kysela,
	Takashi Iwai, linux-kernel, alsa-devel, stable

On Fri, 15 Dec 2023 00:33:27 +0100,
Gergo Koteles wrote:
> 
> 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 <soyer@irl.hu>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-15  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 23:33 [PATCH] ALSA: hda/tas2781: select program 0, conf 0 by default Gergo Koteles
2023-12-15  7:13 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).