alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: broonie@opensource.wolfsonmicro.com, lrg@ti.com,
	alsa-devel@alsa-project.org
Subject: [PATCH 2/3] ASoC: support all possible sample rates in the WM8776 driver
Date: Tue, 13 Sep 2011 12:59:36 -0500	[thread overview]
Message-ID: <1315936777-27994-2-git-send-email-timur@freescale.com> (raw)
In-Reply-To: <1315936777-27994-1-git-send-email-timur@freescale.com>

ASoC codec drivers can use the .set_sysclk function to dynamically specify
the list of support sample rates, because that list is often based on
the input clock frequency.  Although the WM8776 includes a .set_sysclk
function, it was also hard-coding the supported sample rates to a list
that depends on a specific input clock frequency.

So change the hard-coded list to a range within the capabilities of the
WM8776 itself, and let wm8776_set_sysclk() do its job.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 sound/soc/codecs/wm8776.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
index ad6f0fa..ca8a593 100644
--- a/sound/soc/codecs/wm8776.c
+++ b/sound/soc/codecs/wm8776.c
@@ -321,11 +321,6 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-#define WM8776_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
-		      SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
-		      SNDRV_PCM_RATE_96000)
-
-
 #define WM8776_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
 			SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
@@ -350,7 +345,9 @@ static struct snd_soc_dai_driver wm8776_dai[] = {
 			.stream_name = "Playback",
 			.channels_min = 2,
 			.channels_max = 2,
-			.rates = WM8776_RATES,
+			.rates = SNDRV_PCM_RATE_CONTINUOUS,
+			.rate_min = 32000,
+			.rate_max = 192000,
 			.formats = WM8776_FORMATS,
 		},
 		.ops = &wm8776_dac_ops,
@@ -362,7 +359,9 @@ static struct snd_soc_dai_driver wm8776_dai[] = {
 			.stream_name = "Capture",
 			.channels_min = 2,
 			.channels_max = 2,
-			.rates = WM8776_RATES,
+			.rates = SNDRV_PCM_RATE_CONTINUOUS,
+			.rate_min = 32000,
+			.rate_max = 96000,
 			.formats = WM8776_FORMATS,
 		},
 		.ops = &wm8776_adc_ops,
-- 
1.7.3.4

  reply	other threads:[~2011-09-13 18:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 17:59 [PATCH 1/3] ASoC: support sample sizes properly in the WM8776 codec driver Timur Tabi
2011-09-13 17:59 ` Timur Tabi [this message]
2011-09-14 12:36   ` [PATCH 2/3] ASoC: support all possible sample rates in the WM8776 driver Liam Girdwood
2011-09-15 10:24   ` Mark Brown
2011-09-15 15:08     ` Timur Tabi
2011-09-15 22:38       ` Mark Brown
2011-09-15 23:06         ` Tabi Timur-B04825
2011-09-15 23:49           ` Mark Brown
2011-09-16 13:48             ` Timur Tabi
2011-09-17 13:04               ` Mark Brown
2011-09-13 17:59 ` [PATCH 3/3] ASoC: improve asynchronous mode support in the fsl_ssi driver Timur Tabi
2011-09-14 12:37   ` Liam Girdwood
2011-09-15 23:06   ` Mark Brown
2011-09-15 23:49   ` Mark Brown
2011-09-14 12:35 ` [PATCH 1/3] ASoC: support sample sizes properly in the WM8776 codec driver Liam Girdwood
2011-09-14 21:51   ` Timur Tabi
2011-09-15 10:26     ` Mark Brown
2011-09-15 11:28       ` Tabi Timur-B04825
2011-09-15 13:21 ` Mark Brown
2011-09-15 15:16   ` Timur Tabi
2011-09-15 23:38     ` Mark Brown
2011-09-16  9:07 ` 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=1315936777-27994-2-git-send-email-timur@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.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;
as well as URLs for NNTP newsgroup(s).