diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2011-01-11 17:51:38 +0530 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2011-01-11 10:08:07 -0800 |
commit | c10605557b35ed7e8e70322daa8925b70be27056 (patch) | |
tree | 08a4e75cfa52161bd253e69def682217eb15b10d | |
parent | 7c672d40b0470c10a80ef99971ccdd19a832c617 (diff) |
misc: nct1008: add platform specific data
Bug 742230
Change-Id: Ie619ac24e76ac48fe0f1bf8b4844392c2aae8aa3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/15497
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-sensors.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c index c80fc00cc7d7..3ba9e8345796 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -19,11 +19,11 @@ */ #include <linux/i2c.h> -#include <linux/i2c/nct1008.h> #include <linux/akm8975.h> #include <linux/mpu3050.h> #include <linux/i2c/pca954x.h> #include <linux/i2c/pca953x.h> +#include <linux/nct1008.h> #include <mach/gpio.h> @@ -39,6 +39,9 @@ #define CAMERA_POWER_GPIO TEGRA_GPIO_PV4 #define CAMERA_CSI_MUX_SEL_GPIO TEGRA_GPIO_PBB4 #define AC_PRESENT_GPIO TEGRA_GPIO_PV3 +#define NCT1008_THERM2_GPIO TEGRA_GPIO_PN6 + +extern void tegra_throttling_enable(bool enable); static int ventana_camera_init(void) { @@ -93,11 +96,23 @@ static void ventana_bq20z75_init(void) gpio_direction_input(AC_PRESENT_GPIO); } -struct nct1008_platform_data ventana_nct1008_pdata = { - .conv_rate = 5, - .config = NCT1008_CONFIG_ALERT_DISABLE, - .thermal_threshold = 120, +static void ventana_nct1008_init(void) +{ + tegra_gpio_enable(NCT1008_THERM2_GPIO); + gpio_request(NCT1008_THERM2_GPIO, "temp_alert"); + gpio_direction_input(NCT1008_THERM2_GPIO); +} + +static struct nct1008_platform_data ventana_nct1008_pdata = { + .supported_hwrev = true, + .ext_range = false, + .conv_rate = 0x08, .offset = 0, + .hysteresis = 0, + .shutdown_ext_limit = 115, + .shutdown_local_limit = 120, + .throttling_ext_limit = 90, + .alarm_fn = tegra_throttling_enable, }; static const struct i2c_board_info ventana_i2c0_board_info[] = { @@ -211,6 +226,7 @@ int __init ventana_sensors_init(void) ventana_akm8975_init(); #endif ventana_camera_init(); + ventana_nct1008_init(); i2c_register_board_info(0, ventana_i2c0_board_info, ARRAY_SIZE(ventana_i2c0_board_info)); |