* [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support
@ 2026-08-06 5:34 Niranjan H Y
2026-08-06 5:35 ` [PATCH v1 2/2] ASoC: tac5xx2-sdw: remove firmware check restriction Niranjan H Y
2026-08-06 16:11 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Niranjan H Y @ 2026-08-06 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
* HID interrupts: SDCA_12/SDCA_17 instead of was SDCA_11/SDCA_16 in
in older revision.
* UAJ port prepare: write 0xff (jack connected) or 0xdf (disconnected)
This is required to solve the channel prepare timeout error during
boot time with the 0x30 silicon.
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
---
sound/soc/codecs/tac5xx2-sdw.c | 58 ++++++++++++++++++++++++++++++----
1 file changed, 51 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/tac5xx2-sdw.c b/sound/soc/codecs/tac5xx2-sdw.c
index ace06f5ab..8fedb5292 100644
--- a/sound/soc/codecs/tac5xx2-sdw.c
+++ b/sound/soc/codecs/tac5xx2-sdw.c
@@ -88,6 +88,9 @@
#define TAC_FW_FILE_HDR 20
#define TAC_MAX_FW_CHUNKS 512
+#define TAC_UAJ_PREP_CONNECTED 0xff
+#define TAC_UAJ_PREP_DISCONNECTED 0xdf
+
struct tac_fw_hdr {
u32 size;
u32 version_offset;
@@ -138,6 +141,7 @@ struct tac5xx2_prv {
bool hw_init;
bool first_hw_init_done;
u32 part_id;
+ u32 rev_id;
struct snd_soc_jack *hs_jack;
int jack_type;
/* Custom fw binary. UMP File Download is not used. */
@@ -261,7 +265,6 @@ static const struct reg_default tac_reg_default[] = {
{TAC_REG_SDW(0, 0, 0x78), 0x0},
{TAC_REG_SDW(0, 0, 0x7b), 0x0},
{TAC_REG_SDW(0, 0, 0x7c), 0xd0},
- {TAC_REG_SDW(0, 0, 0x7d), 0x0},
{TAC_REG_SDW(0, 0, 0x7e), 0x0},
{TAC_REG_SDW(0, 1, 0x1), 0x0},
{TAC_REG_SDW(0, 1, 0x2), 0x0},
@@ -942,6 +945,7 @@ static int tac5xx2_sdca_button_detect(struct tac5xx2_prv *tac_dev)
static int tac5xx2_sdca_headset_detect(struct tac5xx2_prv *tac_dev)
{
int val, ret;
+ u8 jack_prep;
ret = regmap_read(tac_dev->regmap,
SDW_SDCA_CTL(TAC_FUNCTION_ID_UAJ, TAC_SDCA_ENT_GE35,
@@ -951,6 +955,8 @@ static int tac5xx2_sdca_headset_detect(struct tac5xx2_prv *tac_dev)
return ret;
}
+ jack_prep = TAC_UAJ_PREP_CONNECTED;
+
switch (val) {
case 4:
tac_dev->jack_type = SND_JACK_MICROPHONE;
@@ -964,6 +970,7 @@ static int tac5xx2_sdca_headset_detect(struct tac5xx2_prv *tac_dev)
case 0:
default:
tac_dev->jack_type = 0;
+ jack_prep = TAC_UAJ_PREP_DISCONNECTED;
break;
}
@@ -973,26 +980,44 @@ static int tac5xx2_sdca_headset_detect(struct tac5xx2_prv *tac_dev)
if (ret)
dev_err(tac_dev->dev, "Failed to update the jack type to device");
+ /*
+ * When uaj is uplugged and booted, we end up with the channel prepare
+ * timeout error for the uaj ports. This writes allows the channel prepare
+ * to succeed when the uaj is not plugged in.
+ */
+ if (tac_dev->rev_id >= 0x30) {
+ ret = regmap_write(tac_dev->regmap, TAC_REG_SDW(0, 3, 127), jack_prep);
+ if (ret)
+ dev_warn(tac_dev->dev, "Failed to write jack_prep register: %d\n", ret);
+ }
+
return 0;
}
static int tac5xx2_jack_init(struct tac5xx2_prv *tac_dev)
{
+ u32 jd_int_mask, hid_int_mask;
int ret = 0;
+ if (tac_dev->rev_id >= 0x30) {
+ jd_int_mask = SDW_SCP_SDCA_INTMASK_SDCA_12;
+ hid_int_mask = SDW_SCP_SDCA_INTMASK_SDCA_17;
+ } else {
+ jd_int_mask = SDW_SCP_SDCA_INTMASK_SDCA_11;
+ hid_int_mask = SDW_SCP_SDCA_INTMASK_SDCA_16;
+ }
+
if (!tac_dev->hs_jack)
goto disable_interrupts;
- ret = regmap_write(tac_dev->regmap, SDW_SCP_SDCA_INTMASK2,
- SDW_SCP_SDCA_INTMASK_SDCA_11);
+ ret = regmap_write(tac_dev->regmap, SDW_SCP_SDCA_INTMASK2, jd_int_mask);
if (ret) {
dev_err(tac_dev->dev,
"Failed to register jack detection interrupt: %d\n", ret);
goto disable_interrupts;
}
- ret = regmap_write(tac_dev->regmap, SDW_SCP_SDCA_INTMASK3,
- SDW_SCP_SDCA_INTMASK_SDCA_16);
+ ret = regmap_write(tac_dev->regmap, SDW_SCP_SDCA_INTMASK3, hid_int_mask);
if (ret) {
dev_err(tac_dev->dev,
"Failed to register for button detect interrupt: %d\n", ret);
@@ -1051,6 +1076,7 @@ static int tac_interrupt_callback(struct sdw_slave *slave,
unsigned int sdca_int2, sdca_int3, jack_report_mask = 0;
struct tac5xx2_prv *tac_dev = dev_get_drvdata(&slave->dev);
struct device *dev = &slave->dev;
+ u32 headset_detect_chk, hid_detect_chk;
int btn_type = 0;
int ret = 0;
@@ -1081,14 +1107,22 @@ static int tac_interrupt_callback(struct sdw_slave *slave,
dev_dbg(dev, "SDCA_INT2: 0x%02x, SDCA_INT3: 0x%02x\n",
sdca_int2, sdca_int3);
- if (sdca_int2 & SDW_SCP_SDCA_INT_SDCA_11) {
+ if (tac_dev->rev_id >= 0x30) {
+ headset_detect_chk = SDW_SCP_SDCA_INT_SDCA_12;
+ hid_detect_chk = SDW_SCP_SDCA_INT_SDCA_17;
+ } else {
+ headset_detect_chk = SDW_SCP_SDCA_INT_SDCA_11;
+ hid_detect_chk = SDW_SCP_SDCA_INT_SDCA_16;
+ }
+
+ if (sdca_int2 & headset_detect_chk) {
ret = tac5xx2_sdca_headset_detect(tac_dev);
if (ret < 0)
goto clear;
jack_report_mask |= SND_JACK_HEADSET;
}
- if (sdca_int3 & SDW_SCP_SDCA_INT_SDCA_16) {
+ if (sdca_int3 & hid_detect_chk) {
btn_type = tac5xx2_sdca_button_detect(tac_dev);
if (btn_type < 0)
btn_type = 0;
@@ -1695,6 +1729,15 @@ static int tac_io_init(struct device *dev, struct sdw_slave *slave, bool first)
goto io_init_err;
}
+ if (!tac_dev->rev_id) {
+ ret = regmap_read(tac_dev->regmap, TAC_REV_ID, &tac_dev->rev_id);
+ if (ret) {
+ dev_err(tac_dev->dev, "failed to rev id, err=%d\n", ret);
+ goto io_init_err;
+ }
+ dev_dbg(tac_dev->dev, "detected rev_id 0x%x", tac_dev->rev_id);
+ }
+
if (tac_dev->fw_files && tac_dev->fw_file_cnt > 0) {
ret = tac_download_fw_to_hw(tac_dev);
if (ret) {
@@ -1959,6 +2002,7 @@ static s32 tac_sdw_probe(struct sdw_slave *peripheral,
tac_dev->hw_init = false;
tac_dev->first_hw_init_done = false;
tac_dev->part_id = id->part_id;
+ tac_dev->rev_id = 0x0;
dev_set_drvdata(dev, tac_dev);
regmap = devm_regmap_init_sdw_mbq_cfg(&peripheral->dev, peripheral,
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v1 2/2] ASoC: tac5xx2-sdw: remove firmware check restriction
2026-08-06 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Niranjan H Y
@ 2026-08-06 5:35 ` Niranjan H Y
2026-08-06 16:11 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Niranjan H Y @ 2026-08-06 5:35 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
Firmware support should be available for all the
devices in the family so that basic pre-processing
blocks can be tuned with the firmware if it is
available.
Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
---
sound/soc/codecs/tac5xx2-sdw.c | 26 +++++---------------------
1 file changed, 5 insertions(+), 21 deletions(-)
diff --git a/sound/soc/codecs/tac5xx2-sdw.c b/sound/soc/codecs/tac5xx2-sdw.c
index 8fedb5292..30cab16de 100644
--- a/sound/soc/codecs/tac5xx2-sdw.c
+++ b/sound/soc/codecs/tac5xx2-sdw.c
@@ -510,18 +510,6 @@ static const struct regmap_config tac_regmap = {
.use_single_write = true,
};
-/* Check if device has DSP algo that needs status monitoring */
-static bool tac_has_dsp_algo(struct tac5xx2_prv *tac_dev)
-{
- switch (tac_dev->part_id) {
- case 0x5682:
- case 0x2883:
- return true;
- default:
- return false;
- }
-}
-
/* Check if device has UAJ (Universal Audio Jack) support */
static bool tac_has_uaj_support(struct tac5xx2_prv *tac_dev)
{
@@ -2016,17 +2004,13 @@ static s32 tac_sdw_probe(struct sdw_slave *peripheral,
tac_dev->jack_type = 0;
init_completion(&tac_dev->fw_caching_complete);
- if (tac_has_dsp_algo(tac_dev)) {
- tac_generate_fw_name(peripheral, tac_dev->fw_binaryname,
- sizeof(tac_dev->fw_binaryname));
+ tac_generate_fw_name(peripheral, tac_dev->fw_binaryname,
+ sizeof(tac_dev->fw_binaryname));
- ret = tac_load_and_cache_firmware_async(tac_dev);
- if (ret) {
- complete_all(&tac_dev->fw_caching_complete);
- dev_dbg(dev, "failed to load fw: %d, use rom mode\n", ret);
- }
- } else {
+ ret = tac_load_and_cache_firmware_async(tac_dev);
+ if (ret) {
complete_all(&tac_dev->fw_caching_complete);
+ dev_dbg(dev, "failed to load fw: %d, use rom mode\n", ret);
}
ret = tac_init(tac_dev);
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support
2026-08-06 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Niranjan H Y
2026-08-06 5:35 ` [PATCH v1 2/2] ASoC: tac5xx2-sdw: remove firmware check restriction Niranjan H Y
@ 2026-08-06 16:11 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-06 16:11 UTC (permalink / raw)
To: linux-sound, Niranjan H Y
Cc: 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
On Thu, 06 Aug 2026 11:04:59 +0530, Niranjan H Y wrote:
> ASoC: tac5xx2-sdw: add rev_id 0x30 support
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support
https://git.kernel.org/broonie/sound/c/dac366eb036e
[2/2] ASoC: tac5xx2-sdw: remove firmware check restriction
https://git.kernel.org/broonie/sound/c/92dd0ba8ac4b
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-06 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06 5:34 [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Niranjan H Y
2026-08-06 5:35 ` [PATCH v1 2/2] ASoC: tac5xx2-sdw: remove firmware check restriction Niranjan H Y
2026-08-06 16:11 ` [PATCH v1 1/2] ASoC: tac5xx2-sdw: add rev_id 0x30 support Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®