Re: [PATCH 2/2] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints()

From: Pierre-Louis Bossart

Date: Thu Nov 05 2026 - 15:20:37 EST



> +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.

> - 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...