arm: tegra: E1239: Add TI aic326x support
Manoj Gangwal [Wed, 22 Aug 2012 14:32:19 +0000 (19:32 +0530)]
1) Add latest TI aic326x codec driver support
2) Dmic support for TAI

Bug 1034241

Change-Id: I8db5223fd203a4e8f93f159a9c654486831f08a1
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/125265
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/board-enterprise.c
arch/arm/mach-tegra/board-enterprise.h

index 498f8a1..88c8247 100644 (file)
@@ -38,6 +38,8 @@
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/memblock.h>
 #include <linux/rfkill-gpio.h>
+#include <linux/mfd/tlv320aic3262-registers.h>
+#include <linux/mfd/tlv320aic3262-core.h>
 
 #include <linux/nfc/pn544.h>
 #include <sound/max98088.h>
@@ -210,6 +212,44 @@ static __initdata struct tegra_clk_init_table enterprise_clk_i2s4_table[] = {
        { NULL,         NULL,           0,              0},
 };
 
+static struct aic3262_gpio_setup aic3262_gpio[] = {
+       /* GPIO 1*/
+       {
+               .used           = 1,
+               .in             = 0,
+               .value          = AIC3262_GPIO1_FUNC_INT1_OUTPUT ,
+       },
+       /* GPIO 2*/
+       {
+               .used           = 1,
+               .in             = 0,
+               .value          = AIC3262_GPIO2_FUNC_ADC_MOD_CLK_OUTPUT,
+       },
+       /* GPIO 1 */
+       {
+               .used           = 0,
+       },
+       {// GPI2
+               .used           = 1,
+               .in             = 1,
+               .in_reg         = AIC3262_DMIC_INPUT_CNTL,
+               .in_reg_bitmask = AIC3262_DMIC_CONFIGURE_MASK,
+               .in_reg_shift   = AIC3262_DMIC_CONFIGURE_SHIFT,
+               .value          = AIC3262_DMIC_GPI2_LEFT_GPI2_RIGHT,
+       },
+       {// GPO1
+               .used           = 0,
+               .value          = AIC3262_GPO1_FUNC_DISABLED,
+       },
+};
+
+static struct aic3262_pdata aic3262_codec_pdata = {
+       .gpio_irq       = 1,
+       .gpio           = aic3262_gpio,
+       .naudint_irq    = TEGRA_GPIO_HP_DET,
+       .irq_base       = AIC3262_CODEC_IRQ_BASE,
+};
+
 static struct tegra_i2c_platform_data enterprise_i2c1_platform_data = {
        .adapter_nr     = 0,
        .bus_count      = 1,
@@ -364,8 +404,9 @@ static struct i2c_board_info __initdata max98088_board_info = {
 };
 
 static struct i2c_board_info __initdata enterprise_codec_aic326x_info = {
-       I2C_BOARD_INFO("aic3262-codec", 0x18),
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_HP_DET),
+       I2C_BOARD_INFO("tlv320aic3262", 0x18),
+       .platform_data = &aic3262_codec_pdata,
+       .irq = TEGRA_GPIO_HP_DET,
 };
 
 static struct i2c_board_info __initdata nfc_board_info = {
index b77c3ca..e9bda70 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-enterprise.h
  *
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2012, NVIDIA Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -94,6 +94,11 @@ void enterprise_bpc_mgmt_init(void);
 #define ENT_TPS80031_IRQ_BASE  TEGRA_NR_IRQS
 #define ENT_TPS80031_IRQ_END  (ENT_TPS80031_IRQ_BASE + TPS80031_INT_NR)
 
+/* AIC326X IRQs */
+/* Assuming TPS is the PMIC on Ent */
+#define AIC3262_CODEC_IRQ_BASE ENT_TPS80031_IRQ_END
+#define AIC3262_CODEC_IRQ_END  (AIC3262_CODEC_IRQ_BASE + 6)
+
 /*****************Camera GPIOs ******************/
 #define CAM_CSI_MUX_SEL_GPIO   TEGRA_GPIO_PM3
 #define CAM_CSI_MUX_SEL_REAR   1