summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2011-07-21 12:15:26 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-07-25 18:46:29 -0700
commit70f2a7568287207cd724d85061b3e14a5ccedec2 (patch)
treea9b22687563c39855cac5738618555b4d684e0a2
parent7c6296eb8875d336886452657a1fb0886305a93a (diff)
arm: tegra: whistler: add tca6416 device
the gpio used for vdd_fuse is powered on by the i2c expander (GPIO_P02) present on the pmu board. Bug 836963 Reviewed-on: http://git-master/r/#change,41738 (cherry picked from commit f0a8261c68a5a7512c940b4098341b98d239580e) Change-Id: Iea34da2f4d86a55a5fcd8748a8512bee3f3480f6 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/42822 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-whistler-sensors.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sensors.c b/arch/arm/mach-tegra/board-whistler-sensors.c
index 1f0705550aa4..3ff796722b4d 100644
--- a/arch/arm/mach-tegra/board-whistler-sensors.c
+++ b/arch/arm/mach-tegra/board-whistler-sensors.c
@@ -40,6 +40,10 @@
#include <linux/err.h>
#include <linux/adt7461.h>
#include <generated/mach-types.h>
+#include <linux/gpio.h>
+#include <linux/i2c/pca953x.h>
+
+#include <mach/tegra_odm_fuses.h>
#include "gpio-names.h"
#include "cpu-tegra.h"
@@ -49,8 +53,11 @@
#define CAMERA2_PWDN_GPIO TEGRA_GPIO_PBB5
#define CAMERA2_RESET_GPIO TEGRA_GPIO_PBB1
#define CAMERA_AF_PD_GPIO TEGRA_GPIO_PT3
-#define CAMERA_FLASH_EN1_GPIO TEGRA_GPIO_PBB4
-#define CAMERA_FLASH_EN2_GPIO TEGRA_GPIO_PA0
+#define CAMERA_FLASH_EN1_GPIO TEGRA_GPIO_PBB4
+#define CAMERA_FLASH_EN2_GPIO TEGRA_GPIO_PA0
+
+#define TCA6416_GPIO_BASE (TEGRA_NR_GPIOS)
+#define FUSE_POWER_EN_GPIO (TCA6416_GPIO_BASE + 2)
#define ADXL34X_IRQ_GPIO TEGRA_GPIO_PAA1
#define ISL29018_IRQ_GPIO TEGRA_GPIO_PK2
@@ -246,6 +253,30 @@ struct soc380_platform_data whistler_soc380_data = {
.power_off = whistler_soc380_power_off,
};
+static int whistler_fuse_power_en(int enb)
+{
+ int ret;
+
+ ret = gpio_request(FUSE_POWER_EN_GPIO, "fuse_power_en");
+ if (ret) {
+ pr_err("%s: gpio_request fail (%d)\n", __func__, ret);
+ return ret;
+ }
+
+ ret = gpio_direction_output(FUSE_POWER_EN_GPIO, enb);
+ if (ret) {
+ pr_err("%s: gpio_direction_output fail (%d)\n", __func__, ret);
+ return ret;
+ }
+
+ gpio_free(FUSE_POWER_EN_GPIO);
+ return 0;
+}
+
+static struct pca953x_platform_data whistler_tca6416_data = {
+ .gpio_base = TCA6416_GPIO_BASE,
+};
+
static struct i2c_board_info whistler_i2c3_board_info[] = {
{
I2C_BOARD_INFO("ov5650", 0x36),
@@ -311,6 +342,10 @@ static struct i2c_board_info whistler_i2c4_board_info[] = {
.irq = TEGRA_GPIO_TO_IRQ(ADT7461_IRQ_GPIO),
.platform_data = &whistler_adt7461_pdata,
},
+ {
+ I2C_BOARD_INFO("tca6416", 0x20),
+ .platform_data = &whistler_tca6416_data,
+ },
};
int __init whistler_sensors_init(void)
@@ -332,6 +367,8 @@ int __init whistler_sensors_init(void)
i2c_register_board_info(3, whistler_i2c3_board_info,
ARRAY_SIZE(whistler_i2c3_board_info));
+ tegra_fuse_regulator_en = whistler_fuse_power_en;
+
return 0;
}