diff mbox series

[v4,1/3] ALSA: ASoc/tas2781: Fix wrong loading calibrated data sequence

Message ID 20240510034123.1181-1-shenghao-ding@ti.com (mailing list archive)
State New
Headers show
Series [v4,1/3] ALSA: ASoc/tas2781: Fix wrong loading calibrated data sequence | expand

Commit Message

Shenghao Ding May 10, 2024, 3:41 a.m. UTC
Calibrated data will be set to default after loading DSP config params,
which will cause speaker protection work abnormally. Reload calibrated
data after loading DSP config params.

Fixes: ef3bcde75d06 ("ASoc: tas2781: Add tas2781 driver")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>

---
v4:
 - Use the the culprit of the bug itself as the fixes tag
v3:
 - No changes.
v2:
 - In the Subject, fixed --> Fix
 - Add Fixes tag
 - Changed the copyright year to 2024 in the related files
 - In tas2781-dsp.h, __TASDEVICE_DSP_H__ --> __TAS2781_DSP_H__
v1:
 - Download calibrated data after loading the new DSP config params
 - Remove tasdevice_prmg_calibdata_load, because it is unnecessary to load
   calibrated data after loading DSP program.
---
 include/sound/tas2781-dsp.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Mark Brown May 10, 2024, 6:11 a.m. UTC | #1
On Fri, May 10, 2024 at 11:41:19AM +0800, Shenghao Ding wrote:

> Calibrated data will be set to default after loading DSP config params,
> which will cause speaker protection work abnormally. Reload calibrated
> data after loading DSP config params.

This changelog...

> -#ifndef __TASDEVICE_DSP_H__
> -#define __TASDEVICE_DSP_H__
> +#ifndef __TAS2781_DSP_H__
> +#define __TAS2781_DSP_H__
>  
>  #define MAIN_ALL_DEVICES			0x0d
>  #define MAIN_DEVICE_A				0x01
> @@ -180,7 +180,6 @@ void tasdevice_calbin_remove(void *context);
>  int tasdevice_select_tuningprm_cfg(void *context, int prm,
>  	int cfg_no, int rca_conf_no);
>  int tasdevice_prmg_load(void *context, int prm_no);
> -int tasdevice_prmg_calibdata_load(void *context, int prm_no);
>  void tasdevice_tuning_switch(void *context, int state);
>  int tas2781_load_calibration(void *context, char *file_name,
>  	unsigned short i);

...doesn't seem to have much relationship with the change?
Andy Shevchenko May 10, 2024, 3:12 p.m. UTC | #2
On Fri, May 10, 2024 at 11:41:19AM +0800, Shenghao Ding wrote:
> Calibrated data will be set to default after loading DSP config params,
> which will cause speaker protection work abnormally. Reload calibrated
> data after loading DSP config params.
> 
> Fixes: ef3bcde75d06 ("ASoc: tas2781: Add tas2781 driver")

How on earth this can be a fix?..

> -// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
> +// Copyright (C) 2022 - 2024 Texas Instruments Incorporated

> -#ifndef __TASDEVICE_DSP_H__
> -#define __TASDEVICE_DSP_H__
> +#ifndef __TAS2781_DSP_H__
> +#define __TAS2781_DSP_H__

> -int tasdevice_prmg_calibdata_load(void *context, int prm_no);
Shenghao Ding May 11, 2024, 3:35 a.m. UTC | #3
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Friday, May 10, 2024 11:13 PM
> To: Ding, Shenghao <shenghao-ding@ti.com>
> Cc: broonie@kernel.org; lgirdwood@gmail.com; perex@perex.cz; pierre-
> louis.bossart@linux.intel.com; 13916275206@139.com; alsa-devel@alsa-
> project.org; linux-kernel@vger.kernel.org; liam.r.girdwood@intel.com;
> bard.liao@intel.com; yung-chuan.liao@linux.intel.com; Lu, Kevin <kevin-
> lu@ti.com>; cameron.berkenpas@gmail.com; tiwai@suse.de; Xu, Baojun
> <baojun.xu@ti.com>; soyer@irl.hu; Baojun.Xu@fpt.com
> Subject: [EXTERNAL] Re: [PATCH v4 1/3] ALSA: ASoc/tas2781: Fix wrong loading
> calibrated data sequence
> 
> On Fri, May 10, 2024 at 11: 41: 19AM +0800, Shenghao Ding wrote: > Calibrated
> data will be set to default after loading DSP config params, > which will cause
> speaker protection work abnormally. Reload calibrated > data after loading
> 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. If you wish to report this message to IT
> Security, please forward the message as an attachment to phishing@list.ti.com
> 
> ZjQcmQRYFpfptBannerEnd
> On Fri, May 10, 2024 at 11:41:19AM +0800, Shenghao Ding wrote:
> > Calibrated data will be set to default after loading DSP config
> > params, which will cause speaker protection work abnormally. Reload
> > calibrated data after loading DSP config params.
> >
> > Fixes: ef3bcde75d06 ("ASoc: tas2781: Add tas2781 driver")
> 
> How on earth this can be a fix?..
Removing the declaration of tasdevice_prmg_calibdata_load is a part of fix.
Loading calibrated data after loading dsp program become a redundance.
> 
> > -// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
> > +// Copyright (C) 2022 - 2024 Texas Instruments Incorporated
> 
...
> > -int tasdevice_prmg_calibdata_load(void *context, int prm_no);
> 
> --
> With Best Regards,
> Andy Shevchenko
>
diff mbox series

Patch

diff --git a/include/sound/tas2781-dsp.h b/include/sound/tas2781-dsp.h
index ea9af2726a53..7fba7ea26a4b 100644
--- a/include/sound/tas2781-dsp.h
+++ b/include/sound/tas2781-dsp.h
@@ -2,7 +2,7 @@ 
 //
 // ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
 //
-// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
+// Copyright (C) 2022 - 2024 Texas Instruments Incorporated
 // https://www.ti.com
 //
 // The TAS2781 driver implements a flexible and configurable
@@ -13,8 +13,8 @@ 
 // Author: Kevin Lu <kevin-lu@ti.com>
 //
 
-#ifndef __TASDEVICE_DSP_H__
-#define __TASDEVICE_DSP_H__
+#ifndef __TAS2781_DSP_H__
+#define __TAS2781_DSP_H__
 
 #define MAIN_ALL_DEVICES			0x0d
 #define MAIN_DEVICE_A				0x01
@@ -180,7 +180,6 @@  void tasdevice_calbin_remove(void *context);
 int tasdevice_select_tuningprm_cfg(void *context, int prm,
 	int cfg_no, int rca_conf_no);
 int tasdevice_prmg_load(void *context, int prm_no);
-int tasdevice_prmg_calibdata_load(void *context, int prm_no);
 void tasdevice_tuning_switch(void *context, int state);
 int tas2781_load_calibration(void *context, char *file_name,
 	unsigned short i);