All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: vkoul@kernel.org, yung-chuan.liao@linux.intel.com,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH v2 2/2] soundwire: Assume default maximum valid channel if not specified
Date: Wed, 11 Nov 2026 09:26:43 +0000	[thread overview]
Message-ID: <avQ009LpCFfgDfBl@opensource.cirrus.com> (raw)
In-Reply-To: <c477aed9-6b9c-4db1-8549-e1a407f55e43@linux.dev>

On Tue, Nov 10, 2026 at 06:11:13PM +0100, Pierre-Louis Bossart wrote:
> On 11/10/26 16:08, Charles Keepax wrote:
> > 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.
> humm, the wording "Conditions: If Property mipi-sdw-channel-number-list
> is present, then this [mipi-sdw-max-channel-number ]Property shall not
> be present" is pretty strong.
> 
> I don't mind keeping your existing code but then we'd need to add a
> comment to say that we discarded the 'shall' to cover potentially broken
> cases.

Nah, its cool I will update the code as you suggest. Should be
able to get a spin out later today.

Thanks,
Charles

      reply	other threads:[~2026-11-11  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 11:38 [PATCH v2 0/2] Update handling of min and max channel in DisCo Charles Keepax
2026-11-10 11:38 ` [PATCH v2 1/2] soundwire: Improve channel min/max comments Charles Keepax
2026-11-10 11:38 ` [PATCH v2 2/2] soundwire: Assume default maximum valid channel if not specified Charles Keepax
2026-11-10 14:30   ` Pierre-Louis Bossart
2026-11-10 15:08     ` Charles Keepax
2026-11-10 17:11       ` Pierre-Louis Bossart
2026-11-11  9:26         ` 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=avQ009LpCFfgDfBl@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.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=vkoul@kernel.org \
    --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.