All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 1/5] ASoC: pcm: Properly initialize hw->rate_max
Date: Fri, 10 Jan 2014 16:06:32 +0100	[thread overview]
Message-ID: <1389366396-16884-1-git-send-email-lars@metafoo.de> (raw)

If none of the components (CODEC or CPU DAI) sets a maximum sample rate we'll
end up with the rate_max field of the runtime hardware set to 0.  (Note that it
is still possible for the components to constrain the supported sample rates
using other methods, e.g. setting a list constraint) If rate_max is 0 this means
that the sound card doesn't support any rates at all, which is not the desired
result. So initialize rate_max to UINT_MAX. For symmetry reasons also set
rate_min to 0.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-pcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 313adba..b6e0c32 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -252,6 +252,9 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
 		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
 		hw->rates |= codec_stream->rates;
 
+	hw->rate_min = 0;
+	hw->rate_max = UINT_MAX;
+
 	snd_pcm_limit_hw_rates(runtime);
 
 	hw->rate_min = max(hw->rate_min, cpu_stream->rate_min);
-- 
1.8.0

             reply	other threads:[~2014-01-10 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 15:06 Lars-Peter Clausen [this message]
2014-01-10 15:06 ` [PATCH 2/5] ASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 3/5] ASoC: s6000: " Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 4/5] ALSA: Add helper function for intersecting two rate masks Lars-Peter Clausen
2014-01-10 15:17   ` Takashi Iwai
2014-01-10 15:49     ` Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 5/5] ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper Lars-Peter Clausen

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=1389366396-16884-1-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /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.