[alsa-devel] [PATCH 1/1] ALSA: 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 --- sound/soc/davinci/davinci-sffsdr.c | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 3e8e6cd..e3ea07a 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -25,7 +25,9 @@ #include <asm/gpio.h> #include <asm/dma.h> #include <asm/mach-types.h> +#ifdef CONFIG_SFFSDR_FPGA #include <asm/plat-sffsdr/sffsdr-fpga.h> +#endif
#include <mach/asp.h> #include <mach/edma.h> @@ -42,6 +44,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. */ @@ -52,12 +65,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 = {
On Thu, Jan 15, 2009 at 03:40:35PM -0500, Hugo Villeneuve wrote:
Remove dependency on sffsdr_fpga_set_codec_fs() when the SFFSDR FPGA module is not selected.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
Looks good, applied.
On Thursday 15 January 2009, Hugo Villeneuve wrote:
Remove dependency on sffsdr_fpga_set_codec_fs() when the SFFSDR FPGA module is not selected.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
Something looks broken in the config you're building with. As in, very deeply broken. You should fix the config instead of hacking around those bugs with ifdefs.
sound/soc/davinci/davinci-sffsdr.c | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 3e8e6cd..e3ea07a 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -25,7 +25,9 @@ #include <asm/gpio.h> #include <asm/dma.h> #include <asm/mach-types.h> +#ifdef CONFIG_SFFSDR_FPGA #include <asm/plat-sffsdr/sffsdr-fpga.h> +#endif
#include <mach/asp.h> #include <mach/edma.h> @@ -42,6 +44,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. */
@@ -52,12 +65,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 = {
1.5.4.5
Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
On Thu, 15 Jan 2009 13:23:09 -0800 David Brownell david-b@pacbell.net wrote:
On Thursday 15 January 2009, Hugo Villeneuve wrote:
Remove dependency on sffsdr_fpga_set_codec_fs() when the SFFSDR FPGA module is not selected.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
Something looks broken in the config you're building with. As in, very deeply broken. You should fix the config instead of hacking around those bugs with ifdefs.
Nothing is broken, it is an optional feature.
Hugo.
--------------- Hugo Villeneuve www.hugovil.com ---------------
participants (3)
-
David Brownell
-
Hugo Villeneuve
-
Mark Brown