kernel: arm: tegra: Enable TI codec support
Vinod G [Sat, 3 Dec 2011 00:54:59 +0000 (16:54 -0800)]
TI codec support is enabled for whistler.
Both wm8753 and TI codec are supported on the same build.
Card registration takes the available codec on board on initialization.
bug 816608

Change-Id: I2d149763693a373d882cd5d38f3a55d3b06aafc3
Reviewed-on: http://git-master/r/68048
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

Rebase-Id: Rc067b6ec5cbb63980f48ec1b2660ab79eb8c387f

arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/board-whistler.c

index 9c3438a..6e89c39 100644 (file)
@@ -139,6 +139,7 @@ config MACH_WHISTLER
        bool "Whistler board"
        depends on ARCH_TEGRA_2x_SOC
        select MACH_HAS_SND_SOC_TEGRA_WM8753 if SND_SOC
+       select MACH_HAS_SND_SOC_TEGRA_TLV320AIC326X if SND_SOC
        help
          Support for NVIDIA Whistler development platform
 
index 0e7f308..ba4f4b0 100644 (file)
@@ -46,6 +46,7 @@
 #include <mach/io.h>
 #include <mach/i2s.h>
 #include <mach/tegra_wm8753_pdata.h>
+#include <sound/tlv320aic326x.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -319,9 +320,21 @@ static struct tegra_i2c_platform_data whistler_dvc_platform_data = {
        .is_dvc         = true,
 };
 
-static struct i2c_board_info __initdata wm8753_board_info = {
-       I2C_BOARD_INFO("wm8753", 0x1a),
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_HP_DET),
+static struct aic326x_pdata whistler_aic3262_pdata = {
+       /* debounce time */
+       .debounce_time_ms = 512,
+};
+
+static struct i2c_board_info __initdata wm8753_board_info[] = {
+       {
+               I2C_BOARD_INFO("wm8753", 0x1a),
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_HP_DET),
+       },
+       {
+               I2C_BOARD_INFO("tlv320aic3262", 0x18),
+               .platform_data = &whistler_aic3262_pdata,
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_HP_DET),
+       },
 };
 
 static void whistler_i2c_init(void)
@@ -336,7 +349,8 @@ static void whistler_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device1);
 
-       i2c_register_board_info(4, &wm8753_board_info, 1);
+       i2c_register_board_info(4, wm8753_board_info,
+               ARRAY_SIZE(wm8753_board_info));
 }
 
 #define GPIO_SCROLL(_pinaction, _gpio, _desc)  \
@@ -382,7 +396,15 @@ static struct tegra_wm8753_platform_data whistler_audio_pdata = {
        .debounce_time_hp = 200,
 };
 
-static struct platform_device whistler_audio_device = {
+static struct platform_device whistler_audio_device1 = {
+       .name   = "tegra-snd-aic326x",
+       .id     = 0,
+       .dev    = {
+               .platform_data  = &whistler_audio_pdata,
+       },
+};
+
+static struct platform_device whistler_audio_device2 = {
        .name   = "tegra-snd-wm8753",
        .id     = 0,
        .dev    = {
@@ -405,7 +427,8 @@ static struct platform_device *whistler_devices[] __initdata = {
        &spdif_dit_device,
        &bluetooth_dit_device,
        &tegra_pcm_device,
-       &whistler_audio_device,
+       &whistler_audio_device1,
+       &whistler_audio_device2,
 };
 
 static int __init whistler_scroll_init(void)