summaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch')
-rw-r--r--recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch144
1 files changed, 144 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch b/recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch
new file mode 100644
index 0000000000..cba390ce85
--- /dev/null
+++ b/recipes/linux/linux-2.6.31/pcm043/0025-pcm037-Add-sound-support.patch
@@ -0,0 +1,144 @@
+From 8b4873639bb66d8269f0767ddfbb4c8a7f8082f7 Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Thu, 12 Nov 2009 14:02:13 +0100
+Subject: [PATCH 25/28] pcm037: Add sound support
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ arch/arm/mach-mx3/pcm037.c | 71 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 71 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
+index 840cfda..8ef6c79 100644
+--- a/arch/arm/mach-mx3/pcm037.c
++++ b/arch/arm/mach-mx3/pcm037.c
+@@ -32,6 +32,7 @@
+ #include <linux/spi/spi.h>
+ #include <linux/irq.h>
+ #include <linux/fsl_devices.h>
++#include <linux/mfd/mc13783.h>
+
+ #include <media/soc_camera.h>
+
+@@ -50,6 +51,9 @@
+ #include <mach/mx3_camera.h>
+ #include <mach/mx3fb.h>
+ #include <mach/mxc_nand.h>
++#include <mach/spi.h>
++#include <mach/audmux.h>
++#include <mach/ssi.h>
+
+ #include "devices.h"
+ #include "pcm037.h"
+@@ -123,6 +127,8 @@ static unsigned int pcm037_pins[] = {
+ MX31_PIN_CSPI3_SPI_RDY__CTS3,
+ /* LAN9217 irq pin */
+ IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO),
++ /* MC13783 IRQ pim */
++ IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO),
+ /* Onewire */
+ MX31_PIN_BATT_LINE__OWIRE,
+ /* Framebuffer */
+@@ -169,6 +175,15 @@ static unsigned int pcm037_pins[] = {
+ MX31_PIN_CSI_MCLK__CSI_MCLK,
+ MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
+ MX31_PIN_CSI_VSYNC__CSI_VSYNC,
++ /* SSI */
++ MX31_PIN_STXD4__STXD4,
++ MX31_PIN_SRXD4__SRXD4,
++ MX31_PIN_SCK4__SCK4,
++ MX31_PIN_SFS4__SFS4,
++ MX31_PIN_STXD5__STXD5,
++ MX31_PIN_SRXD5__SRXD5,
++ MX31_PIN_SCK5__SCK5,
++ MX31_PIN_SFS5__SFS5,
+ };
+
+ static struct physmap_flash_data pcm037_flash_data = {
+@@ -406,6 +421,31 @@ static void pcm970_sdhc1_exit(struct device *dev, void *data)
+ gpio_free(SDHC1_GPIO_WP);
+ }
+
++#ifdef CONFIG_SPI
++static struct mc13783_platform_data pcm037_pmic = {
++ .flags = MC13783_USE_ADC | MC13783_USE_TOUCHSCREEN |
++ MC13783_USE_CODEC,
++};
++
++static unsigned int pcm037_spi_cs[] = {MXC_SPI_CS(0), };
++
++static struct spi_imx_master pcm037_spi_0_data = {
++ .chipselect = pcm037_spi_cs,
++ .num_chipselect = ARRAY_SIZE(pcm037_spi_cs),
++};
++
++static struct spi_board_info pcm037_spi_board_info[] __initdata = {
++ {
++ .modalias = "mc13783",
++ .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO3_0),
++ .max_speed_hz = 3000000,
++ .bus_num = 0,
++ .platform_data = &pcm037_pmic,
++ .chip_select = 0,
++ }
++};
++#endif /* CONFIG_SPI */
++
+ static struct imxmmc_platform_data sdhc_pdata = {
+ #ifdef PCM970_SDHC_RW_SWITCH
+ .get_ro = pcm970_sdhc1_get_ro,
+@@ -515,6 +555,9 @@ static struct mx3fb_platform_data mx3fb_pdata = {
+ .num_modes = ARRAY_SIZE(fb_modedb),
+ };
+
++struct imx_ssi_platform_data pcm037_ssi_pdata = {
++};
++
+ /*
+ * Board specific initialization.
+ */
+@@ -522,6 +565,26 @@ static void __init mxc_board_init(void)
+ {
+ int ret;
+
++ mxc_audmux_v2_configure_port(MX31_AUDMUX_PORT1_SSI0,
++ MXC_AUDMUX_V2_PTCR_TFSDIR |
++ MXC_AUDMUX_V2_PTCR_TCLKDIR |
++ MXC_AUDMUX_V2_PTCR_TFSEL(MX31_AUDMUX_PORT4_SSI_PINS_4) |
++ MXC_AUDMUX_V2_PTCR_TCSEL(MX31_AUDMUX_PORT4_SSI_PINS_4) |
++ MXC_AUDMUX_V2_PTCR_RFSDIR |
++ MXC_AUDMUX_V2_PTCR_RCLKDIR |
++ MXC_AUDMUX_V2_PTCR_RFSEL(MX31_AUDMUX_PORT5_SSI_PINS_5) |
++ MXC_AUDMUX_V2_PTCR_RCSEL(MX31_AUDMUX_PORT5_SSI_PINS_5),
++ MXC_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT5_SSI_PINS_5));
++ mxc_audmux_v2_configure_port(MX31_AUDMUX_PORT5_SSI_PINS_5,
++ 0,
++ MXC_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0));
++ mxc_audmux_v2_configure_port(MX31_AUDMUX_PORT4_SSI_PINS_4,
++ MXC_AUDMUX_V2_PTCR_TFSEL(MX31_AUDMUX_PORT1_SSI0) |
++ MXC_AUDMUX_V2_PTCR_TCSEL(MX31_AUDMUX_PORT1_SSI0) |
++ MXC_AUDMUX_V2_PTCR_RFSEL(MX31_AUDMUX_PORT1_SSI0) |
++ MXC_AUDMUX_V2_PTCR_RCSEL(MX31_AUDMUX_PORT1_SSI0),
++ 0);
++
+ mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
+ "pcm037");
+
+@@ -575,6 +638,14 @@ static void __init mxc_board_init(void)
+
+ if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
+ mxc_register_device(&mx3_camera, &camera_pdata);
++
++#ifdef CONFIG_SPI
++ mxc_register_device(&imx_spi_device0, &pcm037_spi_0_data);
++
++ spi_register_board_info(pcm037_spi_board_info,
++ ARRAY_SIZE(pcm037_spi_board_info));
++#endif
++ mxc_register_device(&imx_ssi_device0, &pcm037_ssi_pdata);
+ }
+
+ static void __init pcm037_timer_init(void)
+--
+1.6.5.2
+