* [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers
@ 2026-08-19 5:34 Niranjan H Y
2026-08-19 5:34 ` [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family Niranjan H Y
2026-08-19 13:46 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Niranjan H Y @ 2026-08-19 5:34 UTC (permalink / raw)
To: linux-sound
Cc: linux-kernel, broonie, ckeepax, lgirdwood, perex, tiwai,
cezary.rojewski, peter.ujfalusi, yung-chuan.liao, kai.vehmanen,
pierre-louis.bossart, baojun.xu, shenghao-ding, sandeepk,
v-hampiholi, Niranjan H Y
At boot time, when the registers are accessed by asoc
layer while trying to enable a DAPM path, while the device
is still being attached, -EBUSY error will be thown by
regmap_read and regmap_udpate_bits. Because the regmap will
be in cache only mode. Add default values for these registers
so that, the cached values are returned instead of error.
Also drop the unwanted register writes with default values.
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
---
sound/soc/codecs/tac5xx2-sdw.c | 88 ++++++++++++++++++----------------
1 file changed, 46 insertions(+), 42 deletions(-)
diff --git a/sound/soc/codecs/tac5xx2-sdw.c b/sound/soc/codecs/tac5xx2-sdw.c
index c062065a8..6bcba22e5 100644
--- a/sound/soc/codecs/tac5xx2-sdw.c
+++ b/sound/soc/codecs/tac5xx2-sdw.c
@@ -55,6 +55,12 @@
#define TAC_XU_BYPASS_REG(func, xu) \
SDW_SDCA_CTL(TAC_FUNCTION_ID_##func, TAC_SDCA_ENT_##xu, \
TAC_SDCA_CTL_XU_BYPASS, 0)
+#define TAC_VOLUME_REG(func, fu, ch) \
+ SDW_SDCA_CTL(TAC_FUNCTION_ID_##func, TAC_SDCA_ENT_##fu, \
+ TAC_SDCA_CHANNEL_VOLUME, TAC_CHANNEL_##ch)
+#define TAC_GAIN_REG(func, fu, ch) \
+ SDW_SDCA_CTL(TAC_FUNCTION_ID_##func, TAC_SDCA_ENT_##fu, \
+ TAC_SDCA_MASTER_GAIN, TAC_CHANNEL_##ch)
/* mute registers */
#define FU21_L_MUTE_REG TAC_MUTE_REG(SA, FU21, LEFT)
@@ -381,6 +387,46 @@ static const struct reg_default tac_reg_default[] = {
{TAC_REG_SDW(0, 1, 0x71), 0x5},
{TAC_REG_SDW(0, 1, 0x72), 0x6},
{TAC_REG_SDW(0, 1, 0x73), 0x7},
+ /* SA */
+ {TAC_VOLUME_REG(SA, FU21, LEFT), 0x9c00},
+ {TAC_VOLUME_REG(SA, FU21, RIGHT), 0x9c00},
+ {TAC_GAIN_REG(SA, FU23, LEFT), 0x0},
+ {TAC_GAIN_REG(SA, FU23, RIGHT), 0x0},
+ {TAC_MUTE_REG(SA, FU21, LEFT), 0x1},
+ {TAC_MUTE_REG(SA, FU21, RIGHT), 0x1},
+ {TAC_MUTE_REG(SA, FU23, LEFT), 0x1},
+ {TAC_MUTE_REG(SA, FU23, RIGHT), 0x1},
+ /* SM */
+ {TAC_GAIN_REG(SM, FU11, LEFT), 0x0},
+ {TAC_GAIN_REG(SM, FU11, RIGHT), 0x0},
+ {TAC_GAIN_REG(SM, FU113, LEFT), 0x0},
+ {TAC_GAIN_REG(SM, FU113, RIGHT), 0x0},
+ {SDW_SDCA_CTL(TAC_FUNCTION_ID_SM, TAC_SDCA_ENT_CS113,
+ TAC_SDCA_CTL_CS_SAMP_RATE_IDX, 0), 0x0},
+ {TAC_USAGE_REG(SM, IT11), 0x0},
+ {TAC_MUTE_REG(SM, FU11, LEFT), 0x1},
+ {TAC_MUTE_REG(SM, FU11, RIGHT), 0x1},
+ {TAC_XU_BYPASS_REG(SM, XU12), 0x1},
+ {TAC_MUTE_REG(SM, FU113, LEFT), 0x1},
+ {TAC_MUTE_REG(SM, FU113, RIGHT), 0x1},
+ {TAC_USAGE_REG(SM, OT113), 0x0},
+ /* UAJ */
+ {TAC_VOLUME_REG(UAJ, FU41, LEFT), 0x0},
+ {TAC_VOLUME_REG(UAJ, FU41, RIGHT), 0x0},
+ {SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_FU36, TAC_SDCA_CHANNEL_VOLUME,
+ TAC_JACK_MONO_CS), 0x0},
+ {SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_CS41, TAC_SDCA_CTL_CS_SAMP_RATE_IDX, 0),
+ 0x0},
+ {SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_CS36, TAC_SDCA_CTL_CS_SAMP_RATE_IDX, 0),
+ 0x0},
+ {TAC_USAGE_REG(UAJ, IT41), 0x0},
+ {TAC_MUTE_REG(UAJ, FU41, LEFT), 0x1},
+ {TAC_MUTE_REG(UAJ, FU41, RIGHT), 0x1},
+ {TAC_XU_BYPASS_REG(UAJ, XU42), 0x0},
+ {TAC_USAGE_REG(UAJ, OT45), 0x0},
+ {TAC_USAGE_REG(UAJ, IT33), 0x0},
+ {TAC_MUTE_REG(UAJ, FU36, RIGHT), 0x1},
+ {TAC_USAGE_REG(UAJ, OT36), 0x0},
};
static const struct reg_sequence tac_spk_seq[] = {
@@ -388,30 +434,6 @@ static const struct reg_sequence tac_spk_seq[] = {
TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU21,
TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
-};
-
-static const struct reg_sequence tac_sm_seq[] = {
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SM, TAC_SDCA_ENT_FU113,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SM, TAC_SDCA_ENT_FU113,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SM, TAC_SDCA_ENT_FU11,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SM, TAC_SDCA_ENT_FU11,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
-};
-
-static const struct reg_sequence tac_uaj_seq[] = {
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_FU41,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_FU41,
- TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
- REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_FU36,
- TAC_SDCA_CHANNEL_GAIN, TAC_JACK_MONO_CS), 0),
};
static bool tac_volatile_reg(struct device *dev, unsigned int reg)
@@ -1761,16 +1783,6 @@ static int tac_io_init(struct device *dev, struct sdw_slave *slave, bool first)
goto io_init_err;
}
dev_dbg(dev, "smartmic init done\n");
-
- if (first) {
- ret = regmap_multi_reg_write(tac_dev->regmap, tac_sm_seq,
- ARRAY_SIZE(tac_sm_seq));
- if (ret) {
- dev_err(tac_dev->dev,
- "init writes failed, err=%d", ret);
- goto io_init_err;
- }
- }
}
if (tac_dev->uaj_func_data) {
@@ -1783,14 +1795,6 @@ static int tac_io_init(struct device *dev, struct sdw_slave *slave, bool first)
dev_dbg(dev, "uaj init done\n");
if (first) {
- ret = regmap_multi_reg_write(tac_dev->regmap, tac_uaj_seq,
- ARRAY_SIZE(tac_uaj_seq));
- if (ret) {
- dev_err(tac_dev->dev,
- "init writes failed, err=%d", ret);
- goto io_init_err;
- }
-
if (tac_dev->hs_jack) {
ret = tac5xx2_jack_init(tac_dev);
if (ret) {
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family
2026-08-19 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Niranjan H Y
@ 2026-08-19 5:34 ` Niranjan H Y
2026-08-19 13:50 ` Mark Brown
2026-08-19 13:46 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Niranjan H Y @ 2026-08-19 5:34 UTC (permalink / raw)
To: linux-sound
Cc: linux-kernel, broonie, ckeepax, lgirdwood, perex, tiwai,
cezary.rojewski, peter.ujfalusi, yung-chuan.liao, kai.vehmanen,
pierre-louis.bossart, baojun.xu, shenghao-ding, sandeepk,
v-hampiholi, Niranjan H Y
The tac5xx2 RTD init does not populate card->components with the
spk:<prefix> string. With this change, "amixer -D hw:<card> info"
includes the spk identifier for each tac5xx2 speaker component,
following the same pattern used by other codec families.
This allows userspace to identify the speaker codec at runtime
and enables UCM card matching for the tac5xx2 family.
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
---
sound/soc/sdw_utils/soc_sdw_ti_amp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/soc/sdw_utils/soc_sdw_ti_amp.c b/sound/soc/sdw_utils/soc_sdw_ti_amp.c
index d0ae5d7ef..5e0b2c753 100644
--- a/sound/soc/sdw_utils/soc_sdw_ti_amp.c
+++ b/sound/soc/sdw_utils/soc_sdw_ti_amp.c
@@ -127,6 +127,12 @@ int asoc_sdw_ti_tac5xx2_spk_rtd_init(struct snd_soc_pcm_runtime *rtd,
struct snd_soc_dai *codec_dai;
const char *prefix;
+ card->components = devm_kasprintf(card->dev, GFP_KERNEL,
+ "%s spk:%s", card->components,
+ dai->component->name_prefix);
+ if (!card->components)
+ return -ENOMEM;
+
for_each_rtd_codec_dais(rtd, i, codec_dai) {
if (!strstr(codec_dai->name, "tac5") &&
!strstr(codec_dai->name, "tas2883"))
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers
2026-08-19 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Niranjan H Y
2026-08-19 5:34 ` [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family Niranjan H Y
@ 2026-08-19 13:46 ` Mark Brown
2026-08-20 5:06 ` Holalu Yogendra, Niranjan
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2026-08-19 13:46 UTC (permalink / raw)
To: Niranjan H Y
Cc: linux-sound, linux-kernel, ckeepax, lgirdwood, perex, tiwai,
cezary.rojewski, peter.ujfalusi, yung-chuan.liao, kai.vehmanen,
pierre-louis.bossart, baojun.xu, shenghao-ding, sandeepk,
v-hampiholi
[-- Attachment #1: Type: text/plain, Size: 803 bytes --]
On Wed, Aug 19, 2026 at 11:04:26AM +0530, Niranjan H Y wrote:
> + /* SA */
> + {TAC_VOLUME_REG(SA, FU21, LEFT), 0x9c00},
> + {TAC_VOLUME_REG(SA, FU21, RIGHT), 0x9c00},
> + {TAC_GAIN_REG(SA, FU23, LEFT), 0x0},
> + {TAC_GAIN_REG(SA, FU23, RIGHT), 0x0},
> + {TAC_MUTE_REG(SA, FU21, LEFT), 0x1},
> + {TAC_MUTE_REG(SA, FU21, RIGHT), 0x1},
> + {TAC_MUTE_REG(SA, FU23, LEFT), 0x1},
> + {TAC_MUTE_REG(SA, FU23, RIGHT), 0x1},
Did you check the sorting of the table here?
> - REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
> - TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
> - REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
> - TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
The new macros use _CHANEL_VOLUME and _MASTER_GAIN, there's none using
_CHANNEL_GAIN?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family
2026-08-19 5:34 ` [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family Niranjan H Y
@ 2026-08-19 13:50 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-08-19 13:50 UTC (permalink / raw)
To: Niranjan H Y
Cc: linux-sound, linux-kernel, ckeepax, lgirdwood, perex, tiwai,
cezary.rojewski, peter.ujfalusi, yung-chuan.liao, kai.vehmanen,
pierre-louis.bossart, baojun.xu, shenghao-ding, sandeepk,
v-hampiholi
[-- Attachment #1: Type: text/plain, Size: 633 bytes --]
On Wed, Aug 19, 2026 at 11:04:27AM +0530, Niranjan H Y wrote:
> The tac5xx2 RTD init does not populate card->components with the
> spk:<prefix> string. With this change, "amixer -D hw:<card> info"
> includes the spk identifier for each tac5xx2 speaker component,
> following the same pattern used by other codec families.
> + card->components = devm_kasprintf(card->dev, GFP_KERNEL,
> + "%s spk:%s", card->components,
> + dai->component->name_prefix);
> + if (!card->components)
> + return -ENOMEM;
See 0f60ecffbfe3 (ASoC: sdw_utils: generate combined spk components
string) for how other drivers do the same thing.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers
2026-08-19 13:46 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Mark Brown
@ 2026-08-20 5:06 ` Holalu Yogendra, Niranjan
0 siblings, 0 replies; 5+ messages in thread
From: Holalu Yogendra, Niranjan @ 2026-08-20 5:06 UTC (permalink / raw)
To: Mark Brown
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
ckeepax@opensource.cirrus.com, lgirdwood@gmail.com,
perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com,
peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com,
kai.vehmanen@linux.intel.com, pierre-louis.bossart@linux.dev,
Xu, Baojun, Ding, Shenghao, Kasargod, Sandeep,
Hampiholi, Vallabha
> On 19:17-20260819, Mark Brown wrote:
> Subject: Re: [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers
>
> > On Wed, Aug 19, 2026 at 11:04:26AM +0530, Niranjan H Y wrote:
>
> > - REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
> > - TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_LEFT), 0),
> > - REG_SEQ0(SDW_SDCA_CTL(TAC_FUNCTION_ID_SA, TAC_SDCA_ENT_FU23,
> > - TAC_SDCA_CHANNEL_GAIN, TAC_CHANNEL_RIGHT), 0),
>
> The new macros use _CHANEL_VOLUME and _MASTER_GAIN, there's none using _CHANNEL_GAIN?
This was intentional to drop CHANNEL_GAIN as it is found to be not required for FU23.
I think I will add cleaner fix in next patch. What we need really are
#define TAC_SDCA_MASTER_GAIN 0x0B ( should be probably renamed to *_CHANNEL_GAIN )
#define TAC_SDCA_CHANNEL_VOLUME 0x02
And need to drop the duplicate macro
#define TAC_SDCA_CHANNEL_GAIN 0x02
Regards
Niranjan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-20 5:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Niranjan H Y
2026-08-19 5:34 ` [PATCH v1 2/2] ASoC: sdw_utils: add spk component string for tac5xx2 family Niranjan H Y
2026-08-19 13:50 ` Mark Brown
2026-08-19 13:46 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: update default regmap registers Mark Brown
2026-08-20 5:06 ` Holalu Yogendra, Niranjan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox