Re: [PATCH v2 3/3] ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints()
From: Charles Keepax
Date: Fri Nov 06 2026 - 11:39:08 EST
On Fri, Nov 06, 2026 at 03:09:26PM +0000, Charles Keepax 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.
>
> Some minor additional refactoring is required since port constraints
> should be applied for both Input and Output Terminals, whereas
> currently Cluster constraints are only handled for Input Terminals.
>
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> ---
> + constraints->channels.count = ARRAY_SIZE(constraint_list);
> + constraints->channels.list = constraint_list;
> + constraints->channels.mask = cluster_ch_mask & port_ch_mask;
Sashiko is still concerned about if these two masks don't
overlap, resulting in a mask of 0 which allows all the options. I
think that seems valid so will add a check to fail here if there
is no overlap.
> + ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
> + SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
> + &constraints->width);
Sashiko is also concerned that SAMPLE_BITS is actually the
physical width (ie. memory size) of the sample which feels
sub-optimally named but does look like it checks out. So I
think we have to switch this to using HW_PARAM_FORMAT, but
will think it over.
Will do a spin for these updates early next week, unless I
hear any more by then.
Thanks,
Charles