Re: [PATCH v3 17/20] ASoC: dt-bindings: tas2770: add flags for SDOUT pulldown and zero-fill
From: James Calligeros
Date: Mon Mar 10 2025 - 05:30:27 EST
On Sat, Mar 8, 2025 at 6:51 AM Rob Herring <robh@xxxxxxxxxx> wrote:
> How would it work when you need a mask? "dai-tdm-slot-tx-mask" is
> enough?
The existing TX/RX slot masks are used to control which slots the codec
is operating on, AIUI. I don't know if it makes sense to alter how codecs
deal with this. Could we combine the suggested dai-tdm-slot-tx-idle
with an optional dai-tdm-slot-tx-idle-mask property? From the machine
driver's perspective, the API would then be similar to the existing
set_tdm_slot ops. The current downstream macaudio machine driver builds
its links by allowing multiple codecs and CPUs to be linked to a DAI,
like so:
dai-link@0 {
cpu {
sound-dai = <&cpu0>, <&cpu1>;
};
codec {
sound-dai = <&speaker0>,
...,
<&speaker6>;
};
};
In this case, the codec-specific mask property was added so that a mask
could be applied to a specific codec rather than the whole dai, however
from upstream drivers tt looks like the way this should be handled is to
have "dai-tdm-slot-tx-idle-mask-n" properties at the dai level, then have
the machine driver set the mask for the appropriate codec during setup. So
for macaudio, assuming speaker5 requires this zerofill mask, we would
have something like this:
dai-link@0 {
cpu {
sound-dai = <&cpu0>, <&cpu1>;
};
codec {
sound-dai = <&speaker0>,
...,
<&speaker6>;
};
/* equivalent to ti,sdout-force-zero-mask = <0xf0f0f0> */
dai-tdm-slot-tx-idle-mode-5 = "zerofill";
/* should this be an array like the slot masks? */
dai-tdm-slot-tx-idle-mask-5 = <0xf0f0f0>;
};
The machine driver then calls something like
snd_soc_dai_set_tdm_idle(speaker5_dai, SND_SOC_TDM_IDLE_MODE_ZEROFILL,
SND_SOC_TDM_IDLE_MODE_NONE, tx_idle_mask, 0);
and the codec driver deals with it however it needs to.
Regards,
James