summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2011-01-11 17:51:38 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:10 -0800
commitd40bf39b8aa80f970fed8bfebb1d2aefca4a3eb7 (patch)
tree17c0ad0d09080f5edcaa2f0150c8174368a99993
parentc5235d8662269c2ba55669c404510e4cd1b2f854 (diff)
misc: nct1008: add platform specific data
Bug 742230 Original-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> Rebase-Id: R5cc336b999984ff823c4111dd396647e36ee6f62
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c26
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 b051b33ba656..f922ff81ad2e 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -19,10 +19,10 @@
*/
#include <linux/i2c.h>
-#include <linux/i2c/nct1008.h>
#include <linux/akm8975.h>
#include <linux/i2c/pca954x.h>
#include <linux/i2c/pca953x.h>
+#include <linux/nct1008.h>
#include <mach/gpio.h>
@@ -38,6 +38,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)
{
@@ -90,11 +93,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[] = {
@@ -165,6 +180,7 @@ int __init ventana_sensors_init(void)
ventana_isl29018_init();
ventana_akm8975_init();
ventana_camera_init();
+ ventana_nct1008_init();
i2c_register_board_info(0, ventana_i2c0_board_info,
ARRAY_SIZE(ventana_i2c0_board_info));