Commit 00dd4d86 authored by Shenghao Ding's avatar Shenghao Ding Committed by Mark Brown

ASoc: tas2781: Add name_prefix as the prefix name of firmwares and kcontrol to...

ASoc: tas2781: Add name_prefix as the prefix name of firmwares and kcontrol to support corresponding TAS2563/TAS2781s

Add name_prefix as the prefix name of firmwares and
kcontrol to support corresponding TAS2563/TAS2781s.
name_prefix is not mandatory.
Signed-off-by: default avatarShenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240621132309.564-1-shenghao-ding@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fe836c78
...@@ -108,6 +108,7 @@ struct tasdevice_priv { ...@@ -108,6 +108,7 @@ struct tasdevice_priv {
unsigned char coef_binaryname[64]; unsigned char coef_binaryname[64];
unsigned char rca_binaryname[64]; unsigned char rca_binaryname[64];
unsigned char dev_name[32]; unsigned char dev_name[32];
const char *name_prefix;
unsigned char ndev; unsigned char ndev;
unsigned int magic_num; unsigned int magic_num;
unsigned int chip_id; unsigned int chip_id;
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// //
// tas2781-lib.c -- TAS2781 Common functions for HDA and ASoC Audio drivers // TAS2781 Common functions for HDA and ASoC Audio drivers
// //
// Copyright 2023 Texas Instruments, Inc. // Copyright 2023 - 2024 Texas Instruments, Inc.
// //
// Author: Shenghao Ding <shenghao-ding@ti.com> // Author: Shenghao Ding <shenghao-ding@ti.com>
...@@ -277,8 +277,13 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec, ...@@ -277,8 +277,13 @@ int tascodec_init(struct tasdevice_priv *tas_priv, void *codec,
*/ */
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin", if (tas_priv->name_prefix)
tas_priv->dev_name, tas_priv->ndev); scnprintf(tas_priv->rca_binaryname, 64, "%s-%sRCA%d.bin",
tas_priv->name_prefix, tas_priv->dev_name,
tas_priv->ndev);
else
scnprintf(tas_priv->rca_binaryname, 64, "%sRCA%d.bin",
tas_priv->dev_name, tas_priv->ndev);
crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL); crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL);
tas_priv->codec = codec; tas_priv->codec = codec;
ret = request_firmware_nowait(module, FW_ACTION_UEVENT, ret = request_firmware_nowait(module, FW_ACTION_UEVENT,
......
...@@ -579,6 +579,7 @@ static int tasdevice_codec_probe(struct snd_soc_component *codec) ...@@ -579,6 +579,7 @@ static int tasdevice_codec_probe(struct snd_soc_component *codec)
{ {
struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec); struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
tas_priv->name_prefix = codec->name_prefix;
return tascodec_init(tas_priv, codec, THIS_MODULE, tasdevice_fw_ready); return tascodec_init(tas_priv, codec, THIS_MODULE, tasdevice_fw_ready);
} }
......
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