Commit 55f0a1fa authored by Shenghao Ding's avatar Shenghao Ding Committed by Mark Brown

ASoc: tas2781: Add name_prefix as the prefix name of DSP firmwares and calibrated data files

Add name_prefix as the prefix name of DSP firmwares
and calibrated data files which stored speaker
calibrated impedance.
Signed-off-by: default avatarShenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240629101112.628-1-shenghao-ding@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 878f4c36
...@@ -394,8 +394,12 @@ static void tasdevice_fw_ready(const struct firmware *fmw, ...@@ -394,8 +394,12 @@ static void tasdevice_fw_ready(const struct firmware *fmw,
* failing to load DSP firmware is NOT an error. * failing to load DSP firmware is NOT an error.
*/ */
tas_priv->fw_state = TASDEVICE_RCA_FW_OK; tas_priv->fw_state = TASDEVICE_RCA_FW_OK;
scnprintf(tas_priv->coef_binaryname, 64, "%s_coef.bin", if (tas_priv->name_prefix)
tas_priv->dev_name); scnprintf(tas_priv->rca_binaryname, 64, "%s-%s_coef.bin",
tas_priv->name_prefix, tas_priv->dev_name);
else
scnprintf(tas_priv->coef_binaryname, 64, "%s_coef.bin",
tas_priv->dev_name);
ret = tasdevice_dsp_parser(tas_priv); ret = tasdevice_dsp_parser(tas_priv);
if (ret) { if (ret) {
dev_err(tas_priv->dev, "dspfw load %s error\n", dev_err(tas_priv->dev, "dspfw load %s error\n",
...@@ -418,8 +422,15 @@ static void tasdevice_fw_ready(const struct firmware *fmw, ...@@ -418,8 +422,15 @@ static void tasdevice_fw_ready(const struct firmware *fmw,
* calibrated data inside algo. * calibrated data inside algo.
*/ */
for (i = 0; i < tas_priv->ndev; i++) { for (i = 0; i < tas_priv->ndev; i++) {
scnprintf(tas_priv->cal_binaryname[i], 64, "%s_cal_0x%02x.bin", if (tas_priv->name_prefix)
tas_priv->dev_name, tas_priv->tasdevice[i].dev_addr); scnprintf(tas_priv->cal_binaryname[i], 64,
"%s-%s_cal_0x%02x.bin", tas_priv->name_prefix,
tas_priv->dev_name,
tas_priv->tasdevice[i].dev_addr);
else
scnprintf(tas_priv->cal_binaryname[i], 64,
"%s_cal_0x%02x.bin", tas_priv->dev_name,
tas_priv->tasdevice[i].dev_addr);
ret = tas2781_load_calibration(tas_priv, ret = tas2781_load_calibration(tas_priv,
tas_priv->cal_binaryname[i], i); tas_priv->cal_binaryname[i], i);
if (ret != 0) if (ret != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment