Re: [PATCH] ASoC: qcom: sc8280xp: Derive TDM channels from DT mask

From: Shawn Guo

Date: Wed Oct 28 2026 - 22:13:53 EST


On Wed, Oct 21, 2026 at 10:55:42AM +0530, Mohammad Rafi Shaik wrote:
>
>
> On 10/21/2026 8:23 AM, Shawn Guo wrote:
> > Derive the AIF_TDM_RX_8 and AIF_TDM_TX_8 backend channel count from
> > the cpu DAI TDM slot mask in the DT, using the same tx/rx mask
> > selection as q6tdm_set_tdm_slot(). Each board then gets the channel
> > count its dai-link describes, e.g. 4/4 on Nord RRD, 6/4 on RIDE.
> > Keep the default of two when the link has no TDM slot description.
> >
> > Signed-off-by: Shawn Guo <shengchao.guo@xxxxxxxxxxxxxxxx>
> > ---
> > sound/soc/qcom/sc8280xp.c | 16 ++++++++++++++++
> > 1 file changed, 16 insertions(+)
> >
> > diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> > index 9aae6aadd43d..f3fb13145b3b 100644
> > --- a/sound/soc/qcom/sc8280xp.c
> > +++ b/sound/soc/qcom/sc8280xp.c
> > @@ -303,6 +303,22 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
> > channels->min = 2;
> > channels->max = 2;
> > switch (cpu_dai->id) {
> > + case AIF_TDM_RX_8:
> > + case AIF_TDM_TX_8: {
>
> This should not be limited to AIF_TDM_RX_8/AIF_TDM_TX_8.
>
> Enable it for all TDM DAI IDs.
>
> case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
> case AIF_TDM_RX_0 ... AIF_TDM_TX_12:

Ack, will cover both PRIMARY..QUINARY and AIF_TDM ranges in v2,
matching q6tdm_set_tdm_slot().

Shawn