aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8750.c
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2006-10-19 14:35:56 -0400
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:01:07 -0500
commita71a468a50f1385855e28864e26251b02df829bb (patch)
tree243daee96ea5c55c88a186aa03b7917f7ad533f6 /sound/soc/codecs/wm8750.c
parent543a0fbe18d0b44f3d037fe6b59458fa0c0d5e4b (diff)
[ALSA] ASoC: Add support for BCLK based on (Rate * Chn * Word Size)
This patch adds support for the DAI BCLK to be generated by multiplying Rate * Channels * Word Size (RCW). This now gives 3 options for BCLK clocking and synchronisation :- 1. BCLK = Rate * x 2. BCLK = MCLK / x 3. BCLK = Rate * Chn * Word Size. (New) Changes:- o Add support for RCW generation of BCLK o Update Documentation to include RCW. o Update DAI documentation for label = value DAI modes. o Add RCW support to wm8731, wm8750 and pxa2xx-i2s drivers. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/codecs/wm8750.c')
-rw-r--r--sound/soc/codecs/wm8750.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index 243da712d9c1..c5d13a9454d9 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -343,7 +343,7 @@ static struct snd_soc_dai_mode wm8750_modes[] = {
343 .pcmdir = WM8750_DIR, 343 .pcmdir = WM8750_DIR,
344 .flags = SND_SOC_DAI_BFS_DIV, 344 .flags = SND_SOC_DAI_BFS_DIV,
345 .fs = SND_SOC_FS_ALL, 345 .fs = SND_SOC_FS_ALL,
346 .bfs = SND_SOC_FSBD_ALL, 346 .bfs = SND_SOC_FSB_ALL,
347 }, 347 },
348}; 348};
349 349
@@ -829,6 +829,9 @@ static inline int get_coeff(int mclk, int rate)
829 if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk) 829 if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk)
830 return i; 830 return i;
831 } 831 }
832
833 printk(KERN_ERR "wm8750: could not get coeff for mclk %d @ rate %d\n",
834 mclk, rate);
832 return -EINVAL; 835 return -EINVAL;
833} 836}
834 837
@@ -836,13 +839,7 @@ static inline int get_coeff(int mclk, int rate)
836static unsigned int wm8750_config_sysclk(struct snd_soc_codec_dai *dai, 839static unsigned int wm8750_config_sysclk(struct snd_soc_codec_dai *dai,
837 struct snd_soc_clock_info *info, unsigned int clk) 840 struct snd_soc_clock_info *info, unsigned int clk)
838{ 841{
839 dai->mclk = 0; 842 dai->mclk = clk;
840
841 /* check that the calculated FS and rate actually match a clock from
842 * the machine driver */
843 if (info->fs * info->rate == clk)
844 dai->mclk = clk;
845
846 return dai->mclk; 843 return dai->mclk;
847} 844}
848 845
@@ -859,7 +856,7 @@ static int wm8750_pcm_prepare(struct snd_pcm_substream *substream)
859 if (i < 0) 856 if (i < 0)
860 return i; 857 return i;
861 858
862 bfs = SND_SOC_FSB_REAL(rtd->codec_dai->dai_runtime.bfs); 859 bfs = SND_SOC_FSBD_REAL(rtd->codec_dai->dai_runtime.bfs);
863 860
864 /* set master/slave audio interface */ 861 /* set master/slave audio interface */
865 switch (rtd->codec_dai->dai_runtime.fmt & SND_SOC_DAIFMT_CLOCK_MASK) { 862 switch (rtd->codec_dai->dai_runtime.fmt & SND_SOC_DAIFMT_CLOCK_MASK) {