From: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
To: Shawn Guo <shengchao.guo@oss.qualcomm.com>,
Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: qcom: sc8280xp: Derive TDM channels from DT mask
Date: Wed, 21 Oct 2026 10:55:42 +0530 [thread overview]
Message-ID: <679f383a-97a1-4505-8bd9-73ef76bc0d87@oss.qualcomm.com> (raw)
In-Reply-To: <20261021025310.2072026-1-shengchao.guo@oss.qualcomm.com>
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@oss.qualcomm.com>
> ---
> 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:
Best Regards,
Rafi
> + 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))
> + break;
> +
> + /* Same slot mask selection as q6tdm_set_tdm_slot() */
> + mask = (cpu_dai->id & 0x1) ? cpu_cfg.tx_mask : cpu_cfg.rx_mask;
> + if (mask) {
> + channels->min = hweight32(mask);
> + channels->max = channels->min;
> + }
> + break;
> + }
> case TX_CODEC_DMA_TX_0:
> case TX_CODEC_DMA_TX_1:
> case TX_CODEC_DMA_TX_2:
prev parent reply other threads:[~2026-10-21 5:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 2:53 Shawn Guo
2026-10-21 5:25 ` Mohammad Rafi Shaik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=679f383a-97a1-4505-8bd9-73ef76bc0d87@oss.qualcomm.com \
--to=mohammad.rafi.shaik@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shengchao.guo@oss.qualcomm.com \
--cc=srini@kernel.org \
--cc=tiwai@suse.com \
--cc=zhangfei.gao@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®