From: Lars-Peter Clausen <lars@metafoo.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lgirdwood@gmail.com>, Simon <horms@verge.net.au>,
Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
Subject: Re: [PATCH] ASoC: add ak4554 driver
Date: Mon, 01 Jul 2013 17:32:29 +0200 [thread overview]
Message-ID: <51D1A10D.5000303@metafoo.de> (raw)
In-Reply-To: <87bo6mixuj.wl%kuninori.morimoto.gx@renesas.com>
On 07/01/2013 08:43 AM, Kuninori Morimoto wrote:
> +
> +static int ak4554_dai_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params,
> + struct snd_soc_dai *dai)
> +{
> + struct ak4554_priv *priv = dev_get_drvdata(dai->dev);
> +
> + if ((priv->usrcnt > 0) &&
> + (priv->rate != params_rate(params))) {
> + dev_err(dai->dev, "asymmetric rate\n");
> + return -EIO;
> + }
> +
> + priv->usrcnt++;
> + priv->rate = params_rate(params);
Set the symmetric_rates field of the dai driver to 1 to enforce symmetric
rates. No need to implement this by hand.
> +
> + return 0;
> +}
> +
[...]
> +
> +struct snd_soc_dai_driver ak4554_dai[] = {
> + {
> + .name = "ak4554-hifi-playback",
> + .playback = {
> + .stream_name = "Playback",
> + .channels_min = 2,
> + .channels_max = 2,
> + .rates = SNDRV_PCM_RATE_8000_48000,
> + .formats = SNDRV_PCM_FMTBIT_S16_LE,
> + },
> + .ops = &ak4554_dai_ops,
> + }, {
> + .name = "ak4554-hifi-capture",
> + .capture = {
> + .stream_name = "Capture",
> + .channels_min = 2,
> + .channels_max = 2,
> + .rates = SNDRV_PCM_RATE_8000_48000,
> + .formats = SNDRV_PCM_FMTBIT_S16_LE,
> + },
> + .ops = &ak4554_dai_ops,
> + }
> +};
> +EXPORT_SYMBOL_GPL(ak4554_dai);
I don't think this needs to be exported and the struct should be static
> +
> +static int ak4554_probe(struct snd_soc_codec *codec)
> +{
> + dev_info(codec->dev, "probed\n");
> + return 0;
> +}
> +
> +static int ak4554_remove(struct snd_soc_codec *codec)
> +{
> + dev_info(codec->dev, "removed\n");
> + return 0;
> +}
Remove the two functions above, there is not much point in printing these messages.
next prev parent reply other threads:[~2013-07-01 15:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 6:43 [PATCH] ASoC: add ak4554 driver Kuninori Morimoto
2013-07-01 15:32 ` Lars-Peter Clausen [this message]
2013-07-02 0:31 ` Mark Brown
2013-07-02 0:37 ` Kuninori Morimoto
2013-07-02 9:42 ` Mark Brown
2013-07-03 1:39 ` Kuninori Morimoto
2013-07-03 9:18 ` Mark Brown
2013-07-04 4:15 ` [PATCH v2] " Kuninori Morimoto
2013-07-04 10:58 ` 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=51D1A10D.5000303@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@gmail.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.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