ARM: tegra: cardhu: add device TI aic326x codec
Nikesh Oswal [Fri, 17 Feb 2012 10:12:45 +0000 (15:12 +0530)]
Change-Id: Idc0261b937471499dc5e3c549eae6dff43ca9118
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/84543
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

Rebase-Id: Rabbc1e02713be3c7c769b1761cc6a410197ed5e2

arch/arm/mach-tegra/board-cardhu.c

index 36f0fdd..d3fcbd2 100644 (file)
@@ -50,6 +50,7 @@
 #include <mach/io.h>
 #include <mach/i2s.h>
 #include <mach/tegra_wm8903_pdata.h>
+#include <mach/tegra_aic326x_pdata.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/usb_phy.h>
@@ -212,6 +213,7 @@ static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = {
        { "hda2codec_2x","pll_p",       48000000,       false},
        { "pwm",        "pll_p",        3187500,        false},
        { "blink",      "clk_32k",      32768,          true},
+       { "i2s0",       "pll_a_out0",   0,              false},
        { "i2s1",       "pll_a_out0",   0,              false},
        { "i2s3",       "pll_a_out0",   0,              false},
        { "spdif_out",  "pll_a_out0",   0,              false},
@@ -313,12 +315,26 @@ static struct wm8903_platform_data cardhu_wm8903_pdata = {
        },
 };
 
-static struct i2c_board_info __initdata wm8903_board_info = {
-       I2C_BOARD_INFO("wm8903", 0x1a),
-       .platform_data = &cardhu_wm8903_pdata,
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+static struct wm8903_platform_data cardhu_aic3262_pdata = {
+        .irq_active_low = 0,
+        .micdet_cfg = 0,
+        .micdet_delay = 100,
 };
 
+static struct i2c_board_info __initdata cardhu_board_info[] = {
+       {
+               I2C_BOARD_INFO("wm8903", 0x1a),
+               .platform_data = &cardhu_wm8903_pdata,
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+       },
+       {
+               I2C_BOARD_INFO("aic3262-codec", 0x18),
+               .platform_data=&cardhu_aic3262_pdata,
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+       },
+};
+
+
 static void cardhu_i2c_init(void)
 {
        tegra_i2c_device1.dev.platform_data = &cardhu_i2c1_platform_data;
@@ -333,7 +349,8 @@ static void cardhu_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device1);
 
-       i2c_register_board_info(4, &wm8903_board_info, 1);
+       i2c_register_board_info(4, cardhu_board_info, ARRAY_SIZE(cardhu_board_info));
+
        i2c_register_board_info(2, cardhu_i2c_bus3_board_info, 1);
 }
 
@@ -593,6 +610,22 @@ static struct platform_device cardhu_audio_device = {
        },
 };
 
+static struct tegra_aic326x_platform_data cardhu_aic326x_audio_pdata = {
+        .gpio_spkr_en           = -1,
+        .gpio_hp_det            = TEGRA_GPIO_HP_DET,
+        .gpio_hp_mute           = -1,
+        .gpio_int_mic_en        = -1,
+        .gpio_ext_mic_en        = -1,
+};
+
+static struct platform_device cardhu_aic326x_audio_device = {
+       .name   = "tegra-snd-aic326x",
+       .id     = 0,
+       .dev    = {
+               .platform_data  = &cardhu_aic326x_audio_pdata,
+       },
+};
+
 static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_pmu_device,
        &tegra_rtc_device,
@@ -612,13 +645,16 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_dam_device0,
        &tegra_dam_device1,
        &tegra_dam_device2,
+       &tegra_i2s_device0,
        &tegra_i2s_device1,
        &tegra_i2s_device3,
        &tegra_spdif_device,
        &spdif_dit_device,
        &bluetooth_dit_device,
+       &baseband_dit_device,
        &tegra_pcm_device,
        &cardhu_audio_device,
+       &cardhu_aic326x_audio_device,
        &tegra_hda_device,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
        &tegra_aes_device,