linux-davinci-git : Update recipe so it builds for sffsdr board.
[vuplus_openembedded] / packages / linux / linux-davinci / davinci-sffsdr / 0006-ALSA-ASoC-DaVinci-Fix-SFFSDR-compilation-error.patch
1 From 590c788288e545ef74b77129bc8f747b5365f5d3 Mon Sep 17 00:00:00 2001
2 From: Hugo Villeneuve <hugo@hugovil.com>
3 Date: Thu, 15 Jan 2009 15:40:35 -0500
4 Subject: [PATCH 06/12] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
5
6 Remove dependency on sffsdr_fpga_set_codec_fs() when the
7 SFFSDR FPGA module is not selected.
8
9 Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
10 ---
11  sound/soc/davinci/davinci-sffsdr.c |   20 +++++++++++++++++---
12  1 files changed, 17 insertions(+), 3 deletions(-)
13
14 diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
15 index 1bbde3e..afb61bf 100644
16 --- a/sound/soc/davinci/davinci-sffsdr.c
17 +++ b/sound/soc/davinci/davinci-sffsdr.c
18 @@ -25,7 +25,9 @@
19  #include <asm/gpio.h>
20  #include <asm/dma.h>
21  #include <asm/mach-types.h>
22 +#ifdef CONFIG_SFFSDR_FPGA
23  #include <asm/plat-sffsdr/sffsdr-fpga.h>
24 +#endif
25  
26  #include <mach/asp.h>
27  #include <mach/edma.h>
28 @@ -42,6 +44,17 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
29         int fs;
30         int ret = 0;
31  
32 +       /* Fsref can be 32000, 44100 or 48000. */
33 +       fs = params_rate(params);
34 +
35 +#ifndef CONFIG_SFFSDR_FPGA
36 +       /* Without the FPGA module, the Fs is fixed at 44100 Hz */
37 +       if (fs != 44100) {
38 +               pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n");
39 +               return -EINVAL;
40 +       }
41 +#endif
42 +
43         /* Set cpu DAI configuration:
44          * CLKX and CLKR are the inputs for the Sample Rate Generator.
45          * FSX and FSR are outputs, driven by the sample Rate Generator. */
46 @@ -52,12 +65,13 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
47         if (ret < 0)
48                 return ret;
49  
50 -       /* Fsref can be 32000, 44100 or 48000. */
51 -       fs = params_rate(params);
52 -
53         pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
54  
55 +#ifndef CONFIG_SFFSDR_FPGA
56 +       return 0;
57 +#else
58         return sffsdr_fpga_set_codec_fs(fs);
59 +#endif
60  }
61  
62  static struct snd_soc_ops sffsdr_ops = {
63 -- 
64 1.5.4.5
65