From: Lars-Peter Clausen <lars@metafoo.de>
To: Ricard Wanderlof <ricard.wanderlof@axis.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: ics43432: Add codec driver for InvenSense ICS-43432
Date: Thu, 13 Aug 2015 16:57:06 +0200 [thread overview]
Message-ID: <55CCB042.7090100@metafoo.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1508131428310.27635@lnxricardw1.se.axis.com>
On 08/13/2015 03:55 PM, Ricard Wanderlof wrote:
> +
> +#define ICS43432_RATE_MIN 7190 /* Hz, from data sheet */
> +#define ICS43432_RATE_MAX 52800 /* Hz, from data sheet */
If the part can work with continuous rates between those two values set
rate_min and rate_max in the DAI struct and set the rates field of the same
struct to SNDRV_PCM_RATE_CONTINUOUS.
> +
> +static int ics43432_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
> +{
> + unsigned int rate = params_rate(params);
> +
> + if (rate < ICS43432_RATE_MIN || rate > ICS43432_RATE_MAX)
> + return -EINVAL;
And then drop all of this. The ALSA core will take care of enforcing the
constraints.
> +
> + return 0;
> +}
next prev parent reply other threads:[~2015-08-13 14:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 13:55 [PATCH] ASoC: ics43432: Add codec driver for InvenSense ICS-43432 Ricard Wanderlof
2015-08-13 14:57 ` Lars-Peter Clausen [this message]
2015-08-14 15:55 ` 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=55CCB042.7090100@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=ricard.wanderlof@axis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox