From: sashiko-bot@kernel.org
To: "David Heidelberg" <david@ixit.cz>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/8] ASoC: qcom: sdm845: Demystify TDM masks a bit
Date: Thu, 24 Sep 2026 12:55:58 +0000 [thread overview]
Message-ID: <20260924125559.2B7811F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260924-pixel3-audio-v3-1-5d06460fc8a9@ixit.cz>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] sdm845: MIC_TDM_RX_MASK incorrectly implies microphone receives data
--
commit 0baf5b5f350c1d7b76ce347afed1d60796da5d93
Author: David Heidelberg <david@ixit.cz>
ASoC: qcom: sdm845: Demystify TDM masks a bit
Describe the mask with the bits used for each RX/TX.
> diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c
> index 6843ab8ba017e..0ce8265ab1c1f 100644
> --- a/sound/soc/qcom/sdm845.c
> +++ b/sound/soc/qcom/sdm845.c
> @@ -23,9 +23,14 @@
> #define DEFAULT_MCLK_RATE 24576000
> #define TDM_BCLK_RATE 6144000
> #define MI2S_BCLK_RATE 1536000
> -#define LEFT_SPK_TDM_TX_MASK 0x30
> -#define RIGHT_SPK_TDM_TX_MASK 0xC0
> -#define SPK_TDM_RX_MASK 0x03
> +#define LEFT_SPK_TDM_RX_MASK BIT(0)
> +#define RIGHT_SPK_TDM_RX_MASK BIT(1)
> +#define SPK_TDM_RX_MASK (LEFT_SPK_TDM_RX_MASK | RIGHT_SPK_TDM_RX_MASK)
> +#define MIC1_TDM_RX_MASK BIT(2)
> +#define MIC2_TDM_RX_MASK BIT(3)
> +#define MIC_TDM_RX_MASK (MIC1_TDM_RX_MASK | MIC2_TDM_RX_MASK)
[Severity: Low]
Does this naming convention accurately reflect the data direction?
The file appears to establish a peripheral-centric naming convention, where
SPK_TDM_RX_MASK is used for playback (speaker receives) and
LEFT_SPK_TDM_TX_MASK is used for IV sense (speaker transmits).
By this convention, since a microphone is an input device that transmits data
to the SoC, using an RX mask implies the microphone is receiving data. Would
it be more accurate to name these microphone slots MIC_TDM_TX_MASK to align
with the physical direction of the data flow?
> +#define LEFT_SPK_TDM_TX_MASK (BIT(4) | BIT(5))
> +#define RIGHT_SPK_TDM_TX_MASK (BIT(6) | BIT(7))
> #define NUM_TDM_SLOTS 8
[ ... ]
> @@ -128,8 +133,10 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
> goto end;
> }
> } else {
> - ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xf, 0,
> - 8, slot_width);
> + ret = snd_soc_dai_set_tdm_slot(cpu_dai,
> + SPK_TDM_RX_MASK |
> + MIC_TDM_RX_MASK, 0,
[Severity: Low]
Is this using the correct mask name for the CPU capture path?
This forms the CPU capture mask using the inappropriately named
MIC_TDM_RX_MASK, which contradicts the commit's stated intent to clarify
RX/TX directions. Could this be updated to use a TX mask instead?
> + NUM_TDM_SLOTS, slot_width);
> if (ret < 0) {
> dev_err(rtd->dev, "%s: failed to set tdm slot, err:%d\n",
> __func__, ret);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924-pixel3-audio-v3-0-5d06460fc8a9@ixit.cz?part=1
next prev parent reply other threads:[~2026-09-24 12:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:46 [PATCH v3 0/8] Speakers for Pixel 3 / 3 XL David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 1/8] ASoC: qcom: sdm845: Demystify TDM masks a bit David Heidelberg via B4 Relay
2026-09-24 12:55 ` sashiko-bot [this message]
2026-09-24 12:46 ` [PATCH v3 2/8] ASoC: qcom: sdm845: use DSP_A format for TDM codec DAIs David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 3/8] ASoC: qcom: sdm845: Use per-speaker RX masks for TDM slot assignment David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 4/8] ASoC: qcom: sdm845: Set codec dai and component sysclk during startup David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 5/8] ASoC: cs35l36: Implement set_tdm_slot to program RX and TX slots David Heidelberg via B4 Relay
2026-09-24 13:03 ` sashiko-bot
2026-09-24 12:46 ` [PATCH v3 6/8] arm64: dts: qcom: sdm845-google: Add basic audio support David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 7/8] slimbus: qcom-ngd-ctrl: Remove data channels on stream disable David Heidelberg via B4 Relay
2026-09-24 12:46 ` [PATCH v3 8/8] arm64: dts: qcom: sdm845-google: Add WCD9340 codec and microphone capture David Heidelberg via B4 Relay
2026-09-24 13:04 ` [PATCH v3 0/8] Speakers for Pixel 3 / 3 XL Mark Brown
2026-09-24 13:25 ` David Heidelberg
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=20260924125559.2B7811F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=david@ixit.cz \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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