[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-75-g5805ae8
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2009-12-23 10:13:40
|
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 5805ae8adbbbc3feba1e4d4e47d63026fd53f7d6 (commit)
via e3eda5b6b3b608a4309f3b54165154945afa2468 (commit)
via 2cc35ad5ed431441f4a8f1b5a4071efc8a85a746 (commit)
via a68f8f37e142155515ad3e912d85fe79e800d853 (commit)
via 6426197a51cc4ce231b7f1101c9bd45f1b134de3 (commit)
via 31967aa93df4ea44873f93eed2ab0d08f3aebed3 (commit)
from eb136b98483dbc452f997a12f393aec2e35aaad0 (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 5805ae8adbbbc3feba1e4d4e47d63026fd53f7d6
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 23 11:12:04 2009 +0100
[LINUX] Makes TSC2101 Audio In usable on APF27 + add corresponding ALSA mixer controls. It still remains a DMA problem to fix
commit e3eda5b6b3b608a4309f3b54165154945afa2468
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 23 11:09:21 2009 +0100
[LINUX] Updates patch 344
commit 2cc35ad5ed431441f4a8f1b5a4071efc8a85a746
Merge: a68f8f37e142155515ad3e912d85fe79e800d853 eb136b98483dbc452f997a12f393aec2e35aaad0
Author: Julien Boibessot <jul...@ar...>
Date: Mon Dec 21 13:47:42 2009 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit a68f8f37e142155515ad3e912d85fe79e800d853
Author: Julien Boibessot <jul...@ar...>
Date: Mon Dec 21 13:47:12 2009 +0100
[TOOLS] Cleanup imxssi debug tool and add it Audio In -> Audio Out loop option
commit 6426197a51cc4ce231b7f1101c9bd45f1b134de3
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 17 20:04:57 2009 +0100
[BUILDROOT] Add ALSA's arecord to default config
commit 31967aa93df4ea44873f93eed2ab0d08f3aebed3
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 17 16:40:47 2009 +0100
Indentation
-----------------------------------------------------------------------
Summary of changes:
.../target/device/armadeus/apf27/apf27_defconfig | 4 +-
.../2.6.29/073-armadeus-tsc2102.patch | 138 +-
...-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch | 589 +++--
.../2.6.29/095-armadeus-imx-ssi-add_driver.patch | 28 +-
.../2.6.29/344-apf27-spi_configuration.patch | 18 +-
target/linux/debug/imxssi/configure | 2649 ++++++++++++++------
target/linux/debug/imxssi/configure.ac | 4 +-
target/linux/debug/imxssi/imxssi.c | 269 ++-
8 files changed, 2499 insertions(+), 1200 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf27/apf27_defconfig b/buildroot/target/device/armadeus/apf27/apf27_defconfig
index 8a9b562..039bed8 100644
--- a/buildroot/target/device/armadeus/apf27/apf27_defconfig
+++ b/buildroot/target/device/armadeus/apf27/apf27_defconfig
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Tue Dec 8 17:26:00 2009
+# Thu Dec 17 20:01:15 2009
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
@@ -574,7 +574,7 @@ BR2_PACKAGE_ALSA_UTILS_ALSAMIXER=y
# BR2_PACKAGE_ALSA_UTILS_AMIDI is not set
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
BR2_PACKAGE_ALSA_UTILS_APLAY=y
-# BR2_PACKAGE_ALSA_UTILS_ARECORD is not set
+BR2_PACKAGE_ALSA_UTILS_ARECORD=y
# BR2_PACKAGE_ALSA_UTILS_IECSET is not set
# BR2_PACKAGE_ALSA_UTILS_ACONNECT is not set
# BR2_PACKAGE_ALSA_UTILS_APLAYMIDI is not set
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
index 0902885..086542e 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
@@ -4,14 +4,15 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/include/linux/spi/tsc2102.h 2009-11-10 13:37:50.000000000 +0100
-@@ -0,0 +1,299 @@
++++ linux-2.6.29.6/include/linux/spi/tsc2102.h 2009-12-23 10:01:01.000000000 +0100
+@@ -0,0 +1,302 @@
+/*
+ * include/linux/spi/tsc2102.h
+ *
-+ * TI TSC2102 Touchscreen, Audio and Battery control register definitions
++ * TI TSC210(1/2) Touchscreen, Audio and Battery control register definitions
+ *
+ * Copyright (c) 2005 Andrzej Zaborowski <ba...@za...>
++ * Copyright (c) 2008 Armadeus Systems <jul...@ar...>
+ *
+ * This package is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
@@ -46,15 +47,12 @@ Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
+
+#define TSC_BAT1 (1 << 0)
+#define TSC_BAT2 (1 << 1)
-+#define TSC_AUX (1 << 2)
++#define TSC_AUX (1 << 2)
+#define TSC_AUX1 (1 << 2) /* TSC2101 has 2 Aux inputs */
+#define TSC_AUX2 (1 << 3)
+#define TSC_TEMP (1 << 4)
+
-+extern u16 tsc210x_read_sync(int page, u8 address);
-+extern void tsc210x_reads_sync(int page, u8 startaddress, u16 *data,
-+ int numregs);
-+extern void tsc210x_write_sync(int page, u8 address, u16 data);
++extern u16 tsc210x_read_reg(int page, u8 address);
+
+typedef void (*tsc210x_touch_t)(int touching);
+typedef void (*tsc210x_coords_t)(int x, int y, int z1, int z2);
@@ -65,6 +63,9 @@ Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
+extern int tsc210x_ports_cb(tsc210x_ports_t handler);
+extern int tsc210x_temp1_cb(tsc210x_temp_t handler);
+
++extern int tsc210x_is_tsc2101(void);
++extern int tsc210x_is_tsc2102(void);
++
+#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE)
+extern void tsc210x_set_dac_volume(uint8_t left_ch, uint8_t right_ch);
+extern void tsc210x_set_dac_mute(int left_ch, int right_ch);
@@ -74,7 +75,9 @@ Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
+extern void tsc210x_set_i2s_master(int state);
+extern void tsc210x_set_deemphasis(int enable);
+extern void tsc210x_set_bassboost(int enable);
-+#endif // CONFIG_SOUND || CONFIG_SOUND_MODULE
++extern void tsc2101_handset_mute(int enable);
++extern void tsc2101_set_handset_gain(uint8_t gain);
++#endif
+
+extern void tsc210x_keyclick(int amplitude, int freq, int length);
+
@@ -308,12 +311,12 @@ Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
Index: linux-2.6.29.6/drivers/spi/tsc2102.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/drivers/spi/tsc2102.c 2009-11-10 13:41:13.000000000 +0100
-@@ -0,0 +1,1125 @@
++++ linux-2.6.29.6/drivers/spi/tsc2102.c 2009-12-23 10:06:02.000000000 +0100
+@@ -0,0 +1,1186 @@
+/*
+ * drivers/spi/tsc2102.c
+ *
-+ * TSC2102 interface driver.
++ * TSC2101/2 interface driver.
+ * Copyright (C) 2008 Armadeus systems (nc)
+ * -> spi communication reworked to avoid deadlock
+ * Copyright (c) 2005 Andrzej Zaborowski <ba...@za...>
@@ -442,6 +445,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+module_param_named(sensor_scan_msecs, tsc.mode_msecs, uint, 0);
+MODULE_PARM_DESC(sensor_scan_msecs, "Temperature & battery scan interval");
+
++
+void tsc210x_write_sync(int page, u8 address, u16 data)
+{
+ static struct tsc210x_spi_req req;
@@ -474,7 +478,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ __FUNCTION__, ret);
+}
+
-+void tsc210x_reads_sync(int page, u8 startaddress, u16 *data, int numregs)
++static void tsc210x_reads_sync(int page, u8 startaddress, u16 *data, int numregs)
+{
+ static struct tsc210x_spi_req req;
+ static struct spi_transfer transfer[6];
@@ -512,7 +516,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ __FUNCTION__, ret);
+}
+
-+u16 tsc210x_read_sync(int page, u8 address)
++static u16 tsc210x_read_sync(int page, u8 address)
+{
+ u16 ret;
+
@@ -521,6 +525,19 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ return ret;
+}
+
++u16 tsc210x_read_reg(int page, u8 address)
++{
++ u16 ret;
++
++ mutex_lock(&tsc.lock_sync);
++ ret = tsc210x_read_sync(page, address);
++ mutex_unlock(&tsc.lock_sync);
++
++ return ret;
++}
++EXPORT_SYMBOL_GPL(tsc210x_read_reg);
++
++/* Workqueue for TSC internal state machine */
+static void tsc_work(struct work_struct *work)
+{
+#define Z2STAT (1<<7)
@@ -586,7 +603,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ if (tsc.temp1_cb)
+ tsc.temp1_cb(tsc.temp);
+ /* switch to pintdav and TS control */
-+ tsc210x_write_sync( TSC2102_TS_ADC_CTRL,
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL,
+ TSC2102_ADC_TS_CONTROL);
+ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_PINTDAV);
+ }
@@ -693,14 +710,15 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+
+/*
+ * Volume level values should be in the range [0, 127].
-+ * Higher values mean lower volume.
++ * Higher values mean lower volume:
++ * 0 -> 0dB attenuation, 127 -> -63,5 dB attenuation (steps of -0,5dB)
+ */
+void tsc210x_set_dac_volume(uint8_t left_ch, uint8_t right_ch)
+{
+ u16 val;
+
+ if (tsc.kind == tsc2102) {
-+ /* On TSC2102, 127 means 0dB and 0 -63,5 dB */
++ /* On TSC2102, 127 means 0dB and 0 means -63,5 dB */
+ if (left_ch == 0x00 || left_ch == 0x7f)
+ left_ch ^= 0x7f;
+ if (right_ch == 0x00 || right_ch == 0x7f)
@@ -721,6 +739,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+void tsc210x_set_dac_mute(int left_ch, int right_ch)
+{
+ u16 val;
++
+ mutex_lock(&tsc.lock_sync);
+
+ val = tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL);
@@ -741,10 +760,9 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+void tsc210x_get_dac_mute(int *left_ch, int *right_ch)
+{
+ u16 val;
-+ mutex_lock(&tsc.lock_sync);
+
++ mutex_lock(&tsc.lock_sync);
+ val = tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL);
-+
+ mutex_unlock(&tsc.lock_sync);
+
+ *left_ch = !!(val & DGC_DALMU);
@@ -755,6 +773,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+void tsc210x_set_deemphasis(int enable)
+{
+ u16 val;
++
+ mutex_lock(&tsc.lock_sync);
+ val = tsc210x_read_sync(TSC210X_CODEC_POWER_CTRL);
+
@@ -785,6 +804,36 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+}
+EXPORT_SYMBOL(tsc210x_set_bassboost);
+
++void tsc2101_handset_mute(int enable)
++{
++ u16 val;
++
++ mutex_lock(&tsc.lock_sync);
++ val = tsc210x_read_sync(TSC2101_HANDSET_PGA_CTRL);
++ if (enable)
++ val |= HIGC_ADMUT_HND;
++ else
++ val &= ~HIGC_ADMUT_HND;
++ tsc210x_write_sync(TSC2101_HANDSET_PGA_CTRL, val);
++ mutex_unlock(&tsc.lock_sync);
++}
++EXPORT_SYMBOL_GPL(tsc2101_handset_mute);
++
++/* 0 -> 0dB, 127 -> 59,5dB (0.5dB stepping) */
++void tsc2101_set_handset_gain(uint8_t gain)
++{
++ u16 val;
++
++ mutex_lock(&tsc.lock_sync);
++ val = tsc210x_read_sync(TSC2101_HANDSET_PGA_CTRL);
++ val &= ~HIGC_ADPGA_HND(0xff); /* clear current gain */
++ val |= HIGC_ADPGA_HND(gain);
++ tsc210x_write_sync(TSC2101_HANDSET_PGA_CTRL, val);
++ mutex_unlock(&tsc.lock_sync);
++}
++EXPORT_SYMBOL_GPL(tsc2101_set_handset_gain);
++
++
+/* {rate, divisor (for AC1), fsref} */
+static const struct tsc210x_rate_info_s tsc210x_rates[] = {
+ /* Fsref / 6.0 */
@@ -899,7 +948,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ val &= ~AC1_DACFS(0xff) & ~AC1_ADCFS(0xff);
+ val |= AC1_DACFS(rates[i].divisor);
+ val |= AC1_ADCFS(rates[i].divisor);
-+ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, val );
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, val);
+
+ val = tsc210x_read_sync(TSC2102_AUDIO3_CTRL);
+
@@ -912,6 +961,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ }
+
+ mutex_unlock(&tsc.lock_sync);
++
+ return 0;
+}
+EXPORT_SYMBOL(tsc210x_set_rate);
@@ -925,7 +975,8 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+
+ if (state) {
+ /* 16-bit words, I2S mode, sample at Fsref */
-+ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0) );
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL,
++ AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0));
+ /* Keyclicks off, soft-stepping at normal rate */
+ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, TSC210X_KEYCLICK_OFF);
+ /* 44.1 kHz Fsref, continuous transfer mode, master DAC */
@@ -992,7 +1043,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+
+#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE)
+ /* 16-bit words, I2S mode, sample at Fsref */
-+ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, TSC210x_AUDIO1_INIT_VAL );
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, TSC210x_AUDIO1_INIT_VAL);
+ /* Keyclicks off, soft-stepping at normal rate */
+ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, TSC210X_KEYCLICK_OFF);
+ /* 48 kHz Fsref, continuous transfer mode, master DAC */
@@ -1009,9 +1060,9 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ tsc210x_write_sync(TSC2101_HANDSET_PGA_CTRL, 0x0000);
+// tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, 0x00fc);
+ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, 0xe2fc);
-+ }
-+ else
++ } else {
+ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, TSC2102_DAC_ON);
++ }
+ /* Un-mute + volume max */
+ if (tsc.kind == tsc2101)
+ tsc210x_write_sync(TSC210X_DAC_GAIN_CTRL, 0x0000);
@@ -1025,17 +1076,30 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ /* Start mode timer */
+ mod_timer(&dev->mode_timer, jiffies +
+ msecs_to_jiffies(dev->mode_msecs));
++
+ return 0;
+}
+
+/*
+ * Retrieves chip revision. Should be 1 for TSC2102 and 4 for TSC2101
+ */
-+int tsc2102_get_revision(void)
++static int tsc210x_get_revision(void)
+{
+ return AC3_REVID(tsc210x_read_sync(TSC2102_AUDIO3_CTRL));
+}
+
++int tsc210x_is_tsc2101(void)
++{
++ return tsc.kind == tsc2101;
++}
++EXPORT_SYMBOL(tsc210x_is_tsc2101);
++
++int tsc210x_is_tsc2102(void)
++{
++ return tsc.kind == tsc2102;
++}
++EXPORT_SYMBOL(tsc210x_is_tsc2102);
++
+/*
+ * Emit a short keyclick typically in order to give feedback to
+ * user on specific events.
@@ -1058,13 +1122,15 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+
+ /* Set amplitude */
+ switch (amplitude) {
-+ case 1:
-+ val |= AC2_KCLAC(4);
++ case 1:
++ val |= AC2_KCLAC(4);
+ break;
-+ case 2:
-+ val |= AC2_KCLAC(7);
++
++ case 2:
++ val |= AC2_KCLAC(7);
+ break;
-+ default:
++
++ default:
+ break;
+ }
+
@@ -1125,6 +1191,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+}
+#endif
+
++
+#ifdef CONFIG_PM
+/*
+ * Suspend the chip.
@@ -1167,12 +1234,10 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ return 0;
+
+ mutex_lock(&dev->lock_sync);
-+
+ dev->spi->dev.power.power_state = PMSG_ON;
-+
+ err = tsc2102_configure(dev);
-+
+ mutex_unlock(&dev->lock_sync);
++
+ return err;
+}
+#else
@@ -1276,7 +1341,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+
+ /* Now try to detect the chip, make first contact */
+ tsc210x_reset(); /* Seems like TSC can be messed up and needs a reset even to get revision */
-+ rev_id = tsc2102_get_revision();
++ rev_id = tsc210x_get_revision();
+ if (rev_id == 0x01) {
+ printk("TSC2102 detected\n");
+ tsc.kind = tsc2102;
@@ -1292,7 +1357,7 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ if (err)
+ goto err_timer;
+
-+ /* Register devices controlled by TSC2101 / TSC2102 */
++ /* Register devices controlled by TSC2101/TSC2102 */
+ tsc210x_ts_device.dev.platform_data = pdata;
+ tsc210x_ts_device.dev.parent = &spi->dev;
+ err = platform_device_register(&tsc210x_ts_device);
@@ -1336,7 +1401,6 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ if (pdata->apm_report)
+ apm_get_power_status = tsc2102_get_power_status;
+#endif
-+
+ if (!err)
+ goto done;
+
@@ -1412,8 +1476,8 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+static int __init tsc210x_init(void)
+{
+ int err;
-+ printk(banner);
+
++ printk(banner);
+ err = spi_register_driver(&tsc210x_driver);
+
+ return err;
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
index 44a6b64..2e6a112 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
@@ -1,13 +1,15 @@
PATCH AUTOMATICALLY GENERATED
DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-alsa.c
-+++ linux-2.6.27.13.mod/sound/arm/imx-alsa.c
-@@ -0,0 +1,668 @@
+Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-alsa.c 2009-12-23 10:40:25.000000000 +0100
+@@ -0,0 +1,670 @@
+/*
+ * sound/arm/imx-alsa.c
+ *
-+ * Alsa Driver for i.MXL / SSI
++ * Alsa Driver for i.MX1/i.MX2 SSI
+ *
+ * Copyright (C) 2008 Armadeus Systems <nic...@ar...>
+ * <jul...@ar...>
@@ -209,29 +211,29 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ int stream_id = substream->pstr->stream;
+ struct audio_stream *s = &chip->s[stream_id];
-+
-+ pr_debug("%s called\n", __func__);
++
++ pr_debug("%s called: ", __func__);
+
+ /* note: local interrupts are already disabled in the midlevel code */
+ spin_lock(&s->dma_lock);
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
-+ /* requested stream startup */
++ pr_debug("START\n");
+ imx_dma_enable(s->dma_dev);
+ break;
+
+ case SNDRV_PCM_TRIGGER_STOP:
-+ /* requested stream shutdown */
++ pr_debug("STOP\n");
+ imx_dma_disable(s->dma_dev);
+ break;
+
+ default:
-+ printk("Not supported (yet?) ALSA trigger: 0x%x\n", cmd);
++ printk("ALSA trigger 0x%x not supported (yet?)\n", cmd);
+ return -EINVAL;
+ break;
+ }
+ spin_unlock(&s->dma_lock);
-+
++
+ /* SSI activation done here */
+ return imx_ssi_trigger(substream, cmd, /*channel_info->ssi*/0);
+}
@@ -259,7 +261,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ imx_ssi_setup_unit_to_iis_slave(0);
+#else
+ imx_ssi_setup_unit_to_iis_master(0);
-+#endif /* TSC_MASTER */
++#endif
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ fifo_io = imx_ssi_get_dma_tx_address(/*channel_info->ssi*/0, 0);
@@ -291,7 +293,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+
-+ ADEBUG();
++ ADEBUG();
+ return audio_get_dma_pos(&chip->s[substream->pstr->stream]);
+}
+
@@ -303,9 +305,9 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ int err, dma_req;
+ char *type;
+ unsigned int burstlen;
-+
++
+ type = (stream_id == SNDRV_PCM_STREAM_PLAYBACK ? "Playback" : "Capture");
-+ printk ("%s %s stream @: 0x%x\n", __func__, type, (unsigned int)substream);
++ pr_debug("%s %s stream @: 0x%x\n", __func__, type, (unsigned int)substream);
+
+ chip->s[stream_id].stream = substream;
+ alsa_codec_config->codec_clock_on();
@@ -313,22 +315,21 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_playback);
+ burstlen = DMA_TXFIFO_BURST * 2;
+ dma_req = imx_ssi_get_dma_tx_channel(0, 0);
-+ printk("imx_ssi_get_dma_tx_channel = %d\n", dma_req);
++ pr_debug("imx_ssi_get_dma_tx_channel = %d\n", dma_req);
+ if (dma_req < 0)
+ return dma_req;
+ } else {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_capture);
+ burstlen = DMA_RXFIFO_BURST * 2;
-+ printk("capture not supported\n");
+ dma_req = imx_ssi_get_dma_rx_channel(0, 0);
++ pr_debug("imx_ssi_get_dma_rx_channel = %d\n", dma_req);
+ if (dma_req < 0)
+ return dma_req;
+ }
+ if ((err = snd_pcm_hw_constraint_integer(runtime,
+ SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+ return err;
-+
-+ printk("playback supported\n");
++
+ if ((err = snd_pcm_hw_constraint_list(runtime,
+ 0,
+ SNDRV_PCM_HW_PARAM_RATE,
@@ -342,15 +343,15 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+ /* configure i.MX DMA control register for given channel */
+ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
-+ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
-+ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
-+ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
-+ dma_req, 1);
++ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
++ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
++ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
++ dma_req, 1);
+ } else {
-+ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
-+ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
-+ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
-+ dma_req, 1);
++ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
++ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
++ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
++ dma_req, 1);
+ }
+ if (err < 0) {
+ printk("Cannot configure DMA for %s channel\n", type);
@@ -385,7 +386,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ kfree(channel_info->sg_list);
+
+ chip->s[substream->pstr->stream].stream = NULL;
-+
++
+ return 0;
+}
+
@@ -402,10 +403,10 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ pr_debug("%s called\n", __func__);
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ err = devdma_hw_alloc(chip[0].card->dev, substream,
++ err = devdma_hw_alloc(chip->card->dev, substream,
+ params_buffer_bytes(hw_params));
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
-+ err = devdma_hw_alloc(chip[1].card->dev, substream,
++ err = devdma_hw_alloc(chip->card->dev, substream,
+ params_buffer_bytes(hw_params));
+ if (err < 0)
+ return err;
@@ -477,9 +478,9 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ }
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ devdma_hw_free(chip[0].card->dev, substream);
++ devdma_hw_free(chip->card->dev, substream);
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
-+ devdma_hw_free(chip[1].card->dev, substream);
++ devdma_hw_free(chip->card->dev, substream);
+
+ return snd_pcm_lib_free_pages(substream);
+}
@@ -507,12 +508,12 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+{
+ struct snd_pcm *pcm;
+ int err;
-+
++
+ ADEBUG();
+ err = snd_pcm_new(imx_alsa->card,
+ CHIP_NAME,
+ device,
-+ 1, /* one playback strean */
++ 1, /* one playback stream */
+ 1, /* one capture stream */
+ &pcm);
+
@@ -541,14 +542,11 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+
+#ifdef CONFIG_PM
-+/*
-+ * Driver suspend/resume - calls alsa functions. Some hints from aaci.c
-+ */
+int snd_imx_alsa_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct snd_card_imx_codec *chip;
+ struct snd_card *card = platform_get_drvdata(pdev);
-+
++
+ if (card->power_state != SNDRV_CTL_POWER_D3hot) {
+ chip = card->private_data;
+ if (chip->card->power_state != SNDRV_CTL_POWER_D3hot) {
@@ -559,6 +557,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ snd_tsc210x_suspend_mixer();
+ }
+ }
++
+ return 0;
+}
+
@@ -575,9 +574,9 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ snd_tsc210x_resume_mixer();
+ }
+ }
++
+ return 0;
+}
-+
+#endif /* CONFIG_PM */
+
+/* module init & exit */
@@ -602,10 +601,15 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ }
+
+ alsa_codec_config = config;
++ if (alsa_codec_config == NULL) {
++ pr_err("No config data available. Giving up\n");
++ err = -ENODEV;
++ goto nodev1;
++ }
+ alsa_codec_config->codec_clock_setup();
+ alsa_codec_config->codec_clock_on();
+
-+ if (alsa_codec_config && alsa_codec_config->codec_configure_dev)
++ if (alsa_codec_config->codec_configure_dev)
+ alsa_codec_config->codec_configure_dev();
+
+ alsa_codec_config->codec_clock_off();
@@ -651,7 +655,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+ return 0;
+
-+nodev2:
++nodev2:
+ snd_card_free(card);
+nodev1:
+ return err;
@@ -661,36 +665,31 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+{
+ struct snd_card *card = platform_get_drvdata(pdev);
+ struct snd_card_imx_codec *chip = card->private_data;
-+
++
+ snd_card_free(card);
+
+ alsa_codec = NULL;
+ card->private_data = NULL;
+ kfree(chip);
-+
++
+ platform_set_drvdata(pdev, NULL);
+
+ return 0;
+}
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-alsa-dma.h
-+++ linux-2.6.27.13.mod/sound/arm/imx-alsa-dma.h
-@@ -0,0 +1,50 @@
-+/*
+Index: linux-2.6.29.6/sound/arm/imx-alsa-dma.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-alsa-dma.h 2009-12-23 10:40:25.000000000 +0100
+@@ -0,0 +1,46 @@
++/*
+ * linux/sound/arm/imx/imx-alsa-dma.h
+ *
+ * Common audio DMA handling for the iMX processors
+ *
+ * Copyright (C) 2008 Nicolas Colombain <nic...@ar...>
-+ *
+ * Copyright (C) 2006 Mika Laitio <la...@cc...>
-+ *
+ * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
-+ *
+ * Copyright (C) 2004 Texas Instruments, Inc.
-+ *
+ * Copyright (C) 2000, 2001 Nicolas Pitre <ni...@ca...>
+ *
+ * This package is free software; you can redistribute it and/or modify
@@ -728,15 +727,14 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+#endif
+
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-alsa-tsc2102.c
-+++ linux-2.6.27.13.mod/sound/arm/imx-alsa-tsc2102.c
-@@ -0,0 +1,393 @@
+Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c 2009-12-23 10:40:25.000000000 +0100
+@@ -0,0 +1,444 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.c
-+ *
++ *
+ * Alsa codec driver for TSC210x chip for i.MX platforms.
+ *
+ * Copyright (c) 2008 Jorasse <jo...@ar...>
@@ -756,9 +754,13 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+#include <linux/clk.h>
+#include <linux/slab.h>
+#ifdef CONFIG_PM
-+#include <linux/pm.h>
++# include <linux/pm.h>
+#endif
+#include <linux/spi/tsc2102.h>
++#ifdef CONFIG_DEBUG_FS
++# include <linux/debugfs.h>
++# include <linux/seq_file.h>
++#endif
+
+#include <mach/hardware.h>
+#include <mach/imx-alsa.h>
@@ -789,7 +791,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_KNOT)
+
-+static struct snd_pcm_hardware tsc2102_snd_imx_alsa_playback = {
++static struct snd_pcm_hardware tsc210x_snd_imx_alsa_playback = {
+ .info = SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP |
+ SNDRV_PCM_INFO_MMAP_VALID,
@@ -801,109 +803,30 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ .channels_max = 2,
+ .buffer_bytes_max = 32 * 1024,
+ .period_bytes_min = 64,
-+ .period_bytes_max = 8 * 1024, //test
++ .period_bytes_max = 8 * 1024, /* test */
+ .periods_min = 2,
+ .periods_max = 255,
+ .fifo_size = 0,
+};
+
-+// #define DUMP_TSC2102_AUDIO_REGISTERS 1
-+#ifdef DUMP_TSC2102_AUDIO_REGISTERS
-+static void dump_tsc2102_audio_regs(int show_coef)
-+{
-+ printk("TSC2102_AUDIO1_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_AUDIO1_CTRL));
-+ printk("TSC210X_DAC_GAIN_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL));
-+// #ifdef CONFIG_TSC2101
-+ printk("TSC2101_HEADSET_GAIN_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_HEADSET_GAIN_CTRL));
-+ printk("TSC2101_MIXER_PGA_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_MIXER_PGA_CTRL));
-+// #endif
-+ printk("TSC2102_AUDIO2_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_AUDIO2_CTRL));
-+ printk("TSC210X_CODEC_POWER_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC210X_CODEC_POWER_CTRL));
-+ printk("TSC2102_AUDIO3_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_AUDIO3_CTRL));
-+ if (show_coef) {
-+ printk("TSC2102_LCH_BASS_BOOST_N0 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N0));
-+ printk("TSC2102_LCH_BASS_BOOST_N1 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N1));
-+ printk("TSC2102_LCH_BASS_BOOST_N2 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N2));
-+ printk("TSC2102_LCH_BASS_BOOST_N3 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N3));
-+ printk("TSC2102_LCH_BASS_BOOST_N4 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N4));
-+ printk("TSC2102_LCH_BASS_BOOST_N5 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_N5));
-+ printk("TSC2102_LCH_BASS_BOOST_D1 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_D1));
-+ printk("TSC2102_LCH_BASS_BOOST_D2 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_D2));
-+ printk("TSC2102_LCH_BASS_BOOST_D4 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_D4));
-+ printk("TSC2102_LCH_BASS_BOOST_D5 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_LCH_BASS_BOOST_D5));
-+ printk("TSC2102_RCH_BASS_BOOST_N0 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N0));
-+ printk("TSC2102_RCH_BASS_BOOST_N1 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N1));
-+ printk("TSC2102_RCH_BASS_BOOST_N2 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N2));
-+ printk("TSC2102_RCH_BASS_BOOST_N3 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N3));
-+ printk("TSC2102_RCH_BASS_BOOST_N4 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N4));
-+ printk("TSC2102_RCH_BASS_BOOST_N5 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_N5));
-+ printk("TSC2102_RCH_BASS_BOOST_D1 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_D1));
-+ printk("TSC2102_RCH_BASS_BOOST_D2 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_D2));
-+ printk("TSC2102_RCH_BASS_BOOST_D4 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_D4));
-+ printk("TSC2102_RCH_BASS_BOOST_D5 = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_RCH_BASS_BOOST_D5));
-+ }
-+ printk("TSC210X_PLL1_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC210X_PLL1_CTRL));
-+ printk("TSC210X_PLL2_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC210X_PLL2_CTRL));
-+ printk("TSC2102_AUDIO4_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2102_AUDIO4_CTRL));
-+// #ifdef CONFIG_TSC2101
-+ printk("TSC2101_HANDSET_PGA_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_HANDSET_PGA_CTRL));
-+ printk("TSC2101_CELL_BUZZER_PGA_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_CELL_BUZZER_PGA_CTRL));
-+ printk("TSC2101_AUDIO5_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_AUDIO5_CTRL));
-+ printk("TSC2101_AUDIO6_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_AUDIO6_CTRL));
-+ printk("TSC2101_AUDIO7_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_AUDIO7_CTRL));
-+ printk("TSC2101_GPIO_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_GPIO_CTRL));
-+ printk("TSC2101_AGP_CP_IN_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_AGP_CPIN_CTRL));
-+ printk("TSC2101_POWERDOWN_STATUS = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_POWERDOWN_STATUS));
-+ printk("TSC2101_MIC_AGC_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_MIC_AGC_CTRL));
-+ printk("TSC2101_CELL_PHONE_AGC_CTRL = 0x%04x\n",
-+ tsc210x_read_sync(TSC2101_CELL_PHONE_AGC_CTRL));
-+// #endif /* CONFIG_TSC2101 */
-+}
-+#else
-+static void dump_tsc2102_audio_regs(int show_coef)
-+{
-+ return;
-+}
-+#endif /* DUMP_TSC2102_AUDIO_REGISTERS */
++/* Only TSC2101 has audio in capability */
++static struct snd_pcm_hardware tsc2101_snd_imx_alsa_capture = {
++ .info = SNDRV_PCM_INFO_INTERLEAVED |
++ SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP |
++ SNDRV_PCM_INFO_MMAP_VALID,
++ .formats = SNDRV_PCM_FMTBIT_S16_LE,
++ .rates = IMX_SSI_RATES,
++ .rate_min = 8000,
++ .rate_max = 48000,
++ .channels_min = 1,
++ .channels_max = 1,
++ .buffer_bytes_max = 32 * 1024,
++ .period_bytes_min = 64,
++ .period_bytes_max = 8 * 1024, /* test */
++ .periods_min = 2,
++ .periods_max = 255,
++ .fifo_size = 0,
++};
+
+/*
+ * ALSA operations according to board file
@@ -916,7 +839,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ */
+static void tsc2102_set_samplerate(long sample_rate)
+{
-+ pr_debug("%s %d\n", __func__, sample_rate);
++ pr_debug("%s %li\n", __func__, sample_rate);
+
+#ifndef TSC_MASTER
+ int clkgdv = 0;
@@ -941,7 +864,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+#else
+ /* Set the sample rate on the i.MXL SSI */
-+ printk("erreur 1");
++ printk("erreur 1");
+ imx_get_perclk3();
+ clkgdv = CODEC_CLOCK / (sample_rate * (DEFAULT_BITPERSAMPLE * 2 - 1));
+ if (clkgdv)
@@ -954,7 +877,6 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+#endif
+
+ current_rate = sample_rate;
-+ dump_tsc2102_audio_regs(0);
+}
+
+static void tsc2102_configure(void)
@@ -988,7 +910,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+no clock management*/
+
+#ifdef TSC_MASTER
-+
++
+#endif
+
+/* if (clk_get_usecount(tsc2102_bclk) > 0 &&
@@ -1034,9 +956,10 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ return DEFAULT_SAMPLE_RATE;
+}
+
++
+#ifdef CONFIG_PM
-+static int snd_imx_alsa_tsc2102_suspend(
-+ struct platform_device *pdev, pm_message_t state)
++static int snd_imx_alsa_tsc2102_suspend(struct platform_device *pdev,
++ pm_message_t state)
+{
+ tsc210x_dac_power(0);
+ current_rate = 0;
@@ -1058,6 +981,126 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+}
+#endif /* CONFIG_PM */
+
++
++#ifdef CONFIG_DEBUG_FS
++static int tsc210x_debug_show(struct seq_file *s, void *unused)
++{
++ seq_printf(s, "TSC210x registers content:\n");
++
++ seq_printf(s, "TSC2102_AUDIO1_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_AUDIO1_CTRL));
++ seq_printf(s, "TSC210X_DAC_GAIN_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC210X_DAC_GAIN_CTRL));
++
++ if (tsc210x_is_tsc2101()) {
++ seq_printf(s, "TSC2101_HEADSET_GAIN_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_HEADSET_GAIN_CTRL));
++ seq_printf(s, "TSC2101_MIXER_PGA_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_MIXER_PGA_CTRL));
++ }
++ seq_printf(s, "TSC2102_AUDIO2_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_AUDIO2_CTRL));
++ seq_printf(s, "TSC210X_CODEC_POWER_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC210X_CODEC_POWER_CTRL));
++ seq_printf(s, "TSC2102_AUDIO3_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_AUDIO3_CTRL));
++
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N0 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N0));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N1 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N1));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N2 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N2));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N3 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N3));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N4 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N4));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_N5 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_N5));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_D1 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_D1));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_D2 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_D2));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_D4 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_D4));
++ seq_printf(s, "TSC2102_LCH_BASS_BOOST_D5 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_LCH_BASS_BOOST_D5));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N0 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N0));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N1 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N1));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N2 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N2));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N3 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N3));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N4 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N4));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_N5 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_N5));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_D1 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_D1));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_D2 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_D2));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_D4 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_D4));
++ seq_printf(s, "TSC2102_RCH_BASS_BOOST_D5 = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_RCH_BASS_BOOST_D5));
++
++ seq_printf(s, "TSC210X_PLL1_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC210X_PLL1_CTRL));
++ seq_printf(s, "TSC210X_PLL2_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC210X_PLL2_CTRL));
++ seq_printf(s, "TSC2102_AUDIO4_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2102_AUDIO4_CTRL));
++ if (tsc210x_is_tsc2101()) {
++ seq_printf(s, "TSC2101_HANDSET_PGA_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_HANDSET_PGA_CTRL));
++ seq_printf(s, "TSC2101_CELL_BUZZER_PGA_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_CELL_BUZZER_PGA_CTRL));
++ seq_printf(s, "TSC2101_AUDIO5_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_AUDIO5_CTRL));
++ seq_printf(s, "TSC2101_AUDIO6_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_AUDIO6_CTRL));
++ seq_printf(s, "TSC2101_AUDIO7_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_AUDIO7_CTRL));
++ seq_printf(s, "TSC2101_GPIO_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_GPIO_CTRL));
++ seq_printf(s, "TSC2101_AGP_CP_IN_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_AGP_CPIN_CTRL));
++ seq_printf(s, "TSC2101_POWERDOWN_STATUS = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_POWERDOWN_STATUS));
++ seq_printf(s, "TSC2101_MIC_AGC_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_MIC_AGC_CTRL));
++ seq_printf(s, "TSC2101_CELL_PHONE_AGC_CTRL = 0x%04x\n",
++ tsc210x_read_reg(TSC2101_CELL_PHONE_AGC_CTRL));
++ }
++
++ return 0;
++}
++
++static int tsc210x_debug_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, tsc210x_debug_show, NULL);
++}
++
++static const struct file_operations tsc210x_debug_operations = {
++ .open = tsc210x_debug_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++
++static int tsc210x_debugfs_init(void)
++{
++ /* /sys/kernel/debug/tsc210x */
++ (void) debugfs_create_file("tsc210x", S_IFREG | S_IRUGO, NULL, NULL,
++ &tsc210x_debug_operations);
++
++ return 0;
++}
++#endif /* CONFIG_DEBUG_FS */
++
++
+static int __init snd_imx_alsa_tsc210x_probe(struct platform_device *pdev)
+{
+ int ret;
@@ -1072,7 +1115,9 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ codec_cfg->hw_constraints_rates =
+ &tsc2102_hw_constraints_rates;
+ codec_cfg->snd_imx_alsa_playback =
-+ &tsc2102_snd_imx_alsa_playback;
++ &tsc210x_snd_imx_alsa_playback;
++ codec_cfg->snd_imx_alsa_capture =
++ &tsc2101_snd_imx_alsa_capture;
+ codec_cfg->codec_configure_dev = tsc2102_configure;
+ codec_cfg->codec_set_samplerate = tsc2102_set_samplerate;
+ codec_cfg->codec_clock_setup = tsc2102_clock_setup;
@@ -1082,10 +1127,14 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ tsc2102_get_default_samplerate;
+ /* forward codec config to PCM layer */
+ ret = snd_imx_alsa_post_probe(pdev, codec_cfg);
-+ } else
++ } else {
+ ret = -ENODEV;
++ }
++
++#ifdef CONFIG_DEBUG_FS
++ tsc210x_debugfs_init();
++#endif
+
-+ dump_tsc2102_audio_regs(0);
+ return ret;
+}
+
@@ -1102,7 +1151,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+#ifdef CONFIG_PM
+ .suspend = snd_imx_alsa_tsc2102_suspend,
+ .resume = snd_imx_alsa_tsc2102_resume,
-+#endif /* CONFIG_PM */
++#endif
+ .driver = {
+ .name = "tsc210x-alsa",
+ },
@@ -1127,15 +1176,14 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+module_init(imx_alsa_tsc210x_init);
+module_exit(imx_alsa_tsc210x_exit);
+
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-alsa-tsc2102.h
-+++ linux-2.6.27.13.mod/sound/arm/imx-alsa-tsc2102.h
-@@ -0,0 +1,46 @@
+Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.h 2009-12-23 10:40:25.000000000 +0100
+@@ -0,0 +1,48 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.h
-+ *
++ *
+ * Alsa codec driver for TSC2102 chip for IMX1 platforms.
+ *
+ * Copyright (c) 2008 Jorasse <jo...@ar...>
@@ -1174,17 +1222,18 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+#define OUTPUT_VOLUME_MIN 0x7f /* 1111111 = -63.5 dB */
+#define OUTPUT_VOLUME_MAX 0x00 /* 0000000 */
+#define OUTPUT_VOLUME_RANGE (OUTPUT_VOLUME_MIN - OUTPUT_VOLUME_MAX)
-+
+#define DEFAULT_OUTPUT_VOLUME 90 /* Default output volume */
+
++#define INPUT_HND_VOLUME_RANGE (0x7f)
++#define DEFAULT_INPUT_HND_VOLUME 50
++
+#endif /* IMX_ALSA_TSC2102_H_ */
+
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-alsa-tsc2102-mixer.c
-+++ linux-2.6.27.13.mod/sound/arm/imx-alsa-tsc2102-mixer.c
-@@ -0,0 +1,295 @@
+Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102-mixer.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-alsa-tsc2102-mixer.c 2009-12-23 10:57:31.000000000 +0100
+@@ -0,0 +1,425 @@
+/*
+ * sound/arm/imx-alsa-tsc2102-mixer.c
+ *
@@ -1226,7 +1275,10 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+
+#include "imx-alsa-tsc2102.h"
+
++/* Audio Out: */
+static int vol[2], mute[2], filter[2];
++/* Audio In: */
++static int hnd_vol, hnd_mute;
+
+/*
+ * Converts the Alsa mixer volume (0 - 100) to actual Digital
@@ -1242,42 +1294,68 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+{
+ int lch, rch;
+
-+ if (left_ch > 100)
++ if (left_ch > 100) {
+ vol[0] = 100;
-+ else if (left_ch < 0)
++ } else if (left_ch < 0) {
+ vol[0] = 0;
-+ else
++ } else {
+ vol[0] = left_ch;
++ }
+ lch = OUTPUT_VOLUME_MIN - vol[0] *
+ (OUTPUT_VOLUME_MIN - OUTPUT_VOLUME_MAX) / 100;
+
-+ if (right_ch > 100)
++ if (right_ch > 100) {
+ vol[1] = 100;
-+ else if (right_ch < 0)
++ } else if (right_ch < 0) {
+ vol[1] = 0;
-+ else
++ } else {
+ vol[1] = right_ch;
++ }
+ rch = OUTPUT_VOLUME_MIN - vol[1] *
+ (OUTPUT_VOLUME_MIN - OUTPUT_VOLUME_MAX) / 100;
+
+ tsc210x_set_dac_volume(lch, rch);
+}
+
++/* Audio In is amplified, not attenuated like Audio Out */
++static void set_handset_volume(int volume)
++{
++ uint8_t gain;
++
++ if (volume > 100) {
++ hnd_vol = 100;
++ } else if (volume < 0) {
++ hnd_vol = 0;
++ } else {
++ hnd_vol = volume;
++ }
++ gain = (hnd_vol * INPUT_HND_VOLUME_RANGE) / 100;
++
++ tsc2101_set_handset_gain(gain);
++}
++
+void init_playback_targets(void)
+{
+ set_dac_gain_stereo(DEFAULT_OUTPUT_VOLUME, DEFAULT_OUTPUT_VOLUME);
++ if (tsc210x_is_tsc2101())
++ set_handset_volume(DEFAULT_INPUT_HND_VOLUME);
+
-+ /* Unmute */
++ /* unmute Audio Out */
+ tsc210x_set_dac_mute(0, 0);
-+
+ mute[0] = mute[1] = 0;
++ /* mute Audio In */
++ if (tsc210x_is_tsc2101()) {
++ tsc2101_handset_mute(1);
++ hnd_mute = 1;
++ }
++
+ filter[0] = filter[1] = 0;
+}
+
+/*
+ * Initializes TSC210x and playback target.
+ */
-+void snd_imx_init_mixer(void)
++static void snd_tsc210x_init_mixer(void)
+{
+ FN_IN;
+
@@ -1293,6 +1371,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ uinfo->count = 2;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 100;
++
+ return 0;
+}
+
@@ -1311,6 +1390,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ set_dac_gain_stereo(
+ ucontrol->value.integer.value[0], /* L */
+ ucontrol->value.integer.value[1]); /* R */
++
+ return 1;
+}
+
@@ -1321,6 +1401,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ uinfo->count = 2;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
++
+ return 0;
+}
+
@@ -1334,12 +1415,13 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+}
+
+static int __pcm_playback_switch_put(
-+ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
+ mute[0] = (ucontrol->value.integer.value[0] == 0); /* L */
+ mute[1] = (ucontrol->value.integer.value[1] == 0); /* R */
+
+ tsc210x_set_dac_mute(mute[0], mute[1]);
++
+ return 1;
+}
+
@@ -1350,6 +1432,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
++
+ return 0;
+}
+
@@ -1357,15 +1440,16 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = filter[0];
++
+ return 0;
+}
+
+static int __pcm_playback_deemphasis_put(
-+ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
+ filter[0] = (ucontrol->value.integer.value[0] > 0);
-+
+ tsc210x_set_deemphasis(filter[0]);
++
+ return 1;
+}
+
@@ -1376,6 +1460,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
++
+ return 0;
+}
+
@@ -1383,19 +1468,79 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = filter[1];
++
+ return 0;
+}
+
+static int __pcm_playback_bassboost_put(
-+ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
+ filter[1] = (ucontrol->value.integer.value[0] > 0);
-+
+ tsc210x_set_bassboost(filter[1]);
++
+ return 1;
+}
+
-+static struct snd_kcontrol_new tsc2102_control[] __devinitdata = {
++/* Capture controls (only available on TSC2101) */
++
++static int __handset_capture_volume_info(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
++{
++ uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
++ uinfo->count = 1; /* Mono */
++ uinfo->value.integer.min = 0;
++ uinfo->value.integer.max = 100;
++
++ return 0;
++}
++
++static int __handset_capture_volume_get(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++{
++ ucontrol->value.integer.value[0] = hnd_vol;
++
++ return 0;
++}
++
++static int __handset_capture_volume_put(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++{
++ set_handset_volume(ucontrol->value.integer.value[0]); /* hnd_vol mod. here */
++
++ return 1;
++}
++
++static int __handset_capture_switch_info(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
++{
++ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
++ uinfo->count = 1;
++ uinfo->value.integer.min = 0;
++ uinfo->value.integer.max = 1;
++
++ return 0;
++}
++
++static int __handset_capture_switch_get(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++{
++ ucontrol->value.integer.value[0] = !hnd_mute;
++
++ return 0;
++}
++
++static int __handset_capture_switch_put(
++ struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
++{
++ hnd_mute = (ucontrol->value.integer.value[0] == 0);
++
++ tsc2101_handset_mute(hnd_mute);
++
++ return 1;
++}
++
++
++static struct snd_kcontrol_new tsc210x_control[] __devinitdata = {
+ {
+ .name = "Master Playback Volume",
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1434,6 +1579,28 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ },
+};
+
++static struct snd_kcontrol_new tsc2101_control[] __devinitdata = {
++ {
++ .name = "Handset Capture Volume",
++ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
++ .index = 0,
++ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
++ .info = __handset_capture_volume_info,
++ .get = __handset_capture_volume_get,
++ .put = __handset_capture_volume_put,
++ },
++ {
++ .name = "Handset Capture Switch",
++ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
++ .index = 0,
++ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
++ .info = __handset_capture_switch_info,
++ .get = __handset_capture_switch_get,
++ .put = __handset_capture_switch_put,
++ },
++};
++
++
+#ifdef CONFIG_PM
+void snd_tsc210x_suspend_mixer(void)
+{
@@ -1444,13 +1611,19 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+{
+ /* The chip was reset, restore the last used values */
+ set_dac_gain_stereo(vol[0], vol[1]);
++ if (tsc210x_is_tsc2101())
++ set_handset_volume(hnd_vol);
+
+ tsc210x_set_dac_mute(mute[0], mute[1]);
++ if (tsc210x_is_tsc2101())
++ tsc2101_handset_mute(hnd_mute);
++
+ tsc210x_set_deemphasis(filter[0]);
+ tsc210x_set_bassboost(filter[1]);
+}
+#endif
+
++
+/* To be called by upper layer to add a tsc210x mixer to a given soundcard */
+int snd_imx_mixer(struct snd_card_imx_codec *tsc210x)
+{
@@ -1460,19 +1633,25 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+ return -EINVAL;
+
+ /* TSC2102/TSC2101 common part */
-+ for (i = 0; i < ARRAY_SIZE(tsc2102_control); i ++) {
++ for (i = 0; i < ARRAY_SIZE(tsc210x_control); i ++) {
+ err = snd_ctl_add(tsc210x->card,
-+ snd_ctl_new1(&tsc2102_control[i],
++ snd_ctl_new1(&tsc210x_control[i],
+ tsc210x->card));
-+
+ if (err < 0)
+ return err;
+ }
+
+ /* TSC2101 specific part */
-+ /* TBDL */
-+
-+ snd_imx_init_mixer();
++ if (tsc210x_is_tsc2101()) {
++ for (i = 0; i < ARRAY_SIZE(tsc2101_control); i ++) {
++ err = snd_ctl_add(tsc210x->card,
++ snd_ctl_new1(&tsc2101_control[i],
++ tsc210x->card));
++ if (err < 0)
++ return err;
++ }
++ }
++ snd_tsc210x_init_mixer();
+
+ return 0;
+}
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/095-armadeus-imx-ssi-add_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/095-armadeus-imx-ssi-add_driver.patch
index 7fcbac4..8669902 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/095-armadeus-imx-ssi-add_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/095-armadeus-imx-ssi-add_driver.patch
@@ -1,8 +1,10 @@
PATCH AUTOMATICALLY GENERATED
DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-ssi.c
-+++ linux-2.6.27.13.mod/sound/arm/imx-ssi.c
+Index: linux-2.6.29.6/sound/arm/imx-ssi.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-ssi.c 2009-12-17 17:02:50.000000000 +0100
@@ -0,0 +1,511 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -69,7 +71,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+}
+
+#ifdef DEBUG
-+static void dump_ssi_registers(void)
++static void dump_ssi_registers(void)
+{
+ printk("SSI_STX: 0x%x\n", SSI_STX);
+ printk("SSI_SRX: 0x%x\n", SSI_SRX);
@@ -156,7 +158,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+// SSI_STCR_TFSL | /* one-bit-long-frame */
+// SSI_STCR_TEFS, /* shift */
+// SSI_STCR, id);
-+//
++//
+// set_reg(SSI_SRCR_RFEN0 | /* FIFO 0 enabled */
+// SSI_SRCR_RXBIT0 |
+// SSI_SRCR_RSCKP | /* capture @rising edge */
@@ -515,11 +517,10 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+MODULE_AUTHOR("Julien Boibessot, <jul...@ar...>");
+MODULE_DESCRIPTION("i.MX SSI Driver");
+MODULE_LICENSE("GPL");
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/sound/arm/imx-ssi.h
-+++ linux-2.6.27.13.mod/sound/arm/imx-ssi.h
+Index: linux-2.6.29.6/sound/arm/imx-ssi.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/sound/arm/imx-ssi.h 2009-12-17 14:48:27.000000000 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -561,11 +562,10 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+#define DMA_RXFIFO_BURST 0x4
+
+#endif /* __SOUND_ARM_IMX_SSI_H */
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/include/mach/imx_ssi.h
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/include/mach/imx_ssi.h
+Index: linux-2.6.29.6/arch/arm/mach-imx/include/mach/imx_ssi.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/arch/arm/mach-imx/include/mach/imx_ssi.h 2009-12-17 14:48:27.000000000 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
index d468ee4..b725de8 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/344-apf27-spi_configuration.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/apf27-dev.c 2009-12-18 19:33:56.000000000 +0100
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-18 19:33:57.000000000 +0100
-@@ -397,15 +397,17 @@
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/apf27-dev.c 2009-12-17 19:43:17.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2009-12-17 19:43:17.000000000 +0100
+@@ -371,15 +371,17 @@
#endif /* CONFIG_SERIAL_IMX_UART6 */
@@ -22,7 +22,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
static int mxc_cspi1_pins[] = {
/* PD19_PF_CSPI2_SS2,
PD20_PF_CSPI2_SS1, Preferably use CS pin as GPIO
-@@ -414,11 +416,25 @@
+@@ -388,11 +390,25 @@
PD23_PF_CSPI2_MISO,
PD24_PF_CSPI2_MOSI
};
@@ -49,7 +49,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
}
static int gpio_spi0_inactive(struct platform_device *pdev)
-@@ -426,11 +442,13 @@
+@@ -400,11 +416,13 @@
mxc_gpio_release_multiple_pins(mxc_cspi0_pins, ARRAY_SIZE(mxc_cspi0_pins));
return 0;
}
@@ -64,7 +64,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
}
static int gpio_spi1_inactive(struct platform_device *pdev)
-@@ -438,21 +456,48 @@
+@@ -412,21 +430,48 @@
mxc_gpio_release_multiple_pins(mxc_cspi1_pins, ARRAY_SIZE(mxc_cspi1_pins));
return 0;
}
@@ -113,8 +113,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+
- /* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI1) */
-@@ -501,7 +546,6 @@
+ /* APF27Dev has an optionnal 7 channels 10 bits ADC (SPI) */
+@@ -475,7 +520,6 @@
};
#endif /* CONFIG_ARMADEUS_MAX1027 */
@@ -122,7 +122,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
/* APF27Dev has a SPI Touchscreen controller */
#define TSC2101_INT 17
#define TSC2101_CS (GPIO_PORTD | 21) /* SPI2_SS0 used as GPIO */
-@@ -1077,10 +1121,17 @@
+@@ -1048,10 +1092,17 @@
i2c_register_board_info(1, apf27dev_i2c_devices_bus1,
ARRAY_SIZE(apf27dev_i2c_devices_bus1));
#endif
diff --git a/target/linux/debug/imxssi/configure b/target/linux/debug/imxssi/configure
index 7ccda3e..5738f1d 100755
--- a/target/linux/debug/imxssi/configure
+++ b/target/linux/debug/imxssi/configure
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for imxssi 0.2.
+# Generated by GNU Autoconf 2.63 for imxssi 0.3.
#
# Report bugs to <su...@ar...>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
@@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
@@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
# Support unset when possible.
@@ -65,8 +93,6 @@ fi
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
@@ -89,7 +115,7 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
@@ -102,17 +128,10 @@ PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev...
[truncated message content] |