[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-82-gd6434b7
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2009-12-30 11:12:30
|
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 d6434b70c90ca507ffeb0070646111788c05ee91 (commit)
via 10adc39d1230d82b09b6fd7e9c9d41a953498c29 (commit)
via e240fb8b8ad1e93857935552642d8a8a20100471 (commit)
via d47dc7ac641ecb1ad4cd52ac5ac62d698fb86d5d (commit)
via 679f5e03948dc28a679a1652495b5ef7c255aa1b (commit)
via bde32d62cf82fbd635ff8d20d1ae2b36c5d23ad4 (commit)
from a52acec7ba7be66ac964a57ce64bd1d6c034e17a (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 d6434b70c90ca507ffeb0070646111788c05ee91
Merge: 10adc39d1230d82b09b6fd7e9c9d41a953498c29 a52acec7ba7be66ac964a57ce64bd1d6c034e17a
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 30 12:11:21 2009 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 10adc39d1230d82b09b6fd7e9c9d41a953498c29
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 30 12:06:21 2009 +0100
[LINUX] Add version number to tsc210x alsa pcm driver
commit e240fb8b8ad1e93857935552642d8a8a20100471
Author: Julien Boibessot <jul...@ar...>
Date: Tue Dec 29 23:19:47 2009 +0100
[LINUX] tsc2101: has a mono ADC but transmit data in 2 I2S channels to i.MX
commit d47dc7ac641ecb1ad4cd52ac5ac62d698fb86d5d
Author: Julien Boibessot <jul...@ar...>
Date: Tue Dec 29 19:42:54 2009 +0100
[TOOLS] quiltify.sh: Correct date of renamed dir
commit 679f5e03948dc28a679a1652495b5ef7c255aa1b
Author: Julien Boibessot <jul...@ar...>
Date: Tue Dec 29 18:36:57 2009 +0100
[LINUX] tsc2101/ALSA: makes DMA (for audio in) work
commit bde32d62cf82fbd635ff8d20d1ae2b36c5d23ad4
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 23 14:46:21 2009 +0100
[LINUX] max9768: add possibility to read back internal values through /sys/ (were write only before)
-----------------------------------------------------------------------
Summary of changes:
...-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch | 114 +++++++++-----------
.../2.6.29/095-armadeus-imx-ssi-add_driver.patch | 28 +++--
...304-apf27-armadeus-improve_mx2-ssi_driver.patch | 101 ++++++++++++++---
scripts/quiltify.sh | 2 +-
target/linux/modules/max9768/max9768.c | 54 ++++++++--
5 files changed, 199 insertions(+), 100 deletions(-)
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 2e6a112..6ecdcea 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,11 +1,11 @@
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)
-Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+Index: linux-2.6.29.6.mod/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 @@
++++ linux-2.6.29.6.mod/sound/arm/imx-alsa.c 2009-12-30 12:01:39.000000000 +0100
+@@ -0,0 +1,665 @@
+/*
+ * sound/arm/imx-alsa.c
+ *
@@ -36,6 +36,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
++
+#define DEBUG
+
+#include <linux/platform_device.h>
@@ -51,26 +52,24 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+#ifdef CONFIG_ARCH_MX2
+#include <mach/dma-mx1-mx2.h>
-+#include "imx2-ssi.h"
+#include <mach/imx_sound.h>
+#include "imx2-dam.h"
+#else
+#include <mach/imx-dma.h>
-+#include "imx-ssi.h"
+#endif
++#include "imx-ssi.h"
+
+#include "devdma.h"
+
-+#define DRIVER_NAME "imx-alsa"
++#define DRIVER_NAME "imx-pcm"
++#define DRIVER_VERSION "0.4"
+#define TSC_MASTER
+
-+#define SSI_DMA_BLR_TRANSMIT 16 /* (3*2) DMA Burst Length (in bytes) */
-+#define SSI_DMA_BLR 8
+
+MODULE_AUTHOR("Nicolas Colombain / Julien Boibessot - Armadeus Systems");
++MODULE_DESCRIPTION("i.MX1/L/2 PCM driver for ALSA");
+MODULE_LICENSE("GPL");
-+MODULE_DESCRIPTION("i.MX1/L PCM driver for ALSA");
-+MODULE_ALIAS("iMX_alsa_ssi");
++MODULE_ALIAS("platform:imx-pcm");
+
+static struct snd_card_imx_codec *alsa_codec = NULL;
+static struct imx_alsa_codec_config *alsa_codec_config = NULL;
@@ -91,13 +90,12 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ (unsigned long)channel_info->base;*/
+ s->periods++;
+ s->periods %= runtime->periods;
-+
+ snd_pcm_period_elapsed(substream);
+ }
+}
+
-+/* called when the DMA unit has finished the buffer.
-+ * it should not happen, but whith a playback or capturing
++/* Called when the DMA unit has finished the buffer.
++ * It should not happen, but whith a playback or capturing
+ * size of 2^32 bytes it will happen!
+ */
+static void snd_imx_dma_callback(int channel, void *data)
@@ -114,7 +112,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+/* Called by the DMA framework when an error has occured */
+static void snd_imx_dma_err_handler(int channel, void *data, int err)
+{
-+ printk("%s %d %d\n", __func__, channel, err);
++ pr_debug("%s %d %d\n", __func__, channel, err);
+
+ printk("DMA timeout on channel %d -%s%s%s%s%s\n",
+ channel,
@@ -131,7 +129,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+static int snd_imx_dma_request(struct audio_stream *s)
+{
+ int err=0, chan=0;
-+ ADEBUG();
+
+ chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
+ if (chan < 0) {
@@ -160,6 +157,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+ pr_debug("snd_imx_dma_request done (%d)\n", s->dma_dev);
+ imx_dma_disable(s->dma_dev);
++
+ return 0;
+
+on_error_2:
@@ -179,7 +177,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ unsigned int offset;
+ unsigned long flags;
-+ ADEBUG();
+
+ /* this must be called w/ interrupts locked as requested in dma.c */
+ spin_lock_irqsave(&s->dma_lock, flags);
@@ -189,7 +186,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+ /* Now, the position related to the end of that period */
+// offset = bytes_to_frames(runtime, s->offset) + (runtime->period_size >> 1); //bytes_to_frames(runtime, count);
-+ if( s->dma_in_progress ) {
++ if (s->dma_in_progress) {
+ offset = (runtime->period_size * (s->periods)) + (runtime->period_size >> 1);
+ if (offset >= runtime->buffer_size)
+ offset = runtime->period_size >> 1;
@@ -198,7 +195,10 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ if (offset >= runtime->buffer_size)
+ offset = 0;
+ }
-+// printk("audio_get_dma_pos: %d (%d)\n", offset, bytes_to_frames(runtime, s->offset));
++/* pr_debug("%s: Period=%d/%d Off=%d psize=%d bsize=%d (%d)\n", __func__,
++ s->periods, runtime->periods, offset, runtime->period_size,
++ runtime->buffer_size, bytes_to_frames(runtime, s->offset)); */
++
+ return offset;
+}
+
@@ -293,7 +293,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+
-+ ADEBUG();
+ return audio_get_dma_pos(&chip->s[substream->pstr->stream]);
+}
+
@@ -313,14 +312,14 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ alsa_codec_config->codec_clock_on();
+ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_playback);
-+ burstlen = DMA_TXFIFO_BURST * 2;
++ burstlen = SSI_TXFIFO_WM * 2; /* TODO: what if samples != 16 bits ? */
+ dma_req = imx_ssi_get_dma_tx_channel(0, 0);
+ 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;
++ burstlen = SSI_RXFIFO_WM * 2; /* TODO: what if samples != 16 bits ? */
+ 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)
@@ -342,17 +341,10 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ return err;
+
+ /* 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,
++ 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);
-+ }
+ if (err < 0) {
+ printk("Cannot configure DMA for %s channel\n", type);
+ }
@@ -414,11 +406,18 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ pr_debug("DMA area: 0x%p, addr: 0x%p, size: %u\n",
+ runtime->dma_area, (void*)runtime->dma_addr, runtime->dma_bytes);
+
-+// channel_info->base = (void*)runtime->dma_addr; ?? why isn't it already done ??
-+ channel_info->base = (void*)dma_map_single(NULL,
++ /* channel_info->base = (void*)runtime->dma_addr; ?? why isn't it already done ?? */
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
++ channel_info->base = (void*)dma_map_single(NULL,
+ (void*)runtime->dma_area,
+ runtime->dma_bytes,
+ DMA_TO_DEVICE);
++ } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
++ channel_info->base = (void*)dma_map_single(NULL,
++ (void*)runtime->dma_area,
++ runtime->dma_bytes,
++ DMA_FROM_DEVICE);
++ }
+ pr_debug("DMA phys: 0x%p\n", channel_info->base);
+ channel_info->adr = runtime->dma_area ;
+ channel_info->offset = 0;
@@ -509,7 +508,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+ struct snd_pcm *pcm;
+ int err;
+
-+ ADEBUG();
+ err = snd_pcm_new(imx_alsa->card,
+ CHIP_NAME,
+ device,
@@ -522,15 +520,13 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+ /* sets up initial buffer with continuous allocation */
+ snd_pcm_lib_preallocate_pages_for_all(pcm,
-+ SNDRV_DMA_TYPE_CONTINUOUS,
-+ snd_dma_continuous_data
-+ (GFP_KERNEL),
-+ 8 * 1024, 8 * 1024);
-+
-+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
-+ &snd_card_imx_ops);
-+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
-+ &snd_card_imx_ops);
++ SNDRV_DMA_TYPE_CONTINUOUS,
++ snd_dma_continuous_data(GFP_KERNEL),
++ 8 * 1024,
++ 8 * 1024);
++
++ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_imx_ops);
++ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_imx_ops);
+ pcm->private_data = imx_alsa;
+ pcm->info_flags = 0;
+ strcpy(pcm->name, CHIP_NAME);
@@ -579,7 +575,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+}
+#endif /* CONFIG_PM */
+
-+/* module init & exit */
+
+/*
+ * Inits alsa soundcard structure.
@@ -639,14 +634,14 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+ snd_card_set_dev(card, &pdev->dev);
+
-+ /* Register the created soundcard */
++ /* register the created soundcard */
+ err = snd_card_register(card);
+ if (err < 0) {
+ pr_err("Cannot register sound card. Giving up\n");
+ goto nodev2;
+ }
+
-+ pr_info("audio support initialized\n");
++ pr_info("i.MX1/L/2 audio support v" DRIVER_VERSION " initialized\n");
+ platform_set_drvdata(pdev, card);
+
+ /* activate the external SSI pins (should be done in imx-ssi !?) */
@@ -676,10 +671,10 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa.c
+
+ return 0;
+}
-Index: linux-2.6.29.6/sound/arm/imx-alsa-dma.h
+Index: linux-2.6.29.6.mod/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
++++ linux-2.6.29.6.mod/sound/arm/imx-alsa-dma.h 2009-12-29 18:38:46.000000000 +0100
@@ -0,0 +1,46 @@
+/*
+ * linux/sound/arm/imx/imx-alsa-dma.h
@@ -727,15 +722,15 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-dma.h
+
+#endif
+
-Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+Index: linux-2.6.29.6.mod/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 @@
++++ linux-2.6.29.6.mod/sound/arm/imx-alsa-tsc2102.c 2009-12-29 23:12:27.000000000 +0100
+@@ -0,0 +1,441 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.c
+ *
-+ * Alsa codec driver for TSC210x chip for i.MX platforms.
++ * Alsa codec driver for TSC210x chip on i.MX platforms.
+ *
+ * Copyright (c) 2008 Jorasse <jo...@ar...>
+ * Code based on the TSC2101 ALSA driver for omap platforms.
@@ -809,7 +804,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+ .fifo_size = 0,
+};
+
-+/* Only TSC2101 has audio in capability */
++/* Only TSC2101 has (mono) 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 |
@@ -818,8 +813,8 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+ .rates = IMX_SSI_RATES,
+ .rate_min = 8000,
+ .rate_max = 48000,
-+ .channels_min = 1,
-+ .channels_max = 1,
++ .channels_min = 2, /* even if TSC is sampling mono input, it uses the 2 I2S channels to transmit data */
++ .channels_max = 2,
+ .buffer_bytes_max = 32 * 1024,
+ .period_bytes_min = 64,
+ .period_bytes_max = 8 * 1024, /* test */
@@ -863,7 +858,7 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+#ifdef TSC_MASTER
+
+#else
-+ /* Set the sample rate on the i.MXL SSI */
++ /* Set the sample rate on the i.MX SSI */
+ printk("erreur 1");
+ imx_get_perclk3();
+ clkgdv = CODEC_CLOCK / (sample_rate * (DEFAULT_BITPERSAMPLE * 2 - 1));
@@ -1105,7 +1100,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+{
+ int ret;
+ struct imx_alsa_codec_config *codec_cfg;
-+// pdev->dev.platform_data;
+
+ printk("*** %s\n", __func__);
+
@@ -1161,7 +1155,6 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+{
+ int err;
+
-+ ADEBUG();
+ err = platform_driver_register(&imx_alsa_driver);
+
+ return err;
@@ -1169,17 +1162,16 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.c
+
+static void __exit imx_alsa_tsc210x_exit(void)
+{
-+ ADEBUG();
+ platform_driver_unregister(&imx_alsa_driver);
+}
+
+module_init(imx_alsa_tsc210x_init);
+module_exit(imx_alsa_tsc210x_exit);
+
-Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.h
+Index: linux-2.6.29.6.mod/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
++++ linux-2.6.29.6.mod/sound/arm/imx-alsa-tsc2102.h 2009-12-29 18:38:46.000000000 +0100
@@ -0,0 +1,48 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.h
@@ -1229,10 +1221,10 @@ Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102.h
+
+#endif /* IMX_ALSA_TSC2102_H_ */
+
-Index: linux-2.6.29.6/sound/arm/imx-alsa-tsc2102-mixer.c
+Index: linux-2.6.29.6.mod/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
++++ linux-2.6.29.6.mod/sound/arm/imx-alsa-tsc2102-mixer.c 2009-12-29 18:38:46.000000000 +0100
@@ -0,0 +1,425 @@
+/*
+ * sound/arm/imx-alsa-tsc2102-mixer.c
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 8669902..7937ef5 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
@@ -4,8 +4,8 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
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 @@
++++ linux-2.6.29.6/sound/arm/imx-ssi.c 2009-12-29 16:22:16.000000000 +0100
+@@ -0,0 +1,517 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Juergen Beisert, ke...@pe...
@@ -137,12 +137,9 @@ Index: linux-2.6.29.6/sound/arm/imx-ssi.c
+ pr_debug("%s called for unit %d\n", __func__, id);
+ BUG_ON(unit[id].io == NULL); /* (only one on i.MXL/1) */
+
-+ /* choose mode */
++ /* choose mode + disable this unit */
+ scsr = SSI_SCSR_I2S_MODE_SLAVE | SSI_SCSR_SYN;
-+
-+ /* disable this unit */
+ set_reg(scsr, SSI_SCSR, id);
-+// SSI_SCSR &= ~SSI_SCSR_EN;
+
+ /* Transmit config */
+ set_reg(SSI_MAE | /* Activate DMA */
@@ -158,6 +155,15 @@ Index: linux-2.6.29.6/sound/arm/imx-ssi.c
+// SSI_STCR_TFSL | /* one-bit-long-frame */
+// SSI_STCR_TEFS, /* shift */
+// SSI_STCR, id);
++
++ /* Receive config */
++ set_reg(SSI_MAE | /* Activate DMA */
++ SSI_FEN | /* FIFO enabled */
++ SSI_SCKP | /* receive @falling edge ?? */
++ SSI_FSI | /* Frame sync active low */
++ SSI_EFS, /* one bit shift */
++ SSI_SRCR, id);
++
+//
+// set_reg(SSI_SRCR_RFEN0 | /* FIFO 0 enabled */
+// SSI_SRCR_RXBIT0 |
@@ -520,7 +526,7 @@ Index: linux-2.6.29.6/sound/arm/imx-ssi.c
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
++++ linux-2.6.29.6/sound/arm/imx-ssi.h 2009-12-29 17:02:59.000000000 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -557,15 +563,15 @@ Index: linux-2.6.29.6/sound/arm/imx-ssi.h
+extern int imx_ssi_init(void);
+extern void imx_ssi_exit(void);
+
-+/* possible DMA bursts in FIFO entries */
-+#define DMA_TXFIFO_BURST 0x6
-+#define DMA_RXFIFO_BURST 0x4
++/* Levels to wait in FIFOs before asking DMA bursts */
++#define SSI_TXFIFO_WM 0x6
++#define SSI_RXFIFO_WM 0x4
+
+#endif /* __SOUND_ARM_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
++++ linux-2.6.29.6/arch/arm/mach-imx/include/mach/imx_ssi.h 2009-12-29 16:22:16.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/304-apf27-armadeus-improve_mx2-ssi_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/304-apf27-armadeus-improve_mx2-ssi_driver.patch
index 024e7dc..eb62be6 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/304-apf27-armadeus-improve_mx2-ssi_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/304-apf27-armadeus-improve_mx2-ssi_driver.patch
@@ -1,5 +1,7 @@
---- linux-2.6.27.2.org/sound/arm/imx2-ssi.h 2009-01-16 13:49:56.000000000 +0100
-+++ linux-2.6.27.2/sound/arm/imx2-ssi.h 2009-01-14 18:39:45.000000000 +0100
+Index: linux-2.6.29.6/sound/arm/imx2-ssi.h
+===================================================================
+--- linux-2.6.29.6.orig/sound/arm/imx2-ssi.h 2009-12-29 17:17:05.000000000 +0100
++++ linux-2.6.29.6/sound/arm/imx2-ssi.h 2009-12-29 17:17:06.000000000 +0100
@@ -23,11 +23,11 @@
void imx_ssi_shutdown(struct snd_pcm_substream *substream, int ssi_id);
int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd, int ssi_id);
@@ -17,17 +19,20 @@
/* to handle it like a module */
extern int mx2_ssi_init(void);
---- linux-2.6.27.2.org/sound/arm/imx2-ssi.c 2009-01-16 13:49:56.000000000 +0100
-+++ linux-2.6.27.2/sound/arm/imx2-ssi.c 2009-01-16 15:02:43.000000000 +0100
-@@ -28,6 +28,7 @@
+Index: linux-2.6.29.6/sound/arm/imx2-ssi.c
+===================================================================
+--- linux-2.6.29.6.orig/sound/arm/imx2-ssi.c 2009-12-29 17:17:05.000000000 +0100
++++ linux-2.6.29.6/sound/arm/imx2-ssi.c 2009-12-29 17:21:10.000000000 +0100
+@@ -28,6 +28,8 @@
#include <sound/pcm.h>
#include <mach/imx_ssi.h>
#include "imx2-ssi.h"
+#include "imx2-dam.h"
++
#define DRV_NAME "mxc-ssi"
-@@ -102,7 +103,7 @@
+@@ -102,7 +104,7 @@
* --| rigth || left |--------------------------------
*
*/
@@ -36,16 +41,17 @@
{
u32 scr;
-@@ -110,7 +111,7 @@
+@@ -110,22 +112,23 @@
pr_debug("%s called for unit %d\n", __func__, id);
- scr = SSI_SCR_SYN | SSI_SCR_NET;
+-
+- /* disable this unit */
++ /* set config + disable this unit */
+ scr = SSI_SCR_SYN | SSI_SCR_I2S_MODE_SLAVE; /* SSI_SCR_NET; */
-
- /* disable this unit */
set_reg(scr, SSI_SCR, id);
-@@ -118,14 +119,16 @@
+
set_reg(SSI_STCR_TFEN0 | /* FIFO 0 enabled */
SSI_STCR_TXBIT0 | /* MSB first, data bits 0...15 are valid */
SSI_STCR_TSCKP | /* send @falling edge */
@@ -137,7 +143,7 @@
{
struct resource *res;
void __iomem *adr;
-@@ -247,6 +254,7 @@
+@@ -247,19 +254,22 @@
return adr;
}
@@ -145,7 +151,17 @@
int imx_ssi_prepare(struct snd_pcm_substream *substream,
int ssi_id)
-@@ -260,6 +268,7 @@
+ {
+ set_reg_bits(SSI_SCR_SSIEN, SSI_SCR_SSIEN, SSI_SCR, ssi_id);
+
+- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ set_reg_bits(SSI_SIER_TDMAE, SSI_SIER_TDMAE, SSI_SIER, ssi_id);
+- else
+- set_reg_bits(SSI_SIER_RDMAE, SSI_SIER_RDMAE, SSI_SIER, ssi_id);
++ } else {
++ set_reg_bits(SSI_SIER_RDMAE | SSI_SIER_RFF0_EN, SSI_SIER_RDMAE | SSI_SIER_RFF0_EN, SSI_SIER, ssi_id);
++ }
return 0;
}
@@ -153,7 +169,7 @@
void imx_ssi_shutdown(struct snd_pcm_substream *substream,
int ssi_id)
-@@ -272,6 +281,8 @@
+@@ -272,6 +282,8 @@
{
u32 scr = get_reg(SSI_SCR, ssi_id);
@@ -162,15 +178,62 @@
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
-@@ -297,6 +308,7 @@
+@@ -297,8 +309,9 @@
return 0;
}
+EXPORT_SYMBOL(imx_ssi_trigger);
- static int __devinit mx2_iss_probe(struct platform_device *pdev)
+-static int __devinit mx2_iss_probe(struct platform_device *pdev)
++static int __devinit mx2_ssi_probe(struct platform_device *pdev)
+ {
+ struct imx_ssi_platform_data *pdata;
+ struct resource *res;
+@@ -307,7 +320,7 @@
+ pdata = pdev->dev.platform_data;
+
+ id = pdev->id;
+- pr_info("Probing i.MX SSI unit %d\n", id);
++ pr_info("Probing i.MX2 SSI unit %d\n", id);
+
+ if (unit[id].io != NULL)
+ return -EBUSY;
+@@ -334,7 +347,7 @@
+ goto err2;
+ }
+
+- /* external clock (if used) should never greater than 1/4 ipg_clk! */
++ /* external clock (if used) should never be greater than 1/4 ipg_clk! */
+ pr_debug("Main clock for SSI is: %luHz\n", clk_get_rate(unit[id].clk));
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+@@ -370,7 +383,7 @@
+ return ret;
+ }
+
+-static int __devexit mx2_iss_remove(struct platform_device *pdev)
++static int __devexit mx2_ssi_remove(struct platform_device *pdev)
{
-@@ -405,10 +417,24 @@
+ struct imx_ssi_platform_data *pdata = pdev->dev.platform_data;
+ struct resource *res;
+@@ -390,13 +403,13 @@
+ return 0;
+ }
+
+-static struct platform_driver mx2_iss_driver = {
++static struct platform_driver mx2_ssi_driver = {
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ },
+- .probe = mx2_iss_probe,
+- .remove = __devexit_p(mx2_iss_remove),
++ .probe = mx2_ssi_probe,
++ .remove = __devexit_p(mx2_ssi_remove),
+ #ifdef CONFIG_PM
+ .suspend = NULL, /* TODO mx2_ssi_suspend */
+ .resume = NULL /* TODO mx2_ssi_resume */
+@@ -405,10 +418,25 @@
int __init mx2_ssi_init(void)
{
@@ -181,13 +244,14 @@
+ if (err != 0)
+ return err;
+ else
-+ return platform_driver_register(&mx2_iss_driver);
++ return platform_driver_register(&mx2_ssi_driver);
}
void __exit mx2_ssi_exit(void)
{
+- platform_driver_unregister(&mx2_iss_driver);
+ mx2_dam_exit();
- platform_driver_unregister(&mx2_iss_driver);
++ platform_driver_unregister(&mx2_ssi_driver);
}
+
+module_init(mx2_ssi_init);
@@ -196,3 +260,4 @@
+MODULE_AUTHOR("Pengutronix");
+MODULE_DESCRIPTION("i.MX2 SSI Driver");
+MODULE_LICENSE("GPL");
++
diff --git a/scripts/quiltify.sh b/scripts/quiltify.sh
index 8c0db33..0023164 100755
--- a/scripts/quiltify.sh
+++ b/scripts/quiltify.sh
@@ -74,7 +74,7 @@ fi
# Move or delete current XXX dir
if [ "$QUILT_TARGET_NAME" != "Buildroot" ]; then
ask_user "Rename or delete the current $QUILT_TARGET_NAME directory: $QUILT_TARGET_DIR \n?? (R/d)"
- EXT=`date +%Y_%M_%d_%H%m`
+ EXT=`date +%Y_%m_%d_%Hh%M`
if [ "$answer" == "d" ]; then
echo "Deleting current $QUILT_TARGET_NAME dir"
rm -rf $QUILT_TARGET_DIR
diff --git a/target/linux/modules/max9768/max9768.c b/target/linux/modules/max9768/max9768.c
index 1ec1f54..7dc1ecf 100644
--- a/target/linux/modules/max9768/max9768.c
+++ b/target/linux/modules/max9768/max9768.c
@@ -30,10 +30,11 @@
#include "max9768.h"
-#define DRIVER_VERSION "0.1"
+#define DRIVER_VERSION "0.2"
#define DRIVER_NAME "max9768"
#define MAX9768_VOLUME_MASK 0x3F
-
+#define MAX9768_VOLUME_MAX 63
+#define MAX9768_VOLUME_MIN 0
struct max9768 {
struct i2c_client *client;
@@ -72,23 +73,49 @@ static int max9768_send(struct i2c_client *client, int value)
/* sysfs hook functions */
+
+static ssize_t max9768_get_volume(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct max9768 *max9768 = i2c_get_clientdata(client);
+
+ return sprintf(buf, "%d", max9768->current_volume);
+}
+
static ssize_t max9768_set_volume(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct i2c_client *client = to_i2c_client(dev);
+ struct max9768 *max9768 = i2c_get_clientdata(client);
char msg;
int err;
- msg = (simple_strtol(buf, NULL, 10)) & MAX9768_VOLUME_MASK;
+ max9768->current_volume = simple_strtol(buf, NULL, 10);
+ if (max9768->current_volume > MAX9768_VOLUME_MAX)
+ max9768->current_volume = MAX9768_VOLUME_MAX;
+ else if (max9768->current_volume < MAX9768_VOLUME_MIN)
+ max9768->current_volume = MAX9768_VOLUME_MIN;
+
+ msg = max9768->current_volume & MAX9768_VOLUME_MASK;
pr_debug("%s: 0x%02x\n", __FUNCTION__, msg);
err = max9768_send(client, msg);
- if (err) {
+ if (err < 0) {
dev_err(dev, "couldn't set volume\n");
}
return count;
}
+static ssize_t max9768_get_mute(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct max9768 *max9768 = i2c_get_clientdata(client);
+
+ return sprintf(buf, "%d", max9768->mute_state);
+}
+
static ssize_t max9768_set_mute(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
@@ -103,8 +130,17 @@ static ssize_t max9768_set_mute(struct device *dev,
return count;
}
+static ssize_t max9768_get_shutdown(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct max9768 *max9768 = i2c_get_clientdata(client);
+
+ return sprintf(buf, "%d", max9768->shdn_state);
+}
+
static ssize_t max9768_set_shutdown(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
+ struct device_attribute *attr, const char *buf, size_t count)
{
struct i2c_client *client = to_i2c_client(dev);
struct max9768 *max9768 = i2c_get_clientdata(client);
@@ -117,9 +153,9 @@ static ssize_t max9768_set_shutdown(struct device *dev,
return count;
}
-static DEVICE_ATTR(shutdown, S_IWUSR, NULL, max9768_set_shutdown);
-static DEVICE_ATTR(mute, S_IWUSR, NULL, max9768_set_mute);
-static DEVICE_ATTR(volume, S_IWUSR, NULL, max9768_set_volume);
+static DEVICE_ATTR(shutdown, S_IWUSR | S_IRUGO, max9768_get_shutdown, max9768_set_shutdown);
+static DEVICE_ATTR(mute, S_IWUSR | S_IRUGO, max9768_get_mute, max9768_set_mute);
+static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO, max9768_get_volume, max9768_set_volume);
static int max9768_create_sys_entries(struct i2c_client *client)
{
@@ -190,7 +226,7 @@ static int max9768_probe(struct i2c_client *client,
/* set filter mode */
result = max9768_send(client, platform_data->filter_mode);
- if (result) {
+ if (result < 0) {
dev_err(&client->dev, "can't communicate with chip\n");
goto out_gpio;
}
hooks/post-receive
--
armadeus
|