aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch')
-rw-r--r--recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch b/recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch
new file mode 100644
index 0000000000..623d80ab31
--- /dev/null
+++ b/recipes/linux/linux-2.6.31/pcm043/0023-pca100-add-sound-support.patch
@@ -0,0 +1,99 @@
+From f58f54a10075e0ff2d952b9264ce880c1ecbf439 Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Fri, 6 Nov 2009 15:29:58 +0100
+Subject: [PATCH 23/28] pca100: add sound support
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ arch/arm/mach-mx2/pca100.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 52 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
+index fe5b165..e0a464d 100644
+--- a/arch/arm/mach-mx2/pca100.c
++++ b/arch/arm/mach-mx2/pca100.c
+@@ -26,6 +26,7 @@
+ #include <linux/spi/eeprom.h>
+ #include <linux/irq.h>
+ #include <linux/gpio.h>
++#include <linux/delay.h>
+
+ #include <asm/mach/arch.h>
+ #include <asm/mach-types.h>
+@@ -41,6 +42,8 @@
+ #include <mach/mxc_nand.h>
+ #include <mach/irqs.h>
+ #include <mach/mmc.h>
++#include <mach/audmux.h>
++#include <mach/ssi.h>
+
+ #include "devices.h"
+
+@@ -182,15 +185,64 @@ static struct imxmmc_platform_data sdhc_pdata = {
+ .exit = pca100_sdhc2_exit,
+ };
+
++static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
++{
++ printk("%s\n", __func__);
++
++ mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT);
++ gpio_set_value(GPIO_PORTC + 20, 1);
++ udelay(2);
++ gpio_set_value(GPIO_PORTC + 20, 0);
++ mxc_gpio_mode(PC20_PF_SSI1_FS);
++ msleep(2);
++}
++
++static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
++{
++ printk("%s\n", __func__);
++
++ mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT); /* FS */
++ gpio_set_value(GPIO_PORTC + 20, 0);
++ mxc_gpio_mode(GPIO_PORTC | 22 | GPIO_GPIO | GPIO_OUT); /* TX */
++ gpio_set_value(GPIO_PORTC + 22, 0);
++ mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_OUT); /* reset */
++ gpio_set_value(GPIO_PORTC + 28, 0);
++ udelay(10);
++ gpio_set_value(GPIO_PORTC + 28, 1);
++ mxc_gpio_mode(PC20_PF_SSI1_FS);
++ mxc_gpio_mode(PC22_PF_SSI1_TXD);
++ msleep(2);
++}
++
++static struct imx_ssi_platform_data pca100_ssi_pdata = {
++ .ac97_reset = pca100_ac97_cold_reset,
++ .ac97_warm_reset = pca100_ac97_warm_reset,
++ .flags = IMX_SSI_USE_AC97,
++};
++
+ static void __init pca100_init(void)
+ {
+ int ret;
+
++ /* SSI unit */
++ mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
++ MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
++ MXC_AUDMUX_V1_PCR_TFCSEL(3) |
++ MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
++ MXC_AUDMUX_V1_PCR_RXDSEL(3));
++ mxc_audmux_v1_configure_port(4,
++ MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
++ MXC_AUDMUX_V1_PCR_TFCSEL(0) |
++ MXC_AUDMUX_V1_PCR_TFSDIR |
++ MXC_AUDMUX_V1_PCR_RXDSEL(0));
++
+ ret = mxc_gpio_setup_multiple_pins(pca100_pins,
+ ARRAY_SIZE(pca100_pins), "PCA100");
+ if (ret)
+ printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret);
+
++ mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata);
++
+ mxc_register_device(&mxc_uart_device0, &uart_pdata);
+
+ mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
+--
+1.6.5.2
+