alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
@ 2024-04-25  7:20 Aaron Ma
  2024-04-25  7:52 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2024-04-25  7:20 UTC (permalink / raw)
  To: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound; +Cc: perex, tiwai

TI upstream the files in ti/tas2781 for linux-firmware.
Make the driver find the correct files.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 include/sound/tas2781.h           | 1 +
 sound/pci/hda/tas2781_hda_i2c.c   | 2 +-
 sound/soc/codecs/tas2781-comlib.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
index 99ca3e401fd1..72119cc32c0f 100644
--- a/include/sound/tas2781.h
+++ b/include/sound/tas2781.h
@@ -21,6 +21,7 @@
 /* version number */
 #define TAS2781_DRV_VER			1
 #define SMARTAMP_MODULE_NAME		"tas2781"
+#define TAS2781_FIRMWARE_ROOT		"ti/tas2781/"
 #define TAS2781_GLOBAL_ADDR	0x40
 #define TAS2563_GLOBAL_ADDR	0x48
 #define TASDEVICE_RATES			(SNDRV_PCM_RATE_44100 |\
diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index 75f7674c66ee..72dc1469655f 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -649,7 +649,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
 	tasdevice_dsp_remove(tas_priv);
 
 	tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
-	scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%04X.bin",
+	scnprintf(tas_priv->coef_binaryname, 64, "%sTAS2XXX%04X.bin", TAS2781_FIRMWARE_ROOT,
 		codec->core.subsystem_id & 0xffff);
 	ret = tasdevice_dsp_parser(tas_priv);
 	if (ret) {
diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-comlib.c
index 3aa81514dad7..96fe1b855ec9 100644
--- a/sound/soc/codecs/tas2781-comlib.c
+++ b/sound/soc/codecs/tas2781-comlib.c
@@ -277,7 +277,7 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
 	 */
 	mutex_lock(&tas_priv->codec_lock);
 
-	scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
+	scnprintf(tas_priv->rca_binaryname, 64, "%s%sRCA%d.bin", TAS2781_FIRMWARE_ROOT,
 		tas_priv->dev_name, tas_priv->ndev);
 	crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
 	tas_priv->codec = codec;
-- 
2.34.1


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

* Re: [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
  2024-04-25  7:20 [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware Aaron Ma
@ 2024-04-25  7:52 ` Takashi Iwai
  2024-04-25  7:54   ` Aaron Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2024-04-25  7:52 UTC (permalink / raw)
  To: Aaron Ma
  Cc: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound,
	perex, tiwai

On Thu, 25 Apr 2024 09:20:00 +0200,
Aaron Ma wrote:
> 
> TI upstream the files in ti/tas2781 for linux-firmware.
> Make the driver find the correct files.

Note that the upstream linux-firmware provides symlinks to
ti/tas2781/* files, so it's not "incorrect", so far :)


thanks,

Takashi

> 
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>  include/sound/tas2781.h           | 1 +
>  sound/pci/hda/tas2781_hda_i2c.c   | 2 +-
>  sound/soc/codecs/tas2781-comlib.c | 2 +-
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
> index 99ca3e401fd1..72119cc32c0f 100644
> --- a/include/sound/tas2781.h
> +++ b/include/sound/tas2781.h
> @@ -21,6 +21,7 @@
>  /* version number */
>  #define TAS2781_DRV_VER			1
>  #define SMARTAMP_MODULE_NAME		"tas2781"
> +#define TAS2781_FIRMWARE_ROOT		"ti/tas2781/"
>  #define TAS2781_GLOBAL_ADDR	0x40
>  #define TAS2563_GLOBAL_ADDR	0x48
>  #define TASDEVICE_RATES			(SNDRV_PCM_RATE_44100 |\
> diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
> index 75f7674c66ee..72dc1469655f 100644
> --- a/sound/pci/hda/tas2781_hda_i2c.c
> +++ b/sound/pci/hda/tas2781_hda_i2c.c
> @@ -649,7 +649,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
>  	tasdevice_dsp_remove(tas_priv);
>  
>  	tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
> -	scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%04X.bin",
> +	scnprintf(tas_priv->coef_binaryname, 64, "%sTAS2XXX%04X.bin", TAS2781_FIRMWARE_ROOT,
>  		codec->core.subsystem_id & 0xffff);
>  	ret = tasdevice_dsp_parser(tas_priv);
>  	if (ret) {
> diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-comlib.c
> index 3aa81514dad7..96fe1b855ec9 100644
> --- a/sound/soc/codecs/tas2781-comlib.c
> +++ b/sound/soc/codecs/tas2781-comlib.c
> @@ -277,7 +277,7 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
>  	 */
>  	mutex_lock(&tas_priv->codec_lock);
>  
> -	scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
> +	scnprintf(tas_priv->rca_binaryname, 64, "%s%sRCA%d.bin", TAS2781_FIRMWARE_ROOT,
>  		tas_priv->dev_name, tas_priv->ndev);
>  	crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
>  	tas_priv->codec = codec;
> -- 
> 2.34.1
> 

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

* Re: [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
  2024-04-25  7:52 ` Takashi Iwai
@ 2024-04-25  7:54   ` Aaron Ma
  2024-04-25  8:36     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2024-04-25  7:54 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound,
	perex, tiwai


On 4/25/24 15:52, Takashi Iwai wrote:
> On Thu, 25 Apr 2024 09:20:00 +0200,
> Aaron Ma wrote:
>> TI upstream the files in ti/tas2781 for linux-firmware.
>> Make the driver find the correct files.
> Note that the upstream linux-firmware provides symlinks to
> ti/tas2781/* files, so it's not "incorrect", so far :)

$ find . -iname TIAS2781RCA2.bin
./ti/tas2781/TIAS2781RCA2.bin

Only one bin file found.
Could you point it out clearly?

Thanks,
Aaron

>
>
> thanks,
>
> Takashi
>
>> Signed-off-by: Aaron Ma<aaron.ma@canonical.com>
>> ---
>>   include/sound/tas2781.h           | 1 +
>>   sound/pci/hda/tas2781_hda_i2c.c   | 2 +-
>>   sound/soc/codecs/tas2781-comlib.c | 2 +-
>>   3 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
>> index 99ca3e401fd1..72119cc32c0f 100644
>> --- a/include/sound/tas2781.h
>> +++ b/include/sound/tas2781.h
>> @@ -21,6 +21,7 @@
>>   /* version number */
>>   #define TAS2781_DRV_VER			1
>>   #define SMARTAMP_MODULE_NAME		"tas2781"
>> +#define TAS2781_FIRMWARE_ROOT		"ti/tas2781/"
>>   #define TAS2781_GLOBAL_ADDR	0x40
>>   #define TAS2563_GLOBAL_ADDR	0x48
>>   #define TASDEVICE_RATES			(SNDRV_PCM_RATE_44100 |\
>> diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
>> index 75f7674c66ee..72dc1469655f 100644
>> --- a/sound/pci/hda/tas2781_hda_i2c.c
>> +++ b/sound/pci/hda/tas2781_hda_i2c.c
>> @@ -649,7 +649,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
>>   	tasdevice_dsp_remove(tas_priv);
>>   
>>   	tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
>> -	scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%04X.bin",
>> +	scnprintf(tas_priv->coef_binaryname, 64, "%sTAS2XXX%04X.bin", TAS2781_FIRMWARE_ROOT,
>>   		codec->core.subsystem_id & 0xffff);
>>   	ret = tasdevice_dsp_parser(tas_priv);
>>   	if (ret) {
>> diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-comlib.c
>> index 3aa81514dad7..96fe1b855ec9 100644
>> --- a/sound/soc/codecs/tas2781-comlib.c
>> +++ b/sound/soc/codecs/tas2781-comlib.c
>> @@ -277,7 +277,7 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
>>   	 */
>>   	mutex_lock(&tas_priv->codec_lock);
>>   
>> -	scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
>> +	scnprintf(tas_priv->rca_binaryname, 64, "%s%sRCA%d.bin", TAS2781_FIRMWARE_ROOT,
>>   		tas_priv->dev_name, tas_priv->ndev);
>>   	crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
>>   	tas_priv->codec = codec;
>> -- 
>> 2.34.1
>>

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

* Re: [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
  2024-04-25  7:54   ` Aaron Ma
@ 2024-04-25  8:36     ` Takashi Iwai
  2024-04-25  8:40       ` Aaron Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2024-04-25  8:36 UTC (permalink / raw)
  To: Aaron Ma
  Cc: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound,
	perex, tiwai

On Thu, 25 Apr 2024 09:54:17 +0200,
Aaron Ma wrote:
> 
> 
> On 4/25/24 15:52, Takashi Iwai wrote:
> 
>     On Thu, 25 Apr 2024 09:20:00 +0200,
>     Aaron Ma wrote:
>     
>         TI upstream the files in ti/tas2781 for linux-firmware.
>         Make the driver find the correct files.
>         
>     Note that the upstream linux-firmware provides symlinks to
>     ti/tas2781/* files, so it's not "incorrect", so far :)
> 
> $ find . -iname TIAS2781RCA2.bin
> ./ti/tas2781/TIAS2781RCA2.bin
> 
> Only one bin file found.
> Could you point it out clearly?

See WHENCE file.  It has "Link:" entries, and copy-firmware.sh creates
corresponding symlinks.


HTH,

Takashi

> 
> Thanks,
> Aaron
> 
>     thanks,
>     
>     Takashi
> 
>         Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
>         ---
>          include/sound/tas2781.h           | 1 +
>          sound/pci/hda/tas2781_hda_i2c.c   | 2 +-
>          sound/soc/codecs/tas2781-comlib.c | 2 +-
>          3 files changed, 3 insertions(+), 2 deletions(-)
>         
>         diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
>         index 99ca3e401fd1..72119cc32c0f 100644
>         --- a/include/sound/tas2781.h
>         +++ b/include/sound/tas2781.h
>         @@ -21,6 +21,7 @@
>          /* version number */
>          #define TAS2781_DRV_VER                                                1
>          #define SMARTAMP_MODULE_NAME                                           "tas2781"
>         +#define TAS2781_FIRMWARE_ROOT                                          "ti/tas2781/"
>          #define TAS2781_GLOBAL_ADDR                      0x40
>          #define TAS2563_GLOBAL_ADDR                      0x48
>          #define TASDEVICE_RATES                                                (SNDRV_PCM_RATE_44100 |\
>         diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
>         index 75f7674c66ee..72dc1469655f 100644
>         --- a/sound/pci/hda/tas2781_hda_i2c.c
>         +++ b/sound/pci/hda/tas2781_hda_i2c.c
>         @@ -649,7 +649,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
>               tasdevice_dsp_remove(tas_priv);
>          
>               tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
>         -     scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%04X.bin",
>         +     scnprintf(tas_priv->coef_binaryname, 64, "%sTAS2XXX%04X.bin", TAS2781_FIRMWARE_ROOT,
>                                     codec->core.subsystem_id & 0xffff);
>               ret = tasdevice_dsp_parser(tas_priv);
>               if (ret) {
>         diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-comlib.c
>         index 3aa81514dad7..96fe1b855ec9 100644
>         --- a/sound/soc/codecs/tas2781-comlib.c
>         +++ b/sound/soc/codecs/tas2781-comlib.c
>         @@ -277,7 +277,7 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
>                */
>               mutex_lock(&tas_priv->codec_lock);
>          
>         -     scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
>         +     scnprintf(tas_priv->rca_binaryname, 64, "%s%sRCA%d.bin", TAS2781_FIRMWARE_ROOT,
>                                     tas_priv->dev_name, tas_priv->ndev);
>               crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
>               tas_priv->codec = codec;
>         -- 
>         2.34.1
> 

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

* Re: [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
  2024-04-25  8:36     ` Takashi Iwai
@ 2024-04-25  8:40       ` Aaron Ma
  2024-04-25  8:45         ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2024-04-25  8:40 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound,
	perex, tiwai


On 4/25/24 16:36, Takashi Iwai wrote:
> On Thu, 25 Apr 2024 09:54:17 +0200,
> Aaron Ma wrote:
>>
>>
>> On 4/25/24 15:52, Takashi Iwai wrote:
>>
>>      On Thu, 25 Apr 2024 09:20:00 +0200,
>>      Aaron Ma wrote:
>>      
>>          TI upstream the files in ti/tas2781 for linux-firmware.
>>          Make the driver find the correct files.
>>          
>>      Note that the upstream linux-firmware provides symlinks to
>>      ti/tas2781/* files, so it's not "incorrect", so far :)
>>
>> $ find . -iname TIAS2781RCA2.bin
>> ./ti/tas2781/TIAS2781RCA2.bin
>>
>> Only one bin file found.
>> Could you point it out clearly?
> 
> See WHENCE file.  It has "Link:" entries, and copy-firmware.sh creates
> corresponding symlinks.

Oh, missed it.
Retrieve the patch.

Thanks,
Aaron

> 
> 
> HTH,
> 
> Takashi
> 
>>
>> Thanks,
>> Aaron
>>
>>      thanks,
>>      
>>      Takashi
>>
>>          Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
>>          ---
>>           include/sound/tas2781.h           | 1 +
>>           sound/pci/hda/tas2781_hda_i2c.c   | 2 +-
>>           sound/soc/codecs/tas2781-comlib.c | 2 +-
>>           3 files changed, 3 insertions(+), 2 deletions(-)
>>          
>>          diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
>>          index 99ca3e401fd1..72119cc32c0f 100644
>>          --- a/include/sound/tas2781.h
>>          +++ b/include/sound/tas2781.h
>>          @@ -21,6 +21,7 @@
>>           /* version number */
>>           #define TAS2781_DRV_VER                                                1
>>           #define SMARTAMP_MODULE_NAME                                           "tas2781"
>>          +#define TAS2781_FIRMWARE_ROOT                                          "ti/tas2781/"
>>           #define TAS2781_GLOBAL_ADDR                      0x40
>>           #define TAS2563_GLOBAL_ADDR                      0x48
>>           #define TASDEVICE_RATES                                                (SNDRV_PCM_RATE_44100 |\
>>          diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
>>          index 75f7674c66ee..72dc1469655f 100644
>>          --- a/sound/pci/hda/tas2781_hda_i2c.c
>>          +++ b/sound/pci/hda/tas2781_hda_i2c.c
>>          @@ -649,7 +649,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
>>                tasdevice_dsp_remove(tas_priv);
>>           
>>                tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
>>          -     scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%04X.bin",
>>          +     scnprintf(tas_priv->coef_binaryname, 64, "%sTAS2XXX%04X.bin", TAS2781_FIRMWARE_ROOT,
>>                                      codec->core.subsystem_id & 0xffff);
>>                ret = tasdevice_dsp_parser(tas_priv);
>>                if (ret) {
>>          diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-comlib.c
>>          index 3aa81514dad7..96fe1b855ec9 100644
>>          --- a/sound/soc/codecs/tas2781-comlib.c
>>          +++ b/sound/soc/codecs/tas2781-comlib.c
>>          @@ -277,7 +277,7 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
>>                 */
>>                mutex_lock(&tas_priv->codec_lock);
>>           
>>          -     scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
>>          +     scnprintf(tas_priv->rca_binaryname, 64, "%s%sRCA%d.bin", TAS2781_FIRMWARE_ROOT,
>>                                      tas_priv->dev_name, tas_priv->ndev);
>>                crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
>>                tas_priv->codec = codec;
>>          --
>>          2.34.1
>>


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

* Re: [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware
  2024-04-25  8:40       ` Aaron Ma
@ 2024-04-25  8:45         ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2024-04-25  8:45 UTC (permalink / raw)
  To: Aaron Ma
  Cc: shenghao-ding, kevin-lu, baojun.xu, alsa-devel, linux-sound,
	perex, tiwai

On Thu, 25 Apr 2024 10:40:50 +0200,
Aaron Ma wrote:
> 
> 
> On 4/25/24 16:36, Takashi Iwai wrote:
> > On Thu, 25 Apr 2024 09:54:17 +0200,
> > Aaron Ma wrote:
> >> 
> >> 
> >> On 4/25/24 15:52, Takashi Iwai wrote:
> >> 
> >>      On Thu, 25 Apr 2024 09:20:00 +0200,
> >>      Aaron Ma wrote:
> >>               TI upstream the files in ti/tas2781 for
> >> linux-firmware.
> >>          Make the driver find the correct files.
> >>               Note that the upstream linux-firmware provides
> >> symlinks to
> >>      ti/tas2781/* files, so it's not "incorrect", so far :)
> >> 
> >> $ find . -iname TIAS2781RCA2.bin
> >> ./ti/tas2781/TIAS2781RCA2.bin
> >> 
> >> Only one bin file found.
> >> Could you point it out clearly?
> > 
> > See WHENCE file.  It has "Link:" entries, and copy-firmware.sh creates
> > corresponding symlinks.
> 
> Oh, missed it.
> Retrieve the patch.

OK.  I guess ti/*/* is a better place for newer firmware files
(and likely intended by TI), but it's up to TI whether we should
update or not for newer chips.  Let's see.


thanks,

Takashi

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

end of thread, other threads:[~2024-04-25  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25  7:20 [PATCH] ALSA: hda/ASOC tas2781: align the path of firmware Aaron Ma
2024-04-25  7:52 ` Takashi Iwai
2024-04-25  7:54   ` Aaron Ma
2024-04-25  8:36     ` Takashi Iwai
2024-04-25  8:40       ` Aaron Ma
2024-04-25  8:45         ` 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).