aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-sffsdr.c
diff options
context:
space:
mode:
authorHugo Villeneuve <hugo@hugovil.com>2009-01-15 15:40:35 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-15 18:43:54 -0500
commitac37373b6463d32955c6ac6b753d5e5b0946a791 (patch)
tree6c597d1cbf136a279a30443b625ab86f7f965770 /sound/soc/davinci/davinci-sffsdr.c
parentc0106d72b8d71696dbe9dc80e2c77d4ac63f7531 (diff)
ASoC: DaVinci: Fix SFFSDR compilation error.
Remove dependency on sffsdr_fpga_set_codec_fs() when the SFFSDR FPGA module is not selected. Signed-off-by: Hugo Villeneuve <hugo@hugovil.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-sffsdr.c')
-rw-r--r--sound/soc/davinci/davinci-sffsdr.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 4935d1bcbd8d..50baef1fe5b4 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -25,7 +25,9 @@
25 25
26#include <asm/dma.h> 26#include <asm/dma.h>
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#ifdef CONFIG_SFFSDR_FPGA
28#include <asm/plat-sffsdr/sffsdr-fpga.h> 29#include <asm/plat-sffsdr/sffsdr-fpga.h>
30#endif
29 31
30#include <mach/mcbsp.h> 32#include <mach/mcbsp.h>
31#include <mach/edma.h> 33#include <mach/edma.h>
@@ -43,6 +45,17 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
43 int fs; 45 int fs;
44 int ret = 0; 46 int ret = 0;
45 47
48 /* Fsref can be 32000, 44100 or 48000. */
49 fs = params_rate(params);
50
51#ifndef CONFIG_SFFSDR_FPGA
52 /* Without the FPGA module, the Fs is fixed at 44100 Hz */
53 if (fs != 44100) {
54 pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n");
55 return -EINVAL;
56 }
57#endif
58
46 /* Set cpu DAI configuration: 59 /* Set cpu DAI configuration:
47 * CLKX and CLKR are the inputs for the Sample Rate Generator. 60 * CLKX and CLKR are the inputs for the Sample Rate Generator.
48 * FSX and FSR are outputs, driven by the sample Rate Generator. */ 61 * 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,
53 if (ret < 0) 66 if (ret < 0)
54 return ret; 67 return ret;
55 68
56 /* Fsref can be 32000, 44100 or 48000. */
57 fs = params_rate(params);
58
59 pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs); 69 pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
60 70
71#ifndef CONFIG_SFFSDR_FPGA
72 return 0;
73#else
61 return sffsdr_fpga_set_codec_fs(fs); 74 return sffsdr_fpga_set_codec_fs(fs);
75#endif
62} 76}
63 77
64static struct snd_soc_ops sffsdr_ops = { 78static struct snd_soc_ops sffsdr_ops = {