Skip to contentSkip to conversation

Fix audio for Lyrtech SFFSDR board

PATCH In review Hugo Villeneuve 5 participants 18 messages Mar 10, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1236655929-31688-1-git-send-email-hugo-rg2e/[email protected]

#2 lore raw

PATCH 3/4 ALSA: ASoC: Davinci: Updated sffsdr_hw_params() function to new format

---
 sound/soc/davinci/davinci-sffsdr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
sound/soc/davinci/davinci-sffsdr.c +1 -2
index b338c71..7fdfba8 100644
@@ -45,8 +45,7 @@
 		      SND_SOC_DAIFMT_IB_NF)
 
 static int sffsdr_hw_params(struct snd_pcm_substream *substream,
-			    struct snd_pcm_hw_params *params,
-			    struct snd_soc_dai *dai)
+			    struct snd_pcm_hw_params *params)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
Signature · 1 line
1.5.5
#3 lore raw

PATCH 4/4 ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

In reply to a message not in the archive
---
 sound/soc/davinci/davinci-sffsdr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/davinci/davinci-sffsdr.c +3 -0
index 7fdfba8..1fc53c1 100644
@@ -31,6 +31,7 @@
 #endif
 #include <mach/asp.h>
 #include <mach/edma.h>
+#include <mach/mux.h>
 
 #include "../codecs/pcm3008.h"
 #include "davinci-pcm.h"
@@ -135,6 +136,8 @@ static int __init sffsdr_init(void)
 	if (!machine_is_sffsdr())
 		return -EINVAL;
 
+	davinci_cfg_reg(DM644X_MCBSP);
+
 	sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
 	if (!sffsdr_snd_device) {
 		printk(KERN_ERR "platform device allocation failed\n");
Signature · 1 line
1.5.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 7 lines · On Tue, 10 Mar 2009 10:29:23 +0000 Mark Brown <[email protected]> wrote:

sound/soc/davinci/davinci-sffsdr.c static int __init sffsdr_init(void) · line 140

Quoted 4 lines · Hugo Villeneuve
sound/soc/davinci/davinci-sffsdr.c +2 -0
 		return -EINVAL;
 
+	davinci_cfg_reg(DM644X_MCBSP);
+

I can't find any references to this function in mainline?

Hi Mark,
I based those patches on the latest linux-davinci git tree, which has the function.

Quoted 4 lines

Most of the
ARM variants do this sort of configuration in the arch/arm code which was why I was looking for other users to see what was idiomatic for DaVinci.

In fact I just duplicated what was done for the evm board in sound/soc/davinci/davinci-evm.c, which also has the davinci_cfg_reg() function (in the linux-davinci tree):

http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=commit;h=da57d7068350741e62671a7f619d5b4fad2727c0

Quoted 1 line

I've applied the other three patches.

Thanks, Hugo V.

#6 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

#7 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 8 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Kevin, what is the new rule to submit davinci ASoC patches?

Hugo V.

#8 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 12 lines · Hugo Villeneuve
Quoted 8 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

Quoted 7 lines

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Kevin, what is the new rule to submit davinci ASoC patches?

The DaVinci ASoC code is indeed in mainline, but not all of the DaVinci core (in this case the pin mux) is yet in mainline. I will be pushing it during the next merge window.

On a related note, sound/soc/davinci/davinci-[evm,sffsdr].c is actually board-level setup code and should not actually live in sound/asoc/. It should live in arch/arm/mach-davinci/* and follow the rest of the davinci chip/board code upstream.

Kevin

#9 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 4 lines · Kevin Hilman

On a related note, sound/soc/davinci/davinci-[evm,sffsdr].c is actually board-level setup code and should not actually live in sound/asoc/. It should live in arch/arm/mach-davinci/* and follow the rest of the davinci chip/board code upstream.

No, the ASoC APIs are not stable enough for this - putting this code in arch/arm will just lead to merge pain when code from one tree goes in without updates from the other.

Experience also suggests that audio drivers often get substantial enough and need sufficient review to warrant keeping separate from the core machine code.

#10 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 7 lines · Mark Brown
Quoted 4 lines · Kevin Hilman

On a related note, sound/soc/davinci/davinci-[evm,sffsdr].c is actually board-level setup code and should not actually live in sound/asoc/. It should live in arch/arm/mach-davinci/* and follow the rest of the davinci chip/board code upstream.

Quoted 7 lines

No, the ASoC APIs are not stable enough for this - putting this code in arch/arm will just lead to merge pain when code from one tree goes in without updates from the other.

Experience also suggests that audio drivers often get substantial enough and need sufficient review to warrant keeping separate from the core machine code.

OK, good to know your opinion there.

Thanks,

Kevin

#11 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

In reply to Kevin Hilman
Quoted 20 lines · On Tue, 10 Mar 2009 08:55:06 -0700 Kevin Hilman <[email protected]>…
Quoted 18 lines · Hugo Villeneuve
Quoted 9 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Quoted 6 lines
Quoted 2 lines

Kevin, what is the new rule to submit davinci ASoC patches?

The DaVinci ASoC code is indeed in mainline, but not all of the DaVinci core (in this case the pin mux) is yet in mainline. I will be pushing it during the next merge window.

That doesn't really answer my question.

I can see that David Brownell pushed a patch to the davinci tree directly modifying sound/soc/davinci/davinci-evm.c which IS in mainline. Does this means that as of now all ASoC patches should be sent first to the Davinci list, and then you will push those to the mainline kernel?

Quoted 4 lines

On a related note, sound/soc/davinci/davinci-[evm,sffsdr].c is actually board-level setup code and should not actually live in sound/asoc/. It should live in arch/arm/mach-davinci/* and follow the rest of the davinci chip/board code upstream.

Kevin, you have said the same things months ago and I agree with you. When you or someone else move the evm stuff back into arch/arm/mach-davinci, I will be more than happy to do the same for the SFFSDR.

Hugo V.

#12 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 30 lines · Hugo Villeneuve
Quoted 20 lines · On Tue, 10 Mar 2009 08:55:06 -0700 Kevin Hilman <[email protected]>…
Quoted 18 lines · Hugo Villeneuve
Quoted 9 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Quoted 6 lines
Quoted 2 lines

Kevin, what is the new rule to submit davinci ASoC patches?

The DaVinci ASoC code is indeed in mainline, but not all of the DaVinci core (in this case the pin mux) is yet in mainline. I will be pushing it during the next merge window.

Quoted 7 lines

That doesn't really answer my question.

I can see that David Brownell pushed a patch to the davinci tree directly modifying sound/soc/davinci/davinci-evm.c which IS in mainline. Does this means that as of now all ASoC patches should be sent first to the Davinci list, and then you will push those to the mainline kernel?

No ASoc patches should be generated against an ASoC tree and submitted to alsa-devel, and CC davinci list.

This means that the until the DaVinci core is in mainline, DaVinci git will have slightly different looking ASoC drivers, but those changes will be minimal.

Kevin

#13 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 41 lines · On Tue, 10 Mar 2009 09:20:15 -0700 Kevin Hilman <[email protected]>…
Quoted 30 lines · Hugo Villeneuve
Quoted 20 lines · On Tue, 10 Mar 2009 08:55:06 -0700 Kevin Hilman <[email protected]>…
Quoted 18 lines · Hugo Villeneuve
Quoted 9 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Quoted 6 lines
Quoted 2 lines

Kevin, what is the new rule to submit davinci ASoC patches?

The DaVinci ASoC code is indeed in mainline, but not all of the DaVinci core (in this case the pin mux) is yet in mainline. I will be pushing it during the next merge window.

Quoted 8 lines

That doesn't really answer my question.

I can see that David Brownell pushed a patch to the davinci tree directly modifying sound/soc/davinci/davinci-evm.c which IS in mainline. Does this means that as of now all ASoC patches should be sent first to the Davinci list, and then you will push those to the mainline kernel?

Quoted 6 lines

No ASoc patches should be generated against an ASoC tree and submitted to alsa-devel, and CC davinci list.

This means that the until the DaVinci core is in mainline, DaVinci git will have slightly different looking ASoC drivers, but those changes will be minimal.

Ok, so the patch affecting sound/soc/davinci/davinci-evm.c SHOULD have been submitted to ALSA first.

It is not easy following you guys. You say something and then do the opposite.

Hugo V.

#14 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 47 lines · Hugo Villeneuve
Quoted 44 lines · On Tue, 10 Mar 2009 09:20:15 -0700 Kevin Hilman <[email protected]>…
Quoted 30 lines · Hugo Villeneuve
Quoted 20 lines · On Tue, 10 Mar 2009 08:55:06 -0700 Kevin Hilman <[email protected]>…
Quoted 18 lines · Hugo Villeneuve
Quoted 9 lines · On Tue, 10 Mar 2009 15:16:32 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Hugo Villeneuve

I based those patches on the latest linux-davinci git tree, which has the function.

Do not submit patches for mainline which are not based on mainline trees. Code which relies on out of tree changes needs to wait for those out of tree changes to be merged before submitting to mainline.

I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore.

Quoted 6 lines
Quoted 2 lines

Kevin, what is the new rule to submit davinci ASoC patches?

The DaVinci ASoC code is indeed in mainline, but not all of the DaVinci core (in this case the pin mux) is yet in mainline. I will be pushing it during the next merge window.

Quoted 8 lines

That doesn't really answer my question.

I can see that David Brownell pushed a patch to the davinci tree directly modifying sound/soc/davinci/davinci-evm.c which IS in mainline. Does this means that as of now all ASoC patches should be sent first to the Davinci list, and then you will push those to the mainline kernel?

No ASoc patches should be generated against an ASoC tree and submitted to alsa-devel, and CC davinci list.

Quoted 6 lines
Quoted 3 lines

This means that the until the DaVinci core is in mainline, DaVinci git will have slightly different looking ASoC drivers, but those changes will be minimal.

Ok, so the patch affecting sound/soc/davinci/davinci-evm.c SHOULD have been submitted to ALSA first.

Yes, but it should've been a patch against an ASoC tree, not against DaVinci git which may contain things not (yet) in the ASoC tree.

Quoted 2 lines

It is not easy following you guys. You say something and then do the opposite.

Heh, sorry.

Do as I do, not as I say. ;)

Kevin

#15 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

Quoted 7 lines · Kevin Hilman
Quoted 3 lines

Ok, so the patch affecting sound/soc/davinci/davinci-evm.c SHOULD have been submitted to ALSA first.

Yes, but it should've been a patch against an ASoC tree, not against DaVinci git which may contain things not (yet) in the ASoC tree.

Quoted 6 lines
Quoted 2 lines

It is not easy following you guys. You say something and then do the opposite.

Heh, sorry.

Do as I do, not as I say.  ;)

I'd say "my bad" ... but in these cases there's seems to be no better solution than having the DaVinci GIT tree diverge a bit from mainline ASoC, in synchrony with arch/arm/mach-davinci which is also diverging from mainline.

There's a general rule that patches should not break builds. And that rule is why there are several ASoC patches I've not yet sent to mainline.

The whole ASoC/DaVinci thing has been nothing but build breakage however, since it depends on EDMA patches which haven't yet gone to mainline. (But, I believe, will soon do so, at which point that breakage will stop.)

- Dave

#16 lore raw

Re: [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR

In reply to Hugo Villeneuve
Quoted 2 lines · Hugo Villeneuve

It is not easy following you guys. You say something and then do the opposite.

There's a very simple rule which works for all upstream submissions:
always generate patches against the tree which the patches are being submitted to. If there are changes that have cross-tree dependencies then those need to be resolved on a case by case basis - normally the best thing to there is for the affected patches to take the same path as whatever they depend on.

It is normal and expected for the different trees people merge on to diverge during a release cycle: for example, changes to a subsystem may well affect large portions of that subsystem while architecture changes may affect a wide range of drivers.

#17 lore raw

PATCH 1/4 ALSA: ASoC: Davinci: Fix SFFSDR FPGA module codec FS bug

In reply to Hugo Villeneuve

This prevented the FPGA from properly configuring the codec FS when the SFFSDR FPGA was compiled as a module.

---
 sound/soc/davinci/davinci-sffsdr.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/davinci/davinci-sffsdr.c +7 -7
index 74f1eb3..1d10957 100644
@@ -25,10 +25,10 @@
 
 #include <asm/dma.h>
 #include <asm/mach-types.h>
-#ifdef CONFIG_SFFSDR_FPGA
-#include <asm/plat-sffsdr/sffsdr-fpga.h>
-#endif
 
+#if defined(CONFIG_SFFSDR_FPGA) || defined(CONFIG_SFFSDR_FPGA_MODULE)
+#include <mach/sffsdr-fpga.h>
+#endif
 #include <mach/asp.h>
 #include <mach/edma.h>
 
@@ -48,7 +48,7 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 	/* Fsref can be 32000, 44100 or 48000. */
 	fs = params_rate(params);
 
-#ifndef CONFIG_SFFSDR_FPGA
+#if !defined(CONFIG_SFFSDR_FPGA) && !defined(CONFIG_SFFSDR_FPGA_MODULE)
 	/* 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");
@@ -68,10 +68,10 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 
 	pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
 
-#ifndef CONFIG_SFFSDR_FPGA
-	return 0;
-#else
+#if defined(CONFIG_SFFSDR_FPGA) || defined(CONFIG_SFFSDR_FPGA_MODULE)
 	return sffsdr_fpga_set_codec_fs(fs);
+#else
+	return 0;
 #endif
 }
 
Signature · 1 line
1.5.5
#18 lore raw

Re: [PATCH 1/4] ALSA: ASoC: Davinci: Fix SFFSDR FPGA module codec FS bug

Quoted 2 lines · Hugo Villeneuve

This prevented the FPGA from properly configuring the codec FS when the SFFSDR FPGA was compiled as a module.

This doesn't apply against mainline either. Please regenerate against the topic/asoc branch of:

	git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
#19 lore raw

PATCH 2/4 ALSA: ASoC: Davinci: Replaced DAI format RIGHT_J by DSP_B for SFFSDR

In reply to Hugo Villeneuve
---
 sound/soc/davinci/davinci-sffsdr.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
sound/soc/davinci/davinci-sffsdr.c +10 -7
index 1d10957..b338c71 100644
@@ -36,6 +36,14 @@
 #include "davinci-pcm.h"
 #include "davinci-i2s.h"
 
+/*
+ * CLKX and CLKR are the inputs for the Sample Rate Generator.
+ * FSX and FSR are outputs, driven by the sample Rate Generator.
+ */
+#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B |	\
+		      SND_SOC_DAIFMT_CBM_CFS |	\
+		      SND_SOC_DAIFMT_IB_NF)
+
 static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 			    struct snd_pcm_hw_params *params,
 			    struct snd_soc_dai *dai)
@@ -56,13 +64,8 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 	}
 #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. */
-	ret = snd_soc_dai_set_fmt(cpu_dai,
-				  SND_SOC_DAIFMT_RIGHT_J |
-				  SND_SOC_DAIFMT_CBM_CFS |
-				  SND_SOC_DAIFMT_IB_NF);
+	/* set cpu DAI configuration */
+	ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
 	if (ret < 0)
 		return ret;
 
Signature · 1 line
1.5.5