[Armadeus-commitlog] armadeus branch, master, updated. release-3.4-52-gab617c5
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-04-13 15:48:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via ab617c5cfc95337575baef95930fc1f82d65757b (commit)
via c1cc2d545edabd009ef4bd751c75cecb7f8ceea0 (commit)
from 03b5a8a29f94b1419e099e831b43f984eb693b4c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ab617c5cfc95337575baef95930fc1f82d65757b
Author: Julien Boibessot <jul...@ar...>
Date: Wed Apr 13 17:47:36 2011 +0200
[DEBUG] Makes imxssi support i.MX51
commit c1cc2d545edabd009ef4bd751c75cecb7f8ceea0
Author: Julien Boibessot <jul...@ar...>
Date: Wed Apr 13 16:53:15 2011 +0200
[LINUX] [2.6.38] Makes APF51Dev audio output usable (with correct init script)
-----------------------------------------------------------------------
Summary of changes:
...soc-imx-add_apf51dev_wm8960_audio_support.patch | 20 ++--
.../428-armadeus-asoc-add_debug_to_wm8960.patch | 127 ++++++++++++++++++++
...deus-asoc-wm8960-change_channels_min_to_2.patch | 25 ++++
target/linux/debug/imxssi/imxssi.c | 70 ++++++++---
4 files changed, 215 insertions(+), 27 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
index 4f7dc04..c226430 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
@@ -1,7 +1,7 @@
-Index: linux-2.6.38-rc3/sound/soc/imx/apf51dev-wm8960.c
+Index: linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/sound/soc/imx/apf51dev-wm8960.c 2011-03-16 23:07:40.000000000 +0100
++++ linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c 2011-04-08 11:05:28.000000000 +0200
@@ -0,0 +1,166 @@
+/*
+ * ASoC audio for APF51Dev (i.MX51 using Wolfson's WM8960)
@@ -114,7 +114,7 @@ Index: linux-2.6.38-rc3/sound/soc/imx/apf51dev-wm8960.c
+ .cpu_dai_name = "imx-ssi.0",
+ .codec_dai_name = "wm8960-hifi",
+ .ops = &apf51dev_sound_hifi_ops,
-+ }, {
++ },/* {
+ .name = "WM8960 Capture",
+ .stream_name = "Capture",
+ .codec_name = "wm8960-codec.1-001a",
@@ -122,7 +122,7 @@ Index: linux-2.6.38-rc3/sound/soc/imx/apf51dev-wm8960.c
+ .cpu_dai_name = "imx-ssi.0",
+ .codec_dai_name = "wm8960-hifi",
+ .ops = &apf51dev_sound_hifi_ops,
-+ },
++ },*/
+};
+
+static struct snd_soc_card apf51dev_soc_card = {
@@ -169,10 +169,10 @@ Index: linux-2.6.38-rc3/sound/soc/imx/apf51dev-wm8960.c
+MODULE_AUTHOR("Julien Boibessot <jul...@ar...>");
+MODULE_DESCRIPTION("APF51Dev ALSA SoC driver");
+MODULE_LICENSE("GPL");
-Index: linux-2.6.38-rc3/sound/soc/imx/Kconfig
+Index: linux-2.6.38.1/sound/soc/imx/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/sound/soc/imx/Kconfig 2011-02-01 04:05:49.000000000 +0100
-+++ linux-2.6.38-rc3/sound/soc/imx/Kconfig 2011-02-24 10:44:15.000000000 +0100
+--- linux-2.6.38.1.orig/sound/soc/imx/Kconfig 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/sound/soc/imx/Kconfig 2011-04-06 09:16:53.000000000 +0200
@@ -52,4 +52,14 @@
Enable I2S based access to the TLV320AIC23B codec attached
to the SSI interface
@@ -188,10 +188,10 @@ Index: linux-2.6.38-rc3/sound/soc/imx/Kconfig
+ combo
+
endif # SND_IMX_SOC
-Index: linux-2.6.38-rc3/sound/soc/imx/Makefile
+Index: linux-2.6.38.1/sound/soc/imx/Makefile
===================================================================
---- linux-2.6.38-rc3.orig/sound/soc/imx/Makefile 2011-02-01 04:05:49.000000000 +0100
-+++ linux-2.6.38-rc3/sound/soc/imx/Makefile 2011-02-24 10:44:15.000000000 +0100
+--- linux-2.6.38.1.orig/sound/soc/imx/Makefile 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/sound/soc/imx/Makefile 2011-04-06 09:16:53.000000000 +0200
@@ -8,10 +8,12 @@
obj-$(CONFIG_SND_MXC_SOC_MX2) += snd-soc-imx-mx2.o
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
new file mode 100644
index 0000000..5bf0cae
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
@@ -0,0 +1,127 @@
+Index: linux-2.6.38.1/sound/soc/codecs/wm8960.c
+===================================================================
+--- linux-2.6.38.1.orig/sound/soc/codecs/wm8960.c 2011-04-06 11:06:59.000000000 +0200
++++ linux-2.6.38.1/sound/soc/codecs/wm8960.c 2011-04-13 14:48:47.000000000 +0200
+@@ -8,6 +8,8 @@
+ * published by the Free Software Foundation.
+ */
+
++#define DEBUG
++
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
+ #include <linux/init.h>
+@@ -16,6 +18,9 @@
+ #include <linux/i2c.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
++#ifdef DEBUG
++#include <linux/proc_fs.h>
++#endif
+ #include <sound/core.h>
+ #include <sound/pcm.h>
+ #include <sound/pcm_params.h>
+@@ -917,12 +922,81 @@
+ return 0;
+ }
+
++#ifdef DEBUG
++
++static u8 current_reg_addr;
++
++static int wm8960_proc_read_register( __attribute__ ((unused)) struct file *file, const char *buf, unsigned long count, void *data)
++{
++ int len;
++ char given_param[16];
++ u8 reg_addr;
++ u16 reg_val;
++ struct snd_soc_codec *codec = data;
++
++ if (count <= 0) {
++ printk("Empty string transmitted !\n");
++ return 0;
++ }
++ if (count > 4) {
++ len = 4;
++ printk("Only 4x[0-9] decimal values supported !\n");
++ } else {
++ len = count;
++ }
++
++ if (copy_from_user(given_param, buf, len)) {
++ return -EFAULT;
++ }
++
++ reg_addr = (u8)(simple_strtol(given_param, 0, 16));
++ current_reg_addr = reg_addr;
++ reg_val = snd_soc_read(codec, reg_addr);
++ printk("Read 0x%04x @ 0x%02x\n", reg_val, reg_addr);
++
++ return len;
++}
++
++static int wm8960_proc_write_register( __attribute__ ((unused)) struct file *file, const char *buf, unsigned long count, void *data)
++{
++ int len, ret;
++ char given_param[16];
++ u16 reg_val;
++ struct snd_soc_codec *codec = data;
++
++ if (count <= 0) {
++ printk("Empty string transmitted !\n");
++ return 0;
++ }
++ if (count > 4) {
++ len = 4;
++ printk("Only 4x[0-9] decimal values supported !\n");
++ } else {
++ len = count;
++ }
++
++ if (copy_from_user(given_param, buf, len)) {
++ return -EFAULT;
++ }
++
++ reg_val = (u16)(simple_strtol(given_param, 0, 16));
++ printk("Writing 0x%04x @ 0x%02x\n", reg_val, current_reg_addr);
++ snd_soc_write(codec, current_reg_addr, reg_val);
++ udelay(100);
++
++ return len;
++}
++#endif /* DEBUG */
++
+ static int wm8960_probe(struct snd_soc_codec *codec)
+ {
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+ struct wm8960_data *pdata = dev_get_platdata(codec->dev);
+ int ret;
+ u16 reg;
++#ifdef DEBUG
++ struct proc_dir_entry *proc_read, *proc_write;
++#endif
+
+ wm8960->set_bias_level = wm8960_set_bias_level_out3;
+ codec->control_data = wm8960->control_data;
+@@ -979,6 +1053,21 @@
+ ARRAY_SIZE(wm8960_snd_controls));
+ wm8960_add_widgets(codec);
+
++#ifdef DEBUG
++ /* create proc files */
++ proc_read = create_proc_entry("driver/wmread", S_IWUSR | S_IRGRP | S_IROTH, NULL);
++ proc_write = create_proc_entry("driver/wmwrite", S_IWUSR | S_IRGRP | S_IROTH, NULL);
++ if ((proc_read == NULL) || (proc_write == NULL)) {
++ printk(KERN_ERR "wm8960" ": Could not register one /proc file. Terminating\n");
++ return -ENOMEM;
++ } else {
++ proc_read->write_proc = wm8960_proc_read_register;
++ proc_read->data = codec;
++ proc_write->write_proc = wm8960_proc_write_register;
++ proc_write->data = codec;
++ }
++#endif
++
+ return 0;
+ }
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
new file mode 100644
index 0000000..820b984
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
@@ -0,0 +1,25 @@
+Otherwise sound is played two times too fast.
+Clean ?
+
+Signed-off-by: Julien Boibessot <jul...@ar...<
+
+Index: linux-2.6.38.1/sound/soc/codecs/wm8960.c
+===================================================================
+--- linux-2.6.38.1.orig/sound/soc/codecs/wm8960.c 2011-04-13 14:50:58.000000000 +0200
++++ linux-2.6.38.1/sound/soc/codecs/wm8960.c 2011-04-13 15:09:57.000000000 +0200
+@@ -882,13 +882,13 @@
+ .name = "wm8960-hifi",
+ .playback = {
+ .stream_name = "Playback",
+- .channels_min = 1,
++ .channels_min = 2,
+ .channels_max = 2,
+ .rates = WM8960_RATES,
+ .formats = WM8960_FORMATS,},
+ .capture = {
+ .stream_name = "Capture",
+- .channels_min = 1,
++ .channels_min = 2,
+ .channels_max = 2,
+ .rates = WM8960_RATES,
+ .formats = WM8960_FORMATS,},
diff --git a/target/linux/debug/imxssi/imxssi.c b/target/linux/debug/imxssi/imxssi.c
index ea7e7d3..9bf5c60 100644
--- a/target/linux/debug/imxssi/imxssi.c
+++ b/target/linux/debug/imxssi/imxssi.c
@@ -2,7 +2,7 @@
* imxssi.c - Tool to send SSI data from Linux's userspace
*
* Maintainers: E. Jarrige, J. Boibessot
- * (c) Copyright 2008 by Armadeus Systems
+ * (c) Copyright 2008-2011 by Armadeus Systems
* Derivated from pxaregs (c) Copyright 2002 by M&N Logistik-Loesungen Online GmbH
*
* This program is free software; you can redistribute it and/or modify
@@ -34,22 +34,26 @@
#include <getopt.h>
-//#define DEBUG TRUE
-#ifdef DEBUG
-# define debug(fmt, arg...) printf(fmt, ##arg)
-#else
-# define debug(fmt, arg...) ({ if (0) printf(fmt, ##arg);})
-#endif
+#define debug(fmt, arg...) ({ if (show_debug) printf(fmt, ##arg);})
+
#ifdef IMXL
# include "imxregs.h"
# define SSI_TRANSMIT_DATA_REG 0x00218000
# define SSI_FIFO_STATUS_REGISTER 0x00218020
-#else
+#elif IMX27
# include "imx27regs.h"
# define SSI_TRANSMIT_DATA_REG 0x10010000 /* FIFO 0 */
# define SSI_RECEIVE_DATA_REG 0x10010008
# define SSI_FIFO_STATUS_REGISTER 0x1001002C
+#elif IMX51
+# include "imx51regs.h"
+# define SSI_TRANSMIT_DATA_REG 0x83fcc000 /* FIFO 0 */
+# define SSI_RECEIVE_DATA_REG 0x83fcc008
+# define SSI_FIFO_STATUS_REGISTER 0x83fcc02c
+#else
+#error "Undefined processor"
#endif
+
#define RFCNT_MASK 0xF000
#define TFCNT_MASK 0x0F00 /* FIFO 0 for i.MX27 */
#define RFCNT_SHIFT 12
@@ -62,7 +66,7 @@ static int fd = -1;
#define TEST_SIGNAL_MAX_SAMPLES 130712
static int *table;
// static int ttable[130712];
-
+static int show_debug = 0;
/* Get value of the register at the given address */
static int getmem(u32 addr)
@@ -148,12 +152,18 @@ static void setreg(char *name, u32 val)
putmem(regs[found].addr, mem);
}
+int num_states = 8;
+char progress[8] = {
+ '|', '/', '-', ' ', '|', '/', '-', ' ',
+};
+
static void audio(u32 type, u32 samples, float level)
{
volatile void *map, *STX0, *SRX0, *SFCSR, *dma;
static int fd = -1;
u32 counter = 0;
u32 i;
+ int state = 0;
debug("type %d samples %d level %f\n", type, samples, level);
@@ -171,14 +181,14 @@ static void audio(u32 type, u32 samples, float level)
ttable[i] = 0; */
if (type == TYPE_TRIANGLE) {
- for (i=0; i<(samples/2); i++) {
+ for (i = 0; i < (samples/2); i++) {
table[i] = roundf(-32768 + ((i*(65535/samples))*2*level));
table[samples-1-i] = roundf(-32768 + ((i*(65535/samples))*2*level));
// printf("tab[%d]=%x tab[%d]=%x\n", i, table[i], samples-1-i, table[samples-1-i]);
}
} else if (type == TYPE_SINUS) {
double cosx;
- for (i=0; i<samples; i++) {
+ for (i = 0; i < samples; i++) {
cosx = cos(((double)i/samples)*2*M_PI);
table[i] = roundf(cosx*32767*level);
}
@@ -237,7 +247,7 @@ static void audio(u32 type, u32 samples, float level)
}
#ifndef IMXL
} else if (type == TYPE_LOOP) {
- /* Loop audio in to audio out (only possible on APF27Dev) */
+ /* Loop audio in to audio out (only possible on APF27Dev & APF51Dev) */
while (1) {
/* Wait until Rx FIFO is half full */
while (((*(volatile u32*)(SFCSR) & RFCNT_MASK) >> RFCNT_SHIFT) < 4);
@@ -255,6 +265,13 @@ static void audio(u32 type, u32 samples, float level)
*(volatile u32*) STX0 = table[counter & 0x0FFFF];
*(volatile u32*) STX0 = table[counter & 0x0FFFF];
counter = (counter+1) % samples;
+ if (counter == 0) {
+ if (show_debug) {
+ printf("\r%c", progress[state]);
+ fflush(stdout);
+ }
+ state = (state + 1) % (num_states - 1);
+ }
}
}
@@ -273,8 +290,9 @@ static void usage(const char* prog_name)
#endif
" -t type 0:triangular/ramp 1:sinusoid\n"
" -s samples nb of samples per period\n"
- " -l level 0.0 .. 1.0 signal amplitude\n\n"
- " !! tsc210x has to be configured in master mode !!\n",
+ " -l level 0.0 .. 1.0 signal amplitude\n"
+ " -d, --debug shows debug informations\n\n"
+ " !! audio CODEC has to be configured in master mode !!\n",
prog_name);
exit(1);
@@ -291,6 +309,7 @@ int main(int argc, char *argv[])
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"loop", 0, 0, 'L'},
+ {"debug", 0, 0, 'd'},
{0, 0, 0, 0}
};
@@ -300,7 +319,7 @@ int main(int argc, char *argv[])
level = 0.2;
opterr = 0;
- while ((option = getopt_long(argc, argv, "hLt:s:l:", long_options, &option_index)) != -1)
+ while ((option = getopt_long(argc, argv, "hLt:s:l:d", long_options, &option_index)) != -1)
{
switch (option)
{
@@ -324,6 +343,10 @@ int main(int argc, char *argv[])
type = TYPE_LOOP;
break;
+ case 'd':
+ show_debug = 1;
+ break;
+
case '?':
if ((optopt == 's') || (optopt == 't') || (optopt == 'l'))
fprintf(stderr, "Option -%c requires an argument.\n", optopt);
@@ -337,7 +360,8 @@ int main(int argc, char *argv[])
abort();
}
}
-
+
+ /* Setup Audio Mux & SSI */
#ifdef IMXL
setreg("SFCSR", 0x0088);
setreg("STCCR", 0x6103);
@@ -345,15 +369,27 @@ int main(int argc, char *argv[])
setreg("STCR", 0x028D);
setreg("SCSR", 0xDB41);
#else
+# ifdef IMX27
+ /* Clock */
setreg("PCCR0", 0xd5010013);
setreg("PCCR1", 0xa21a0e30);
+ /* Audio Mux */
setreg("PPCR1", 0x00001000);
setreg("HPCR1", 0xcc007000);
+ /* SSI */
setreg("STCR_1", 0x0000028d); /* I2S mode */
setreg("SRCR_1", 0x0000028d); /* I2S mode */
setreg("STCCR_1", 0x0000e000);
- setreg("SCR_1", 0x00000057); /* I2S mode */
+# elif IMX51
+ /* Audio Mux (SSI1 <-> Port 3, synchronous) */
+ setreg("PTCR1", 0x94800800);
+ setreg("PDCR1", 0x00004000);
+ setreg("PTCR3", 0x00000800);
+ setreg("PDCR3", 0x00000000);
+# endif
+ setreg("SCR_1", 0x00000057); /* I2S mode, Tx & Rx on, SSI on */
#endif
+
audio(type, val, level);
return 0;
hooks/post-receive
--
armadeus
|