All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
       [not found] <20090108121613.1ef53112.hugo@hugovil.com>
@ 2009-01-15 20:39 ` Hugo Villeneuve
  2009-01-15 20:57   ` Mark Brown
  2009-01-15 21:20   ` David Brownell
  2009-01-15 20:40 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error Hugo Villeneuve
  1 sibling, 2 replies; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 20:39 UTC (permalink / raw
  To: alsa-devel; +Cc: davinci-linux-open-source

Removed call to machine_is_sffsdr() in module init
function because it always returns zero and causes
GCC to optimise and remove all functions of the module.

Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
---
 sound/soc/davinci/davinci-sffsdr.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 1bbde3e..3e8e6cd 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -115,9 +115,6 @@ static int __init sffsdr_init(void)
 {
 	int ret;
 
-	if (!machine_is_sffsdr())
-		return -EINVAL;
-
 	sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
 	if (!sffsdr_snd_device) {
 		printk(KERN_ERR "platform device allocation failed\n");
-- 
1.5.4.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
       [not found] <20090108121613.1ef53112.hugo@hugovil.com>
  2009-01-15 20:39 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug Hugo Villeneuve
@ 2009-01-15 20:40 ` Hugo Villeneuve
  2009-01-15 21:10   ` Mark Brown
  2009-01-15 21:23   ` David Brownell
  1 sibling, 2 replies; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 20:40 UTC (permalink / raw
  To: alsa-devel; +Cc: davinci-linux-open-source

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 = {
-- 
1.5.4.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 20:39 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug Hugo Villeneuve
@ 2009-01-15 20:57   ` Mark Brown
  2009-01-15 21:02     ` Hugo Villeneuve
  2009-01-15 21:20   ` David Brownell
  1 sibling, 1 reply; 13+ messages in thread
From: Mark Brown @ 2009-01-15 20:57 UTC (permalink / raw
  To: Hugo Villeneuve; +Cc: alsa-devel, davinci-linux-open-source

On Thu, Jan 15, 2009 at 03:39:52PM -0500, Hugo Villeneuve wrote:
> Removed call to machine_is_sffsdr() in module init
> function because it always returns zero and causes
> GCC to optimise and remove all functions of the module.

> Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>

This should be replaced with the appropriate machine_is_() call for the
system.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 20:57   ` Mark Brown
@ 2009-01-15 21:02     ` Hugo Villeneuve
  2009-01-15 21:09       ` Mark Brown
  0 siblings, 1 reply; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 21:02 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, davinci-linux-open-source

On Thu, 15 Jan 2009 20:57:53 +0000
Mark Brown <broonie@sirena.org.uk> wrote:

> On Thu, Jan 15, 2009 at 03:39:52PM -0500, Hugo Villeneuve wrote:
> > Removed call to machine_is_sffsdr() in module init
> > function because it always returns zero and causes
> > GCC to optimise and remove all functions of the module.
> 
> > Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
> 
> This should be replaced with the appropriate machine_is_() call for
> the system.

It is the appropriate call, but at compile time it always return false.

Hugo.

---------------
Hugo Villeneuve
www.hugovil.com
---------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 21:02     ` Hugo Villeneuve
@ 2009-01-15 21:09       ` Mark Brown
  2009-01-15 21:17         ` Hugo Villeneuve
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Brown @ 2009-01-15 21:09 UTC (permalink / raw
  To: Hugo Villeneuve; +Cc: alsa-devel, davinci-linux-open-source

On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
> On Thu, 15 Jan 2009 20:57:53 +0000
> Mark Brown <broonie@sirena.org.uk> wrote:

> > This should be replaced with the appropriate machine_is_() call for
> > the system.

> It is the appropriate call, but at compile time it always return false.

Sounds like that should be fixed instead, then?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
  2009-01-15 20:40 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error Hugo Villeneuve
@ 2009-01-15 21:10   ` Mark Brown
  2009-01-15 21:23   ` David Brownell
  1 sibling, 0 replies; 13+ messages in thread
From: Mark Brown @ 2009-01-15 21:10 UTC (permalink / raw
  To: Hugo Villeneuve; +Cc: alsa-devel, davinci-linux-open-source

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 21:09       ` Mark Brown
@ 2009-01-15 21:17         ` Hugo Villeneuve
  2009-01-15 21:40           ` Mark Brown
       [not found]           ` <20090115161700.4d671c05.hugo-rg2e/+w5TaNBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 21:17 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, davinci-linux-open-source

On Thu, 15 Jan 2009 21:09:12 +0000
Mark Brown <broonie@sirena.org.uk> wrote:

> On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
> > On Thu, 15 Jan 2009 20:57:53 +0000
> > Mark Brown <broonie@sirena.org.uk> wrote:
> 
> > > This should be replaced with the appropriate machine_is_() call
> > > for the system.
> 
> > It is the appropriate call, but at compile time it always return
> > false.
> 
> Sounds like that should be fixed instead, then?

If someone wants to fix it, fine. I tried but couldn´t find what is
wrong. Maybe the person who added that piece of code (not me) should
fix it...

Ciao, Hugo.

---------------
Hugo Villeneuve
www.hugovil.com
---------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 20:39 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug Hugo Villeneuve
  2009-01-15 20:57   ` Mark Brown
@ 2009-01-15 21:20   ` David Brownell
  1 sibling, 0 replies; 13+ messages in thread
From: David Brownell @ 2009-01-15 21:20 UTC (permalink / raw
  To: davinci-linux-open-source, Hugo Villeneuve; +Cc: alsa-devel

On Thursday 15 January 2009, Hugo Villeneuve wrote:
> Removed call to machine_is_sffsdr() in module init
> function because it always returns zero and causes
> GCC to optimise and remove all functions of the module.
> 
> Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>

NAK.  Enable the SFF board in Kconfig, and it won't
be returning false.  If you don't enable it, you
can't possibly be running on an SFF board, and so
there's no reason to include any of these function...


> ---
>  sound/soc/davinci/davinci-sffsdr.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
> index 1bbde3e..3e8e6cd 100644
> --- a/sound/soc/davinci/davinci-sffsdr.c
> +++ b/sound/soc/davinci/davinci-sffsdr.c
> @@ -115,9 +115,6 @@ static int __init sffsdr_init(void)
>  {
>  	int ret;
>  
> -	if (!machine_is_sffsdr())
> -		return -EINVAL;
> -
>  	sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
>  	if (!sffsdr_snd_device) {
>  		printk(KERN_ERR "platform device allocation failed\n");
> -- 
> 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
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
  2009-01-15 20:40 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error Hugo Villeneuve
  2009-01-15 21:10   ` Mark Brown
@ 2009-01-15 21:23   ` David Brownell
  2009-01-15 21:42     ` Hugo Villeneuve
  1 sibling, 1 reply; 13+ messages in thread
From: David Brownell @ 2009-01-15 21:23 UTC (permalink / raw
  To: Hugo Villeneuve; +Cc: davinci-linux-open-source, alsa-devel

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
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 21:17         ` Hugo Villeneuve
@ 2009-01-15 21:40           ` Mark Brown
  2009-01-15 21:45             ` Hugo Villeneuve
       [not found]           ` <20090115161700.4d671c05.hugo-rg2e/+w5TaNBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Mark Brown @ 2009-01-15 21:40 UTC (permalink / raw
  To: Hugo Villeneuve; +Cc: alsa-devel, davinci-linux-open-source

On Thu, Jan 15, 2009 at 04:17:00PM -0500, Hugo Villeneuve wrote:
> Mark Brown <broonie@sirena.org.uk> wrote:

> > Sounds like that should be fixed instead, then?

> If someone wants to fix it, fine. I tried but couldn?t find what is
> wrong. Maybe the person who added that piece of code (not me) should
> fix it...

It was added by David Brownell to prevent the module being used on the
wrong hardware, which is perfectly reasonable.  The machine_is_foo()
tests are a very standard part of the ARM infrastructure and are widely
used - if they're not working that's where the fix is.  Are you sure
that your .config has MACH_SFFSDR set?  There appears to be no mainline
support for the core machine so you'd have to have patched that in...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [alsa-devel] [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
       [not found]           ` <20090115161700.4d671c05.hugo-rg2e/+w5TaNBDgjK7y7TUQ@public.gmane.org>
@ 2009-01-15 21:41             ` Steve Chen
  0 siblings, 0 replies; 13+ messages in thread
From: Steve Chen @ 2009-01-15 21:41 UTC (permalink / raw
  To: Hugo Villeneuve
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Mark Brown

On Thu, 2009-01-15 at 16:17 -0500, Hugo Villeneuve wrote:
> On Thu, 15 Jan 2009 21:09:12 +0000
> Mark Brown <broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> wrote:
> 
> > On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
> > > On Thu, 15 Jan 2009 20:57:53 +0000
> > > Mark Brown <broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> wrote:
> > 
> > > > This should be replaced with the appropriate machine_is_() call
> > > > for the system.
> > 
> > > It is the appropriate call, but at compile time it always return
> > > false.
> > 
> > Sounds like that should be fixed instead, then?
> 
> If someone wants to fix it, fine. I tried but couldn´t find what is
> wrong. Maybe the person who added that piece of code (not me) should
> fix it...

Just to verify the obvious, the u-boot is supplying the correct machine
type to the kernel right?

> 
> Ciao, Hugo.
> 
> ---------------
> Hugo Villeneuve
> www.hugovil.com
> ---------------
> 
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
  2009-01-15 21:23   ` David Brownell
@ 2009-01-15 21:42     ` Hugo Villeneuve
  0 siblings, 0 replies; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 21:42 UTC (permalink / raw
  To: David Brownell; +Cc: davinci-linux-open-source, alsa-devel

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
---------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
  2009-01-15 21:40           ` Mark Brown
@ 2009-01-15 21:45             ` Hugo Villeneuve
  0 siblings, 0 replies; 13+ messages in thread
From: Hugo Villeneuve @ 2009-01-15 21:45 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, davinci-linux-open-source

On Thu, 15 Jan 2009 21:40:41 +0000
Mark Brown <broonie@sirena.org.uk> wrote:

> On Thu, Jan 15, 2009 at 04:17:00PM -0500, Hugo Villeneuve wrote:
> > Mark Brown <broonie@sirena.org.uk> wrote:
> 
> > > Sounds like that should be fixed instead, then?
> 
> > If someone wants to fix it, fine. I tried but couldn?t find what is
> > wrong. Maybe the person who added that piece of code (not me) should
> > fix it...
> 
> It was added by David Brownell to prevent the module being used on the
> wrong hardware, which is perfectly reasonable.  The machine_is_foo()
> tests are a very standard part of the ARM infrastructure and are
> widely used - if they're not working that's where the fix is.  Are
> you sure that your .config has MACH_SFFSDR set?  There appears to be
> no mainline support for the core machine so you'd have to have
> patched that in...

I just found the cause. I created the SFFSDR machine on the ARM
website, and this automatically defined the macro CONFIG_MACH_SFFSDR,
and not CONFIG_MACH_DAVINCI_SFFSDR like it is currently in the Kconfig.

I will submit a patch to rename CONFIG_MACH_DAVINCI_SFFSDR to
CONFIG_MACH_SFFSDR in the Kconfig file.

Thank-you everyone for your help.

Hugo.

---------------
Hugo Villeneuve
www.hugovil.com
---------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-01-15 21:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090108121613.1ef53112.hugo@hugovil.com>
2009-01-15 20:39 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug Hugo Villeneuve
2009-01-15 20:57   ` Mark Brown
2009-01-15 21:02     ` Hugo Villeneuve
2009-01-15 21:09       ` Mark Brown
2009-01-15 21:17         ` Hugo Villeneuve
2009-01-15 21:40           ` Mark Brown
2009-01-15 21:45             ` Hugo Villeneuve
     [not found]           ` <20090115161700.4d671c05.hugo-rg2e/+w5TaNBDgjK7y7TUQ@public.gmane.org>
2009-01-15 21:41             ` [alsa-devel] " Steve Chen
2009-01-15 21:20   ` David Brownell
2009-01-15 20:40 ` [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error Hugo Villeneuve
2009-01-15 21:10   ` Mark Brown
2009-01-15 21:23   ` David Brownell
2009-01-15 21:42     ` Hugo Villeneuve

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.