Skip to contentSkip to conversation

ALSA:ATMEL: common arch for audio via ssc(patch 2/3: adding directories)

PATCH Sedji Gaouaou 2 participants 2 messages Sep 26, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

This patch contains:
The Kconfig and Makefile, plus the interface files(atmel_ssc_dai and atmel-pcm).

Regards,
Sedji

sound/soc/Kconfig +1 -2
index f743530..030d9f2 100644
@@ -22,8 +22,7 @@ config SND_SOC_AC97_BUS
 	bool
 
 # All the supported Soc's
-source "sound/soc/at32/Kconfig"
-source "sound/soc/at91/Kconfig"
+source "sound/soc/atmel/Kconfig"
 source "sound/soc/au1x/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
sound/soc/Makefile +1 -1
index 933a66d..6a38fc7 100644
@@ -1,5 +1,5 @@
 snd-soc-core-objs := soc-core.o soc-dapm.o
 
 obj-$(CONFIG_SND_SOC)	+= snd-soc-core.o
-obj-$(CONFIG_SND_SOC)	+= codecs/ at32/ at91/ pxa/ s3c24xx/ sh/ fsl/ davinci/
+obj-$(CONFIG_SND_SOC)	+= codecs/ atmel/ pxa/ s3c24xx/ sh/ fsl/ davinci/
 obj-$(CONFIG_SND_SOC)	+= omap/ au1x/
sound/soc/atmel/Kconfig new file +61 -0

61 lines not on this page · raw message

sound/soc/atmel/Makefile new file +17 -0
new file mode 100644
index 0000000..00c5cd8
@@ -0,0 +1,17 @@
+# AT91 Platform Support
+snd-soc-atmel-pcm-objs := atmel-pcm.o
+snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o
+
+obj-$(CONFIG_SND_ATMEL_SOC) += snd-soc-atmel-pcm.o
+obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o
+
+# AT91 Machine Support
+snd-soc-eti-b1-wm8731-objs := eti_b1_wm8731.o
+snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o
+
+# AT32 Machine Support
+snd-soc-playpaq-objs := playpaq_wm8510.o
+
+obj-$(CONFIG_SND_AT91_SOC_ETI_B1_WM8731) += snd-soc-eti-b1-wm8731.o
+obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o
+obj-$(CONFIG_SND_AT32_SOC_PLAYPAQ) += snd-soc-playpaq.o
sound/soc/atmel/atmel-pcm.c new file +494 -0

494 lines not on this page · raw message

sound/soc/atmel/atmel-pcm.h new file +86 -0

86 lines not on this page · raw message

sound/soc/atmel/atmel_ssc_dai.c new file +804 -0

804 lines not on this page · raw message

sound/soc/atmel/atmel_ssc_dai.h new file +121 -0

121 lines not on this page · raw message

#1 lore raw
Quoted 3 lines · Sedji Gaouaou

This patch contains:
The Kconfig and Makefile, plus the interface files(atmel_ssc_dai and atmel-pcm).

This all looks very good - I've got some comments below but they're all fairly minor coding style issues. The only ones that really need to be addressed are the commented out code and the use of printk KERN_DEBUG rather than pr_dbg(). However, your mailer appears to have word wrapped the patch so it won't apply - you'll need to reconfigure your MUA to avoid this.

You also need to include a Signed-off-by: line in your message when submitting patches, it's required for code going into the Linux kernel. Documentation/SubmittingPatches contains an explanation of what that's for and the text you'd be agreeing to.

Please also include a more detailed changelog entry in your patch explaining that you're unifying the existing Ateml . Documentation/SubmittingPatches has some guidance on this.

sound/soc/atmel/Kconfig line 14

Quoted 5 lines
sound/soc/atmel/Kconfig new file +5 -0
+config SND_ATMEL_SOC_SSC
+	tristate
+	depends on SND_ATMEL_SOC
+	help
+	  Say Y or M if you want to add support for codecs the

...connected to an...

sound/soc/atmel/atmel-pcm.c line 108

Quoted 9 lines
sound/soc/atmel/atmel-pcm.c new file +8 -0
+	  ATMEL SSC interface. You will also needs to select the individual
+	  machine drivers to support below.
 
+	buf->dev.dev = pcm->card->dev;
+	buf->private_data = NULL;
+	buf->area = dma_alloc_writecombine(pcm->card->dev, size,
+					   &buf->addr, GFP_KERNEL);
+	/*buf->area = dma_alloc_coherent(pcm->card->dev, size,
+					  &buf->addr, GFP_KERNEL);*/

Please remove commented code like this.

sound/soc/atmel/atmel-pcm.c line 113

Quoted 5 lines
sound/soc/atmel/atmel-pcm.c new file +5 -0
+	printk(KERN_DEBUG "atmel-pcm:"
+		"preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
+		(void *) buf->area,
+		(void *) buf->addr,
+		size);

It's probably better to use pr_dbg() for this and most of the other KERN_DEBUG prints - I'd expect the current code would be too verbose for normal operation.

sound/soc/atmel/atmel-pcm.c line 358

Quoted 13 lines
sound/soc/atmel/atmel-pcm.c new file +13 -0
+static int atmel_pcm_mmap(struct snd_pcm_substream *substream,
+	struct vm_area_struct *vma)
+{
+	struct snd_pcm_runtime *runtime = substream->runtime;
+
+	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
+				     runtime->dma_area,
+				     runtime->dma_addr,
+				     runtime->dma_bytes);
+	/*return remap_pfn_range(vma, vma->vm_start,
+		       substream->dma_buffer.addr >> PAGE_SHIFT,
+		       vma->vm_end - vma->vm_start, vma->vm_page_prot);*/
+}

Again, please remove the old, commented code. There's some other instances of this in the patch.

sound/soc/atmel/atmel_ssc_dai.c line 370

Quoted 7 lines
sound/soc/atmel/atmel_ssc_dai.c new file +7 -0
+	/*
+	 * Currently, there is only one set of dma params for
+	 * each direction.  If more are added, this code will
+	 * have to be changed to select the proper set.
+	 */
+	dir = ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+		0 : 1);

I'd really prefer

	if (substream->stream == SND_PCM_STREAM_PLAYBACK)
		dir = 1;
	else
		dir = 0;

for clarity.

sound/soc/atmel/atmel_ssc_dai.c line 486

Quoted 8 lines
sound/soc/atmel/atmel_ssc_dai.c new file +8 -0
+		 *  For single channel data, one sample is transferred
+		 * on the falling edge of the LRC clock.
+		 * For two channel data, one sample is
+		 * transferred on both edges of the LRC clock.
+		 */
+		start_event = ((channels == 1)
+				? SSC_START_FALLING_RF
+				: SSC_START_EDGE_RF);

Please expand this to

	if (channels == 1)
		start_event = SSC_START_FALLING_RF;
	else
		start_event = SSC_START_EDGE_RF;

sound/soc/atmel/atmel_ssc_dai.c line 712

Quoted 5 lines
sound/soc/atmel/atmel_ssc_dai.c new file +5 -0
+#define ATMEL_SSC_RATES (SNDRV_PCM_RATE_8000  | SNDRV_PCM_RATE_11025 |\
+			SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
+			SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
+			SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
+			SNDRV_PCM_RATE_96000)

Might be clearer to say SNDRV_PCM_RATE_8000_96000 unless there are some rates which that includes that are missing in there but it's not important either way.