All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com
Subject: Re: [PATCH v3] ASoC: wm8524: enable constraints when sysclk is configured.
Date: Fri, 20 Jun 2025 17:01:55 +0100	[thread overview]
Message-ID: <aFWF84HMipnQTOxs@opensource.cirrus.com> (raw)
In-Reply-To: <aFVXLMtEOuXFL8B-@finisterre.sirena.org.uk>

On Fri, Jun 20, 2025 at 01:42:20PM +0100, Mark Brown wrote:
> On Fri, Jun 20, 2025 at 09:42:58AM +0100, Charles Keepax wrote:
> > On Fri, Jun 20, 2025 at 09:26:00AM +0100, Charles Keepax wrote:
> 
> > > This is kinda the opposite of what I was hoping we could do. The
> > > idea was to make sure we returned an error if we can't support
> > > the given rate. So if we don't have the constraint, we check the
> > > value in hw_params. This looks like it checks in hw_params only
> > > in the case the constraint existed, but in that case there is no
> > > need to check because we had the constraint.
> 
> > Although perhaps I am mistaken here, I guess is the clock has
> > been set by the machine driver then we would pass this check.
> > Would it perhaps make more sense to return an error rather than
> > zero here?
> 
> The link hw_params() should be run before the CODEC ones so we would be
> able to insist on the clocks having been configured first.  
> 
> Or I wonder if it might be easier to just implement clock API support in
> the driver and if we get a MCLK we set it to a sensible value here?
> That wouldn't work if the MCLK is coming from the other DAI though.
> Also I'm really not sure how this bikeshed fits into the design concept
> here.

I think clock framework stuff is probably more work than makes
sense here.

If you are happy with this as is I don't object to it getting
merged, ultimately if the machine driver doesn't configure the
clock that is a bug in the machine driver and it will likely be
relatively obvious audibily so the returning an error is really
just a nice to have.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

  reply	other threads:[~2025-06-20 16:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  2:14 [PATCH v3] ASoC: wm8524: enable constraints when sysclk is configured Shengjiu Wang
2025-06-20  8:26 ` Charles Keepax
2025-06-20  8:42   ` Charles Keepax
2025-06-20 12:42     ` Mark Brown
2025-06-20 16:01       ` Charles Keepax [this message]
2025-06-24  8:24         ` Shengjiu Wang
2025-06-25 14:36 ` Mark Brown

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=aFWF84HMipnQTOxs@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=perex@perex.cz \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.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.