From 7baf73f3959283c0cc9e264de91b6f0b6c875970 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 15 Jan 2009 15:40:35 -0500 Subject: [PATCH] --- yaml --- r: 132782 b: refs/heads/master c: ac37373b6463d32955c6ac6b753d5e5b0946a791 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/davinci/davinci-sffsdr.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index fd2bbc4a9bb8..0f457f75e090 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c0106d72b8d71696dbe9dc80e2c77d4ac63f7531 +refs/heads/master: ac37373b6463d32955c6ac6b753d5e5b0946a791 diff --git a/trunk/sound/soc/davinci/davinci-sffsdr.c b/trunk/sound/soc/davinci/davinci-sffsdr.c index 4935d1bcbd8d..50baef1fe5b4 100644 --- a/trunk/sound/soc/davinci/davinci-sffsdr.c +++ b/trunk/sound/soc/davinci/davinci-sffsdr.c @@ -25,7 +25,9 @@ #include #include +#ifdef CONFIG_SFFSDR_FPGA #include +#endif #include #include @@ -43,6 +45,17 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, int fs; int ret = 0; + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + +#ifndef CONFIG_SFFSDR_FPGA + /* Without the FPGA module, the Fs is fixed at 44100 Hz */ + if (fs != 44100) { + pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n"); + return -EINVAL; + } +#endif + /* Set cpu DAI configuration: * CLKX and CLKR are the inputs for the Sample Rate Generator. * FSX and FSR are outputs, driven by the sample Rate Generator. */ @@ -53,12 +66,13 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret; - /* Fsref can be 32000, 44100 or 48000. */ - fs = params_rate(params); - pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs); +#ifndef CONFIG_SFFSDR_FPGA + return 0; +#else return sffsdr_fpga_set_codec_fs(fs); +#endif } static struct snd_soc_ops sffsdr_ops = {