Re: [PATCH v2 2/2] soundwire: Assume default maximum valid channel if not specified
From: Charles Keepax
Date: Tue Nov 10 2026 - 10:44:56 EST
On Tue, Nov 10, 2026 at 03:30:43PM +0100, Pierre-Louis Bossart wrote:
> On 11/10/26 12:38, Charles Keepax wrote:
> > + fwnode_property_read_u32(node, "mipi-sdw-min-channel-number",
> > + &dpn[i].min_ch);
> > +
> > + ret = fwnode_property_read_u32(node, "mipi-sdw-max-channel-number",
> > + &dpn[i].max_ch);
> > + if (ret && !dpn[i].num_channels)
> > + dpn[i].max_ch = 7;
> > +
>
> this works, maybe with one possible improvement: in theory if
> "mipi-sdw-channel-number-list" is defined one can ignore the min/max,
> the two approaches with the list or min/max are mutually exclusive.
>
> Something like this:
>
> if (!dpn[i].num_channels) {
> fwnode_property_read_u32(node, "mipi-sdw-min-channel-number",
> &dpn[i].min_ch);
> ret = fwnode_property_read_u32(node, "mipi-sdw-max-channel-number",
> &dpn[i].max_ch);
> if (ret)
> dpn[i].max_ch = 7;
> }
I am happy to do so if you feel strongly. However, the spec
doesn't really appear to rule out both being present, it does
imply that the channel list takes precedence. But given it
doesn't rule out having both, I quite like parsing both and
allowing the driver to make a decision about what to do with
that information.
Thanks,
Charles