From 0588c465934ab6f8a43629bce667485d91a4b04b Mon Sep 17 00:00:00 2001 From: Rakesh Iyer Date: Sat, 28 Jan 2012 22:19:32 -0800 Subject: arm: tegra: kai: Add ALC5639 audio codec Changes made to add support of ALC5639 codec for kai. Bug 931371 Signed-off-by: Rakesh Iyer Reviewed-on: http://git-master/r/77954 (cherry picked from commit 8e3e4e00a97759983a0a2e3a2c4d9d4d367ed950) Change-Id: I899b31fc416d75875456fe7809e0dce6f2e78ffa Signed-off-by: Pritesh Raithatha Reviewed-on: http://git-master/r/82736 Reviewed-by: Chandler Zhang Tested-by: Chandler Zhang Reviewed-by: Sachin Nikam --- arch/arm/mach-tegra/Kconfig | 1 + arch/arm/mach-tegra/board-kai.c | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index a507373cc829..f3d49bfc89b3 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -162,6 +162,7 @@ config MACH_TEGRA_ENTERPRISE config MACH_KAI bool "Kai board" depends on ARCH_TEGRA_3x_SOC + select MACH_HAS_SND_SOC_TEGRA_RT5639 if SND_SOC select MACH_HAS_SND_SOC_TEGRA_RT5640 if SND_SOC help Support for NVIDIA KAI development platform diff --git a/arch/arm/mach-tegra/board-kai.c b/arch/arm/mach-tegra/board-kai.c index d967f73c565a..6157fa3015a3 100644 --- a/arch/arm/mach-tegra/board-kai.c +++ b/arch/arm/mach-tegra/board-kai.c @@ -286,8 +286,17 @@ static struct i2c_board_info __initdata rt5640_board_info = { .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ), }; +static struct i2c_board_info __initdata rt5639_board_info = { + I2C_BOARD_INFO("rt5639", 0x1c), + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ), +}; + static void kai_i2c_init(void) { + struct board_info board_info; + + tegra_get_board_info(&board_info); + tegra_i2c_device1.dev.platform_data = &kai_i2c1_platform_data; tegra_i2c_device2.dev.platform_data = &kai_i2c2_platform_data; tegra_i2c_device3.dev.platform_data = &kai_i2c3_platform_data; @@ -303,7 +312,10 @@ static void kai_i2c_init(void) i2c_register_board_info(4, kai_i2c4_smb349_board_info, ARRAY_SIZE(kai_i2c4_smb349_board_info)); - i2c_register_board_info(4, &rt5640_board_info, 1); + if (board_info.fab == BOARD_FAB_A00) + i2c_register_board_info(4, &rt5640_board_info, 1); + else + i2c_register_board_info(4, &rt5639_board_info, 1); } static struct platform_device *kai_uart_devices[] __initdata = { @@ -669,6 +681,18 @@ static void kai_usb_init(void) static void kai_usb_init(void) { } #endif +static void kai_audio_init(void) +{ + struct board_info board_info; + + tegra_get_board_info(&board_info); + + if (!(board_info.fab == BOARD_FAB_A00)) { + kai_audio_pdata.codec_name = "rt5639.4-001c"; + kai_audio_pdata.codec_dai_name = "rt5639-aif1"; + } +} + static void __init tegra_kai_init(void) { tegra_thermal_init(&thermal_data); @@ -682,6 +706,7 @@ static void __init tegra_kai_init(void) #endif kai_uart_init(); kai_tsensor_init(); + kai_audio_init(); platform_add_devices(kai_devices, ARRAY_SIZE(kai_devices)); tegra_ram_console_debug_init(); kai_sdhci_init(); -- cgit v1.2.3