mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
	pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH v2 3/3] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints()
Date: Mon, 9 Nov 2026 12:52:42 +0000	[thread overview]
Message-ID: <avHCGt1WfQsP7qjy@opensource.cirrus.com> (raw)
In-Reply-To: <179413707633.3630016.13654136728294242171.b4-review@b4>

On Sun, Nov 08, 2026 at 11:24:36AM +0000, Mark Brown wrote:
> > Currently the SDCA code constrains the params based on the DisCo for
> > the SDCA Terminal used. However, it ignores the properties of the
> > SoundWire port, which in some cases may further constrain the allowed
> > params. Add additional constraints to apply these restrictions.
> 
> 
> > +static int get_port_masks(struct sdw_slave *sdw, unsigned int port,
> > +			  struct snd_pcm_substream *substream,
> > +			  unsigned int *word_mask, unsigned int *ch_mask)
> > +{
> 
> > +
> > +	for (i = 0; i < nprop; i++) {
> > +		if (prop[i].num != port)
> > +			continue;
> > +
> > +		if (prop[i].num_words) {
> > +			for (j = 0; j < prop[i].num_words; j++)
> > +				*word_mask |= BIT(prop[i].words[j] - 1);
> 
> The shifting would be broken if there were ever any 32 bit Soundwire
> systems, and I guess we might get warnings on coverage builds.

The minus one should cover us for up to 32-bit audio, although
technically the soundwire spec does allow upto 64-bit audio.
Pretty niche but I will add an if to skip things if the bit
depth is too big probably better to be safe.

Thanks,
Charles

      reply	other threads:[~2026-11-09 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 15:09 [PATCH v2 0/3] Add SoundWire port constraints into SDCA stream Charles Keepax
2026-11-06 15:09 ` [PATCH v2 1/3] ASoC: SDCA: Move DAI constraint allocation Charles Keepax
2026-11-06 15:09 ` [PATCH v2 2/3] ASoC: SDCA: Factor out helper for creating mask of Cluster channels Charles Keepax
2026-11-06 15:09 ` [PATCH v2 3/3] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints() Charles Keepax
2026-11-06 16:35   ` Charles Keepax
2026-11-08 11:24   ` Mark Brown
2026-11-09 12:52     ` Charles Keepax [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=avHCGt1WfQsP7qjy@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=yung-chuan.liao@linux.intel.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®