Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tas2781: Add keyword "init" in profile section

Since version 0x105, the keyword 'init' was introduced into the profile,
which is used for chip initialization, particularly to store common
settings for other non-initialization profiles.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250803131110.1443-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shenghao Ding and committed by
Mark Brown
e83dcd13 32dffd4c

+26
+8
include/sound/tas2781-dsp.h
··· 198 198 int ncfgs; 199 199 struct tasdevice_config_info **cfg_info; 200 200 int profile_cfg_id; 201 + /* 202 + * Since version 0x105, the keyword 'init' was introduced into the 203 + * profile, which is used for chip initialization, particularly to 204 + * store common settings for other non-initialization profiles. 205 + * if (init_profile_id < 0) 206 + * No init profile inside the RCA firmware. 207 + */ 208 + int init_profile_id; 201 209 }; 202 210 203 211 void tasdevice_select_cfg_blk(void *context, int conf_no,
+12
sound/soc/codecs/tas2781-fmwlib.c
··· 180 180 dev_err(tas_priv->dev, "add conf: Out of boundary\n"); 181 181 goto out; 182 182 } 183 + /* If in the RCA bin file are several profiles with the 184 + * keyword "init", init_profile_id only store the last 185 + * init profile id. 186 + */ 187 + if (strnstr(&config_data[config_offset], "init", 64)) { 188 + tas_priv->rcabin.init_profile_id = 189 + tas_priv->rcabin.ncfgs - 1; 190 + dev_dbg(tas_priv->dev, "%s: init profile id = %d\n", 191 + __func__, tas_priv->rcabin.init_profile_id); 192 + } 183 193 config_offset += 64; 184 194 } 185 195 ··· 293 283 int i; 294 284 295 285 rca = &(tas_priv->rcabin); 286 + /* Initialize to none */ 287 + rca->init_profile_id = -1; 296 288 fw_hdr = &(rca->fw_hdr); 297 289 if (!fmw || !fmw->data) { 298 290 dev_err(tas_priv->dev, "Failed to read %s\n",
+6
sound/soc/codecs/tas2781-i2c.c
··· 1641 1641 tasdevice_prmg_load(tas_priv, 0); 1642 1642 tas_priv->cur_prog = 0; 1643 1643 1644 + /* Init common setting for different audio profiles */ 1645 + if (tas_priv->rcabin.init_profile_id >= 0) 1646 + tasdevice_select_cfg_blk(tas_priv, 1647 + tas_priv->rcabin.init_profile_id, 1648 + TASDEVICE_BIN_BLK_PRE_POWER_UP); 1649 + 1644 1650 #ifdef CONFIG_SND_SOC_TAS2781_ACOUST_I2C 1645 1651 if (tas_priv->name_prefix) 1646 1652 acoustic_debugfs_node = devm_kasprintf(tas_priv->dev,