summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2011-02-02 18:55:07 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-02-04 18:13:15 -0800
commitb5fad90bbbc874b198cf361765d0470e6aae7606 (patch)
treeeb9c1a6c86a2d6d53ef84713e9e9ac70bf16ec9f /arch
parent8218b24b8e3ab3e4c18f23c193f1e7373bc05be2 (diff)
[ARM] tegra: i2c registration for ADT7461
Registering ADT7461 thermal sensor on i2c bus 4. Bug 782954 Change-Id: Idd4426df2cdd1d12cc33fffb4dd72f52254a2cf7 Reviewed-on: http://git-master/r/18019 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-whistler-sensors.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sensors.c b/arch/arm/mach-tegra/board-whistler-sensors.c
index a882e437baf9..20c37c326c38 100644
--- a/arch/arm/mach-tegra/board-whistler-sensors.c
+++ b/arch/arm/mach-tegra/board-whistler-sensors.c
@@ -33,6 +33,7 @@
#define ADXL34X_IRQ_GPIO TEGRA_GPIO_PAA1
#define ISL29018_IRQ_GPIO TEGRA_GPIO_PK2
+#define ADT7461_IRQ_GPIO TEGRA_GPIO_PI2
static struct regulator *reg_avdd_cam1; /* LDO9 */
static struct regulator *reg_vdd_af; /* LDO13 */
@@ -151,6 +152,20 @@ static struct i2c_board_info whistler_i2c1_board_info[] = {
},
};
+static void whistler_adt7461_init(void)
+{
+ tegra_gpio_enable(ADT7461_IRQ_GPIO);
+ gpio_request(ADT7461_IRQ_GPIO, "adt7461");
+ gpio_direction_input(ADT7461_IRQ_GPIO);
+}
+
+static struct i2c_board_info whistler_i2c4_board_info[] = {
+ {
+ I2C_BOARD_INFO("adt7461", 0x4C),
+ .irq = TEGRA_GPIO_TO_IRQ(ADT7461_IRQ_GPIO),
+ },
+};
+
int __init whistler_sensors_init(void)
{
whistler_camera_init();
@@ -159,11 +174,16 @@ int __init whistler_sensors_init(void)
whistler_isl29018_init();
+ whistler_adt7461_init();
+
i2c_register_board_info(0, whistler_i2c1_board_info,
ARRAY_SIZE(whistler_i2c1_board_info));
i2c_register_board_info(3, whistler_i2c3_board_info,
ARRAY_SIZE(whistler_i2c3_board_info));
+ i2c_register_board_info(4, whistler_i2c4_board_info,
+ ARRAY_SIZE(whistler_i2c4_board_info));
+
return 0;
}