Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, kuninori.morimoto.gx@renesas.com,
	sebastian.krzyszkowiak@puri.sm, brgl@kernel.org,
	patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com
Subject: Re: [PATCH] ASoC: wm8962: add .set_tdm_slot callback function
Date: Tue, 27 Jan 2026 11:03:00 +0000	[thread overview]
Message-ID: <aXibZNhIZI01tJyZ@opensource.cirrus.com> (raw)
In-Reply-To: <20260127103326.1920525-1-shengjiu.wang@nxp.com>

On Tue, Jan 27, 2026 at 06:33:26PM +0800, Shengjiu Wang wrote:
> The slot_width can be different with the params_width(), for example,
> DSP_A mode, slot_width = 32, but data format is S16_LE, if the word
> length is configured to be 16, there is no sound on the right speaker.
> 
> So add .set_tdm_slot() callback function to configure the slot_width and
> update the word length according to slot_width in hw_params().
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> +static int wm8962_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
> +			       unsigned int rx_mask, int slots, int slot_width)
> +{
> +	struct snd_soc_component *component = dai->component;
> +	struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component);
> +
> +	if (slots <= 0 || slot_width <= 0)
> +		return 0;

You probably shouldn't bail out here, how does one disable TDM if
it is no longer required?

I think the rest looks good.

Thanks,
Charles

  reply	other threads:[~2026-01-27 11:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 10:33 [PATCH] ASoC: wm8962: add .set_tdm_slot callback function Shengjiu Wang
2026-01-27 11:03 ` Charles Keepax [this message]
2026-01-27 13:01   ` Shengjiu Wang
2026-01-27 15:44     ` Charles Keepax

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=aXibZNhIZI01tJyZ@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=brgl@kernel.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=sebastian.krzyszkowiak@puri.sm \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.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