[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251209-tdm-idle-slots-v1-4-38dabf6bc01e@gmail.com>
Date: Tue, 09 Dec 2025 19:31:17 +1000
From: James Calligeros <jcalligeros99@...il.com>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Shengjiu Wang <shengjiu.wang@....com>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Shenghao Ding <shenghao-ding@...com>,
Kevin Lu <kevin-lu@...com>, Baojun Xu <baojun.xu@...com>
Cc: linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, asahi@...ts.linux.dev,
James Calligeros <jcalligeros99@...il.com>
Subject: [PATCH 4/7] ASoC: soc-dai: define TDM idle behaviour modes
Some audio devices, such as certain Texas Instruments codecs,
include configurable bus keepers.
Imagine for example two codecs sharing a bus. When one codec is
transmitting, the other must ensure that it is holding its side
to 0, or data from the transmitting codec will be corrupted. We
can trust the "idle" codec to simply do this itself, however
this is undefined behaviour. Some devices may leave the line
floating, others still may pull the line high. We need a way to
control this behaviour.
Thus, we define five possible bus-keeping modes that a device can
be in: NONE (UB/as initialised), OFF (explicitly disabled), ZERO
(actively transmit a 0), PULLDOWN, and HIZ (floating).
These will be consumed by CODEC/CPU drivers via a common DAI
op, enabling the explicit configuration of bus keepers where
required.
Signed-off-by: James Calligeros <jcalligeros99@...il.com>
---
include/sound/soc-dai.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 224396927aef..a5784ef8e3f7 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -52,6 +52,19 @@ struct snd_compr_stream;
#define SND_SOC_POSSIBLE_DAIFMT_AC97 (1 << SND_SOC_DAI_FORMAT_AC97)
#define SND_SOC_POSSIBLE_DAIFMT_PDM (1 << SND_SOC_DAI_FORMAT_PDM)
+/*
+ * DAI TDM slot idle modes
+ *
+ * Describes a CODEC/CPU's behaviour when not actively receiving or
+ * transmitting on a given TDM slot. NONE is undefined behaviour.
+ * Add new modes to the end.
+ */
+#define SND_SOC_DAI_TDM_IDLE_NONE 0
+#define SND_SOC_DAI_TDM_IDLE_OFF 1
+#define SND_SOC_DAI_TDM_IDLE_ZERO 2
+#define SND_SOC_DAI_TDM_IDLE_PULLDOWN 3
+#define SND_SOC_DAI_TDM_IDLE_HIZ 4
+
/*
* DAI Clock gating.
*
--
2.52.0
Powered by blists - more mailing lists