From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: broonie@kernel.org, lgirdwood@gmail.com,
yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH 2/2] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints()
Date: Fri, 6 Nov 2026 09:28:37 +0000 [thread overview]
Message-ID: <au2dxajs3ua9M61q@opensource.cirrus.com> (raw)
In-Reply-To: <1cae1b17-4c49-4a10-922e-c552e90593c4@linux.dev>
On Thu, Nov 05, 2026 at 08:49:43PM +0100, Pierre-Louis Bossart wrote:
>
> > +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)
> > +{
> > + struct sdw_dpn_prop *prop;
> > + unsigned int nprop;
> > + int i, j;
> > +
> > + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> > + prop = sdw->prop.sink_dpn_prop;
> > + nprop = hweight32(sdw->prop.sink_ports);
> > + } else {
> > + prop = sdw->prop.src_dpn_prop;
> > + nprop = hweight32(sdw->prop.source_ports);
> > + }
>
> The definition of those DisCo properties was done with separate masks
> for source and sinks, but it's allowed to have the same bit set for
> source and sink if the port supports bi-directional transfers.
>
> I don't think it impacts the way the constraints are added, since you
> use substream->stream direction to disambiguate, but I thought I'd ask
> the question.
Yeah I think this mostly all works out. ALSA separates the capture
and playback streams, and this stuff is called from the DAI ops.
>
> > - if (entity->type != SDCA_ENTITY_TYPE_IT)
> > - return 0;
> > + /* FIXME: Currently only a single unshared port is supported */
>
> I must admit I have no idea how we'd handle ports that can be connected
> to multiple terminals. It's allowed in the spec, even between Functions
> which are then no longer independent, and I was told it was due to
> hardware restrictions, but still I hope we never have to deal with this...
lol yeah me too. For now I am mostly just putting these FIXME's
in at all the places where this is going to become relevant. I
must confess I haven't reviewed this part of the spec in detail.
It feels like sharing a couple of ports for a single terminal is
probably tractable if a little annoying. But yeah, if we got as
far as sharing a port across functions that seems like a total
nightmare. We would probably need to do a bit of re-architecting
and add a port abstraction at the device level, but hopefully
people are wise enough to not build hardware like that.
Thanks,
Charles
next prev parent reply other threads:[~2026-11-06 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 13:49 [PATCH 0/2] Add SoundWire port constraints into SDCA stream Charles Keepax
2026-11-05 13:49 ` [PATCH 1/2] ASoC: SDCA: Factor out helper for creating mask of Cluster channels Charles Keepax
2026-11-05 13:49 ` [PATCH 2/2] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints() Charles Keepax
2026-11-05 14:11 ` sashiko-bot
2026-11-05 14:27 ` Charles Keepax
2026-11-05 19:49 ` Pierre-Louis Bossart
2026-11-06 9:28 ` Charles Keepax [this message]
2026-11-06 12:19 ` Pierre-Louis Bossart
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=au2dxajs3ua9M61q@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.