diff options
author | Prashant Gaikwad <pgaikwad@nvidia.com> | 2011-02-02 18:55:07 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:24 -0800 |
commit | 13c8febdf400c9d1357424ed8de39038e6917412 (patch) | |
tree | 5da445b3fd7427fc6b757c3e78b204755304b3b4 /arch/arm/mach-tegra/board-whistler-sensors.c | |
parent | 771b61a5f3ff7918d453d0451097b9050fba9d3f (diff) |
[ARM] tegra: i2c registration for ADT7461
Registering ADT7461 thermal sensor on i2c bus 4.
Bug 782954
Original-Change-Id: Idd4426df2cdd1d12cc33fffb4dd72f52254a2cf7
Reviewed-on: http://git-master/r/18019
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R963865ddcbc4a1772df37a8f1bfa6cf16269bb4d
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-sensors.c')
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-sensors.c | 20 |
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; } |