From: John Watts <contact@jookia.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
patches@opensource.cirrus.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] ASoC: wm8782: Handle maximum audio rate at runtime
Date: Thu, 14 Sep 2023 19:27:03 +1000 [thread overview]
Message-ID: <ZQLR50CAzr0VDpeh@titan> (raw)
In-Reply-To: <20230914092107.GR103419@ediswmail.ad.cirrus.com>
On Thu, Sep 14, 2023 at 09:21:07AM +0000, Charles Keepax wrote:
> On Thu, Sep 14, 2023 at 03:15:50AM +1000, John Watts wrote:
> > The wm8782 supports up to 192kHz audio when pins are set correctly.
> > Instead of hardcoding which rates are supported enable them all
> > then refer to a max_rate variable at runtime.
> >
> > Signed-off-by: John Watts <contact@jookia.org>
> > ---
> > +static int wm8782_dai_hw_params(struct snd_pcm_substream *component,
> > + struct snd_pcm_hw_params *params,
> > + struct snd_soc_dai *dai)
> > +{
> > + struct wm8782_priv *priv =
> > + snd_soc_component_get_drvdata(dai->component);
> > +
> > + if (params_rate(params) > priv->max_rate)
> > + return -EINVAL;
> > +
> > + return 0;
> > +}
>
> We should be setting this as a constraint in startup, rather
> than returning an error in hw_params. That will let user-space
> know the supported rates and allow it to resample if necessary.
How do you do this? The struct with the rate is statically defined.
>
> Thanks,
> Charles
John.
next prev parent reply other threads:[~2023-09-14 9:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 17:15 [PATCH v2 0/3] ASoC: wm8782: Allow higher audio rates John Watts
2023-09-13 17:15 ` [PATCH v2 1/3] ASoC: wm8782: Handle maximum audio rate at runtime John Watts
2023-09-14 9:21 ` Charles Keepax
2023-09-14 9:27 ` John Watts [this message]
2023-09-14 9:37 ` Charles Keepax
2023-09-14 9:44 ` Charles Keepax
2023-09-13 17:15 ` [PATCH v2 2/3] ASoC: wm8782: Use wlf,fsampen device tree property John Watts
2023-09-13 17:15 ` [PATCH v2 3/3] ASoC: dt-bindings: wlf,wm8782: Add wlf,fsampen property John Watts
2023-09-14 14:52 ` Rob Herring
2023-09-15 5:39 ` John Watts
2023-09-15 11:05 ` 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=ZQLR50CAzr0VDpeh@titan \
--to=contact@jookia.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--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.