aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-05-27 04:58:56 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:17:51 -0400
commitd2195d52aa5c638be74b396da00624a32d1c5a86 (patch)
tree020ec1da36879ffd4e8ae02ee80e4bed0d502a11
parent5203b99c14fef139e5a61ed7cb1105aaa306df45 (diff)
eukrea_mbimx27: add audio codec
Signed-off-by: Eric Bénard <eric@eukrea.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index 34bdc26a75b..80f62680340 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2009 Eric Benard - eric@eukrea.com 2 * Copyright (C) 2009-2010 Eric Benard - eric@eukrea.com
3 * 3 *
4 * Based on pcm970-baseboard.c which is : 4 * Based on pcm970-baseboard.c which is :
5 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) 5 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
@@ -37,6 +37,8 @@
37#include <mach/mmc.h> 37#include <mach/mmc.h>
38#include <mach/imx-uart.h> 38#include <mach/imx-uart.h>
39#include <mach/spi.h> 39#include <mach/spi.h>
40#include <mach/ssi.h>
41#include <mach/audmux.h>
40 42
41#include "devices.h" 43#include "devices.h"
42 44
@@ -93,6 +95,13 @@ static int eukrea_mbimx27_pins[] = {
93 PD29_PF_CSPI1_SCLK, 95 PD29_PF_CSPI1_SCLK,
94 PD30_PF_CSPI1_MISO, 96 PD30_PF_CSPI1_MISO,
95 PD31_PF_CSPI1_MOSI, 97 PD31_PF_CSPI1_MOSI,
98 /* SSI4 */
99#if defined(CONFIG_SND_SOC_EUKREA_TLV320)
100 PC16_PF_SSI4_FS,
101 PC17_PF_SSI4_RXD | GPIO_PUEN,
102 PC18_PF_SSI4_TXD | GPIO_PUEN,
103 PC19_PF_SSI4_CLK,
104#endif
96}; 105};
97 106
98static const uint32_t eukrea_mbimx27_keymap[] = { 107static const uint32_t eukrea_mbimx27_keymap[] = {
@@ -287,6 +296,12 @@ static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = {
287 }, 296 },
288}; 297};
289 298
299static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = {
300 {
301 I2C_BOARD_INFO("tlv320aic23", 0x1a),
302 },
303};
304
290static int eukrea_mbimx27_spi_cs[] = {GPIO_PORTD | 28}; 305static int eukrea_mbimx27_spi_cs[] = {GPIO_PORTD | 28};
291 306
292static struct spi_imx_master eukrea_mbimx27_spi_0_data = { 307static struct spi_imx_master eukrea_mbimx27_spi_0_data = {
@@ -303,6 +318,10 @@ static struct imxmmc_platform_data sdhc_pdata = {
303 .dat3_card_detect = 1, 318 .dat3_card_detect = 1,
304}; 319};
305 320
321struct imx_ssi_platform_data eukrea_mbimx27_ssi_pdata = {
322 .flags = IMX_SSI_DMA | IMX_SSI_USE_I2S_SLAVE,
323};
324
306/* 325/*
307 * system init for baseboard usage. Will be called by cpuimx27 init. 326 * system init for baseboard usage. Will be called by cpuimx27 init.
308 * 327 *
@@ -314,6 +333,24 @@ void __init eukrea_mbimx27_baseboard_init(void)
314 mxc_gpio_setup_multiple_pins(eukrea_mbimx27_pins, 333 mxc_gpio_setup_multiple_pins(eukrea_mbimx27_pins,
315 ARRAY_SIZE(eukrea_mbimx27_pins), "MBIMX27"); 334 ARRAY_SIZE(eukrea_mbimx27_pins), "MBIMX27");
316 335
336#if defined(CONFIG_SND_SOC_EUKREA_TLV320)
337 /* SSI unit master I2S codec connected to SSI_PINS_4*/
338 mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
339 MXC_AUDMUX_V1_PCR_SYN |
340 MXC_AUDMUX_V1_PCR_TFSDIR |
341 MXC_AUDMUX_V1_PCR_TCLKDIR |
342 MXC_AUDMUX_V1_PCR_RFSDIR |
343 MXC_AUDMUX_V1_PCR_RCLKDIR |
344 MXC_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) |
345 MXC_AUDMUX_V1_PCR_RFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) |
346 MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4)
347 );
348 mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR3_SSI_PINS_4,
349 MXC_AUDMUX_V1_PCR_SYN |
350 MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
351 );
352#endif
353
317 mxc_register_device(&mxc_uart_device1, &uart_pdata[0]); 354 mxc_register_device(&mxc_uart_device1, &uart_pdata[0]);
318 mxc_register_device(&mxc_uart_device2, &uart_pdata[1]); 355 mxc_register_device(&mxc_uart_device2, &uart_pdata[1]);
319#if !defined(MACH_EUKREA_CPUIMX27_USEUART4) 356#if !defined(MACH_EUKREA_CPUIMX27_USEUART4)
@@ -323,6 +360,11 @@ void __init eukrea_mbimx27_baseboard_init(void)
323 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data); 360 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data);
324 mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata); 361 mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata);
325 362
363 i2c_register_board_info(0, eukrea_mbimx27_i2c_devices,
364 ARRAY_SIZE(eukrea_mbimx27_i2c_devices));
365
366 mxc_register_device(&imx_ssi_device0, &eukrea_mbimx27_ssi_pdata);
367
326#if defined(CONFIG_TOUCHSCREEN_ADS7846) \ 368#if defined(CONFIG_TOUCHSCREEN_ADS7846) \
327 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 369 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
328 /* ADS7846 Touchscreen controller init */ 370 /* ADS7846 Touchscreen controller init */