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

From: Shawn Guo

Date: Sat Oct 31 2026 - 04:17:15 EST


On Thu, Oct 29, 2026 at 10:59:25PM +0530, Prasad Kumpatla wrote:
> > diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> > index 9aae6aadd43d..f5b147962afa 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 PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
> > + case AIF_TDM_RX_0 ... AIF_TDM_TX_12: {
> > + struct qcom_snd_tdm_slot_cfg cpu_cfg, codec_cfg;
> > + unsigned int mask;
> > +
> > + if (qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg))
>
>
> qcom_snd_get_dai_tdm_slots() errors are silently ignored here and the channel count falls back to 2.
> Could we distinguish the no-TDM-slot case from an actual parsing/configuration error?
> This would also make invalid TDM configurations easier to debug.


Good point, Prasad! I will send v3 for that.

Shawn