[Armadeus-commitlog] SF.net SVN: armadeus:[1021] branches/tsc210x
Brought to you by:
sszy
|
From: <ar...@us...> - 2009-01-16 17:40:35
|
Revision: 1021
http://armadeus.svn.sourceforge.net/armadeus/?rev=1021&view=rev
Author: artemys
Date: 2009-01-16 17:40:30 +0000 (Fri, 16 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Makes alsa driver work on APF27 too
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
Added Paths:
-----------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
branches/tsc210x/target/linux/arch/arm/mach-imx/include/
branches/tsc210x/target/linux/arch/arm/mach-imx/include/mach/
Modified: branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-16 17:40:30 UTC (rev 1021)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.2
-# Sun Dec 28 01:31:05 2008
+# Fri Jan 16 18:34:47 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -919,6 +919,7 @@
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_ARM=y
+CONFIG_SND_IMX_PCM=m
CONFIG_SND_IMX_TSC2102=m
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -308,7 +308,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/drivers/spi/tsc2102.c
+++ linux-2.6.27.2.mod/drivers/spi/tsc2102.c
-@@ -0,0 +1,1113 @@
+@@ -0,0 +1,1114 @@
+/*
+ * drivers/spi/tsc2102.c
+ *
@@ -837,8 +837,9 @@
+ } else { /* 48000 */
+ switch(mclk)
+ {
-+ case 12288000:
-+ pll->pll1 = (PLL1_Q_VAL(2));
++ case 12288000:
++ /*pll->pll1 = (PLL1_Q_VAL(2)) -> doesn't work without enabling PLL */
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(8));
+ pll->pll2 = (PLL2_D_VAL(0));
+ break;
+
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa.c
-@@ -0,0 +1,658 @@
+@@ -0,0 +1,668 @@
+/*
+ * sound/arm/imx-alsa.c
+ *
@@ -49,6 +49,9 @@
+
+#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"
@@ -109,14 +112,15 @@
+/* Called by the DMA framework when an error has occured */
+static void snd_imx_dma_err_handler(int channel, void *data, int err)
+{
-+ printk("dma_err_handler %d %d\n",channel, err);
++ printk("%s %d %d\n", __func__, channel, err);
+
-+ printk("DMA timeout on channel %d -%s%s%s%s\n",
++ printk("DMA timeout on channel %d -%s%s%s%s%s\n",
+ channel,
+ err & IMX_DMA_ERR_BURST ? " burst":"",
+ err & IMX_DMA_ERR_REQUEST ? " request":"",
+ err & IMX_DMA_ERR_TRANSFER ? " transfer":"",
-+ err & IMX_DMA_ERR_BUFFER ? " buffer":"");
++ err & IMX_DMA_ERR_BUFFER ? " buffer":"",
++ err & IMX_DMA_ERR_TIMEOUT ? " hw_chain_watchdog":"");
+
+ imx_dma_disable(channel);
+}
@@ -232,7 +236,7 @@
+ return imx_ssi_trigger(substream, cmd, /*channel_info->ssi*/0);
+}
+
-+static int snd_imx_pcm_prepare(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
@@ -278,6 +282,8 @@
+ return err;
+ }
+
++ imx_ssi_prepare(substream, /*channel_info->ssi*/0);
++
+ return 0;
+}
+
@@ -305,14 +311,14 @@
+ alsa_codec_config->codec_clock_on();
+ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_playback);
-+ burstlen = SSI_DMA_BLR_TRANSMIT;
++ 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);
+ if (dma_req < 0)
+ return dma_req;
+ } else {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_capture);
-+ burstlen = SSI_DMA_BLR;
++ burstlen = DMA_RXFIFO_BURST * 2;
+ printk("capture not supported\n");
+ dma_req = imx_ssi_get_dma_rx_channel(0, 0);
+ if (dma_req < 0)
@@ -352,7 +358,13 @@
+
+ /* configure DMA burst length for channel */
+ imx_dma_config_burstlen(chip->s[stream_id].dma_dev, burstlen);
++ pr_debug("Burstlen for DMA channel %u is now: %u\n", chip->s[stream_id].dma_dev, burstlen);
+
++#ifdef CONFIG_ARCH_MX2
++ /* route sound paths */
++ mx2_dam_configure_sync_slave(1, 1);
++#endif
++
+ return 0;
+}
+
@@ -401,7 +413,7 @@
+ 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;
++// channel_info->base = (void*)runtime->dma_addr; ?? why isn't it already done ??
+ channel_info->base = (void*)dma_map_single(NULL,
+ (void*)runtime->dma_area,
+ runtime->dma_bytes,
@@ -621,7 +633,6 @@
+ sprintf(card->shortname, "i.MX+%s audio", alsa_codec_config->name);
+ sprintf(card->longname, "Freescale i.MX with %s codec", alsa_codec_config->name);
+
-+ snd_imx_init_mixer();
+ snd_card_set_dev(card, &pdev->dev);
+
+ /* Register the created soundcard */
@@ -658,10 +669,9 @@
+ 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)
@@ -723,7 +733,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102.c
-@@ -0,0 +1,389 @@
+@@ -0,0 +1,393 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.c
+ *
@@ -906,6 +916,8 @@
+ */
+static void tsc2102_set_samplerate(long sample_rate)
+{
++ pr_debug("%s %d\n", __func__, sample_rate);
++
+#ifndef TSC_MASTER
+ int clkgdv = 0;
+ u16 srgr1, srgr2;
@@ -942,11 +954,13 @@
+#endif
+
+ current_rate = sample_rate;
-+ dump_tsc2102_audio_regs(1);
++ dump_tsc2102_audio_regs(0);
+}
+
+static void tsc2102_configure(void)
+{
++ pr_debug("%s\n", __func__);
++
+ tsc210x_dac_power(1);
+
+#ifdef TSC_MASTER
@@ -1170,7 +1184,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102-mixer.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102-mixer.c
-@@ -0,0 +1,293 @@
+@@ -0,0 +1,295 @@
+/*
+ * sound/arm/imx-alsa-tsc2102-mixer.c
+ *
@@ -1458,6 +1472,8 @@
+ /* TSC2101 specific part */
+ /* TBDL */
+
++ snd_imx_init_mixer();
++
+ return 0;
+}
+
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -0,0 +1,52 @@
+--- linux-2.6.27.2.original/sound/arm/Kconfig 2009-01-16 17:54:48.000000000 +0100
++++ linux-2.6.27.2/sound/arm/Kconfig 2009-01-16 18:18:48.000000000 +0100
+@@ -28,6 +28,17 @@
+ select SND_PCM
+ select SND_AC97_CODEC
+
++config SND_IMX_PCM
++ tristate "i.MX1/L SSI driver"
++ depends on SND && ARCH_IMX
++ select SND_PCM
++ help
++ Say Y here to include support for i.MX1/L based CPU cards with
++ sound output.
++
++ To compile this driver as a module, choose M here: the module
++ will be called snd-imx.
++
+ config SND_PXA2XX_PCM
+ tristate
+ select SND_PCM
+@@ -42,13 +53,13 @@
+ the PXA2xx AC97 interface.
+
+ config SND_IMX_TSC2102
+- tristate "i.MX1/L TSC2102 alsa driver"
+- depends on ARCH_IMX && SND
++ tristate "TSC210x alsa driver"
++ depends on (SND_IMX_PCM || SND_IMX2_PCM)
+ select SND_PCM
+ select SPI_TSC2102
+ help
+- Say Y here if you have an i.MX1/L platform board
+- and a TSC2102 audio chip.
++ Say Y here if you have an i.MX platform board
++ and a TSC210x audio chip.
+
+ To compile this driver as a module, choose M here: the module
+ will be called snd-imx-tsc2102.
+--- linux-2.6.27.2.original/sound/arm/Makefile 2009-01-16 17:54:48.000000000 +0100
++++ linux-2.6.27.2/sound/arm/Makefile 2009-01-16 18:10:07.000000000 +0100
+@@ -14,6 +14,9 @@
+ obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
+ snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
+
+-obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
+-snd-imx-alsa-tsc2102-objs := imx-alsa.o imx-alsa-tsc2102.o imx-alsa-tsc2102-mixer.o
++obj-$(CONFIG_SND_IMX) += snd-imx.o
++snd-imx-objs :=imx-ssi.o
++
++obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
++snd-imx-alsa-tsc2102-objs := imx-alsa.o imx-alsa-tsc2102.o imx-alsa-tsc2102-mixer.o devdma.o
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|