diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2011-07-21 12:15:26 +0530 |
---|---|---|
committer | Manish Tuteja <mtuteja@nvidia.com> | 2011-07-22 03:52:36 -0700 |
commit | 32fc4be47d820683b4b65e5548c61a3ac5ac9521 (patch) | |
tree | d61881d47a51eaf32231cfbeb4e41b014aef9282 /arch | |
parent | 5596558bd79720be8526bec5269124c1fd67e24e (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
Change-Id: Ie54cd1f81f6d833757615f707bac1a4336ce8174
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/41738
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-sensors.c | 41 |
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 8984e056857b..d18a88260ca0 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/tegra2_fuse.h> #include "gpio-names.h" @@ -48,8 +52,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 @@ -247,6 +254,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), @@ -312,6 +343,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) @@ -333,6 +368,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; } |