From 1e048367f228e4104b0935d3faa51b7f43f28b8a Mon Sep 17 00:00:00 2001 From: Sumit Bhattacharya Date: Fri, 26 Aug 2011 18:48:09 +0530 Subject: ARM: tegra: ventana: Add sound support Bug 868608 Bug 862023 Change-Id: I0f902098fc9cabd9d8c4962cf73c758df99a3199 Reviewed-on: http://git-master/r/49459 Tested-by: Sumit Bhattacharya Reviewed-by: Bharat Nihalani Rebase-Id: Rea8335719e3f20cdb645d22c19da3d61d52d4eaf --- arch/arm/mach-tegra/board-ventana.c | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'arch/arm/mach-tegra/board-ventana.c') diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c index 41576952c051..0aeeb0582e8b 100644 --- a/arch/arm/mach-tegra/board-ventana.c +++ b/arch/arm/mach-tegra/board-ventana.c @@ -39,12 +39,16 @@ #include #include +#include + #include #include #include #include #include #include +#include +#include #include #include @@ -122,6 +126,7 @@ static __initdata struct tegra_clk_init_table ventana_clk_init_table[] = { { "pll_p_out4", "pll_p", 24000000, true }, { "pwm", "clk_32k", 32768, false}, { "kbc", "clk_32k", 32768, true}, + { "i2s1", "pll_a_out0", 0, false}, { NULL, NULL, 0, 0}, }; @@ -177,6 +182,26 @@ static struct tegra_i2c_platform_data ventana_dvc_platform_data = { .is_dvc = true, }; +static struct wm8903_platform_data ventana_wm8903_pdata = { + .irq_active_low = 0, + .micdet_cfg = 0, + .micdet_delay = 100, + .gpio_base = VENTANA_GPIO_WM8903(0), + .gpio_cfg = { + WM8903_GPIO_NO_CONFIG, + WM8903_GPIO_NO_CONFIG, + 0, + WM8903_GPIO_NO_CONFIG, + WM8903_GPIO_NO_CONFIG, + }, +}; + +static struct i2c_board_info __initdata wm8903_board_info = { + I2C_BOARD_INFO("wm8903", 0x1a), + .platform_data = &ventana_wm8903_pdata, + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ), +}; + static void ventana_i2c_init(void) { tegra_i2c_device1.dev.platform_data = &ventana_i2c1_platform_data; @@ -188,6 +213,8 @@ static void ventana_i2c_init(void) platform_device_register(&tegra_i2c_device2); platform_device_register(&tegra_i2c_device3); platform_device_register(&tegra_i2c_device4); + + i2c_register_board_info(0, &wm8903_board_info, 1); } static struct platform_device *ventana_uart_devices[] __initdata = { &tegra_uartb_device, @@ -324,6 +351,22 @@ static struct platform_device tegra_camera = { .id = -1, }; +static struct tegra_wm8903_platform_data ventana_audio_pdata = { + .gpio_spkr_en = TEGRA_GPIO_SPKR_EN, + .gpio_hp_det = TEGRA_GPIO_HP_DET, + .gpio_hp_mute = -1, + .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN, + .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN, +}; + +static struct platform_device ventana_audio_device = { + .name = "tegra-snd-wm8903", + .id = 0, + .dev = { + .platform_data = &ventana_audio_pdata, + }, +}; + static struct platform_device *ventana_devices[] __initdata = { &tegra_pmu_device, &tegra_udc_device, @@ -336,6 +379,10 @@ static struct platform_device *ventana_devices[] __initdata = { &tegra_wdt_device, &tegra_avp_device, &tegra_camera, + &tegra_i2s_device1, + &tegra_das_device, + &tegra_pcm_device, + &ventana_audio_device, }; -- cgit v1.2.3