alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization
@ 2025-08-20  8:21 Shenghao Ding
  2025-08-21  7:17 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Shenghao Ding @ 2025-08-20  8:21 UTC (permalink / raw)
  To: tiwai
  Cc: broonie, andriy.shevchenko, 13564923607, 13916275206, alsa-devel,
	linux-kernel, baojun.xu, Baojun.Xu, jesse-ji, Shenghao Ding

Optimize the time consumption of profile switching, init_profile saves
the common settings of different profiles, such as the dsp coefficients,
etc, which can greatly reduce the profile switching time comsumption and
remove the repetitive settings.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
---
 sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
index 318f8c58ae61..97c33fee9660 100644
--- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
+++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
@@ -477,6 +477,12 @@ static void tasdevice_dspfw_init(void *context)
 	if (tas_priv->fmw->nr_configurations > 0)
 		tas_priv->cur_conf = 0;
 
+	/* Init common setting for different audio profiles */
+	if (tas_priv->rcabin.init_profile_id >= 0)
+		tasdevice_select_cfg_blk(tas_priv,
+			tas_priv->rcabin.init_profile_id,
+			TASDEVICE_BIN_BLK_PRE_POWER_UP);
+
 	/* If calibrated data occurs error, dsp will still works with default
 	 * calibrated data inside algo.
 	 */
@@ -779,6 +785,12 @@ static int tas2781_system_resume(struct device *dev)
 	tasdevice_reset(tas_hda->priv);
 	tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);
 
+	/* Init common setting for different audio profiles */
+	if (tas_hda->priv->rcabin.init_profile_id >= 0)
+		tasdevice_select_cfg_blk(tas_hda->priv,
+			tas_hda->priv->rcabin.init_profile_id,
+			TASDEVICE_BIN_BLK_PRE_POWER_UP);
+
 	if (tas_hda->priv->playback_started)
 		tasdevice_tuning_switch(tas_hda->priv, 0);
 
-- 
2.43.0


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

* Re: [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization
  2025-08-20  8:21 [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization Shenghao Ding
@ 2025-08-21  7:17 ` Takashi Iwai
  2025-08-21  9:01   ` [EXTERNAL] " Ding, Shenghao
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2025-08-21  7:17 UTC (permalink / raw)
  To: Shenghao Ding
  Cc: broonie, andriy.shevchenko, 13564923607, 13916275206, alsa-devel,
	linux-kernel, baojun.xu, Baojun.Xu, jesse-ji

On Wed, 20 Aug 2025 10:21:23 +0200,
Shenghao Ding wrote:
> 
> Optimize the time consumption of profile switching, init_profile saves
> the common settings of different profiles, such as the dsp coefficients,
> etc, which can greatly reduce the profile switching time comsumption and
> remove the repetitive settings.
> 
> Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
> ---
>  sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> index 318f8c58ae61..97c33fee9660 100644
> --- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> +++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
> @@ -477,6 +477,12 @@ static void tasdevice_dspfw_init(void *context)
>  	if (tas_priv->fmw->nr_configurations > 0)
>  		tas_priv->cur_conf = 0;
>  
> +	/* Init common setting for different audio profiles */
> +	if (tas_priv->rcabin.init_profile_id >= 0)
> +		tasdevice_select_cfg_blk(tas_priv,
> +			tas_priv->rcabin.init_profile_id,
> +			TASDEVICE_BIN_BLK_PRE_POWER_UP);
> +
>  	/* If calibrated data occurs error, dsp will still works with default
>  	 * calibrated data inside algo.
>  	 */
> @@ -779,6 +785,12 @@ static int tas2781_system_resume(struct device *dev)
>  	tasdevice_reset(tas_hda->priv);
>  	tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);
>  
> +	/* Init common setting for different audio profiles */
> +	if (tas_hda->priv->rcabin.init_profile_id >= 0)
> +		tasdevice_select_cfg_blk(tas_hda->priv,
> +			tas_hda->priv->rcabin.init_profile_id,
> +			TASDEVICE_BIN_BLK_PRE_POWER_UP);
> +
>  	if (tas_hda->priv->playback_started)
>  		tasdevice_tuning_switch(tas_hda->priv, 0);

The patch causes build errors:

sound/hda/codecs/side-codecs/tas2781_hda_i2c.c: In function ‘tasdevice_dspfw_init’:
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:468:29: error: ‘struct tasdevice_rca’ has no member named ‘init_profile_id’
  468 |         if (tas_priv->rcabin.init_profile_id >= 0)
      |                             ^
....

Something still not landed in my tree yet.


thanks,

Takashi

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

* RE: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization
  2025-08-21  7:17 ` Takashi Iwai
@ 2025-08-21  9:01   ` Ding, Shenghao
  2025-08-21  9:30     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Ding, Shenghao @ 2025-08-21  9:01 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: broonie@kernel.org, andriy.shevchenko@linux.intel.com,
	13564923607@139.com, 13916275206@139.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Xu, Baojun, Baojun.Xu@fpt.com, Ji, Jesse

> -----Original Message-----
> From: Takashi Iwai <tiwai@suse.de>
> Sent: Thursday, August 21, 2025 3:17 PM
> To: Ding, Shenghao <shenghao-ding@ti.com>
> Cc: broonie@kernel.org; andriy.shevchenko@linux.intel.com;
> 13564923607@139.com; 13916275206@139.com; alsa-devel@alsa-
> project.org; linux-kernel@vger.kernel.org; Xu, Baojun <baojun.xu@ti.com>;
> Baojun.Xu@fpt.com; Ji, Jesse <jesse-ji@ti.com>
> Subject: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Enable
> init_profile_id for device initialization
> 
> On Wed, 20 Aug 2025 10: 21: 23 +0200, Shenghao Ding wrote: > > Optimize
> the time consumption of profile switching, init_profile saves > the common
> settings of different profiles, such as the dsp coefficients, > etc, which can
> greatly ZjQcmQRYFpfptBannerStart This message was sent from outside of
> Texas Instruments.
> Do not click links or open attachments unless you recognize the source of
> this email and know the content is safe.
> <https://us-phishalarm-
> ewt.proofpoint.com/EWT/v1/G3vK!vxdrHf3mV2Ub4obsvxtoX4FTV-yYd_C-
> 6ngQtFeUFpCRaEESj8_B-sZXmuX5JN2I2u4Qx-lD$>
> Report Suspicious
> 
> ZjQcmQRYFpfptBannerEnd
> On Wed, 20 Aug 2025 10:21:23 +0200,
> Shenghao Ding wrote:
> >
> > Optimize the time consumption of profile switching, init_profile saves
> > the common settings of different profiles, such as the dsp
> > coefficients, etc, which can greatly reduce the profile switching time
> > comsumption and remove the repetitive settings.
> >
..............................
> The patch causes build errors:
> 
> sound/hda/codecs/side-codecs/tas2781_hda_i2c.c: In function
> ʽtasdevice_dspfw_initʼ:
> sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:468:29: error: ʽstruct
> tasdevice_rcaʼ has no member named ʽinit_profile_idʼ
>   468 |         if (tas_priv->rcabin.init_profile_id >= 0)
>       |                             ^
> ....
> 
> Something still not landed in my tree yet.
I will resubmit it after your tree is ready.
> 
> 
> thanks,
> 
> Takashi

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

* Re: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization
  2025-08-21  9:01   ` [EXTERNAL] " Ding, Shenghao
@ 2025-08-21  9:30     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2025-08-21  9:30 UTC (permalink / raw)
  To: Ding, Shenghao
  Cc: broonie@kernel.org, andriy.shevchenko@linux.intel.com,
	13564923607@139.com, 13916275206@139.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Xu, Baojun, Baojun.Xu@fpt.com, Ji, Jesse

On Thu, 21 Aug 2025 11:01:45 +0200,
Ding, Shenghao wrote:
> 
> > -----Original Message-----
> > From: Takashi Iwai <tiwai@suse.de>
> > Sent: Thursday, August 21, 2025 3:17 PM
> > To: Ding, Shenghao <shenghao-ding@ti.com>
> > Cc: broonie@kernel.org; andriy.shevchenko@linux.intel.com;
> > 13564923607@139.com; 13916275206@139.com; alsa-devel@alsa-
> > project.org; linux-kernel@vger.kernel.org; Xu, Baojun <baojun.xu@ti.com>;
> > Baojun.Xu@fpt.com; Ji, Jesse <jesse-ji@ti.com>
> > Subject: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Enable
> > init_profile_id for device initialization
> > 
> > On Wed, 20 Aug 2025 10: 21: 23 +0200, Shenghao Ding wrote: > > Optimize
> > the time consumption of profile switching, init_profile saves > the common
> > settings of different profiles, such as the dsp coefficients, > etc, which can
> > greatly ZjQcmQRYFpfptBannerStart This message was sent from outside of
> > Texas Instruments.
> > Do not click links or open attachments unless you recognize the source of
> > this email and know the content is safe.
> > <https://us-phishalarm-
> > ewt.proofpoint.com/EWT/v1/G3vK!vxdrHf3mV2Ub4obsvxtoX4FTV-yYd_C-
> > 6ngQtFeUFpCRaEESj8_B-sZXmuX5JN2I2u4Qx-lD$>
> > Report Suspicious
> > 
> > ZjQcmQRYFpfptBannerEnd
> > On Wed, 20 Aug 2025 10:21:23 +0200,
> > Shenghao Ding wrote:
> > >
> > > Optimize the time consumption of profile switching, init_profile saves
> > > the common settings of different profiles, such as the dsp
> > > coefficients, etc, which can greatly reduce the profile switching time
> > > comsumption and remove the repetitive settings.
> > >
> ..............................
> > The patch causes build errors:
> > 
> > sound/hda/codecs/side-codecs/tas2781_hda_i2c.c: In function
> > ʽtasdevice_dspfw_initʼ:
> > sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:468:29: error: ʽstruct
> > tasdevice_rcaʼ has no member named ʽinit_profile_idʼ
> >   468 |         if (tas_priv->rcabin.init_profile_id >= 0)
> >       |                             ^
> > ....
> > 
> > Something still not landed in my tree yet.
> I will resubmit it after your tree is ready.

So it's currently only in ASoC tree?
Then maybe it's easier to put Mark's tree instead.

In that case, feel free to take my ack:
Acked-by: Takashi Iwai <tiwai@suse.de>

But, the current situation of TAS driver support is messy, a part of
changes are found in my tree while another part in Mark's tree
individually...


thanks,

Takashi

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

end of thread, other threads:[~2025-08-21  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20  8:21 [PATCH v1] ALSA: hda/tas2781: Enable init_profile_id for device initialization Shenghao Ding
2025-08-21  7:17 ` Takashi Iwai
2025-08-21  9:01   ` [EXTERNAL] " Ding, Shenghao
2025-08-21  9:30     ` 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).