summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2010-12-20 15:05:52 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:36:52 -0800
commitf0cd326e64c8cc2e47784d61696c89dce926987e (patch)
tree669129b85f6ab7117ea63280ca54e174ce48eeb7 /include/linux
parentce469d64ab8b55799ec55c64954dcf64ef6ddb3d (diff)
NCT1008 temperature sensor driver
Replace the PM-only driver for NCT1008 with a new version written by Varun Wadekar and Dmitriy Gruzman. Add a callback to an alarm function specified in the board platform data. Change-Id: Ib429533930ee75af3402d24b0bc286da9f6ee67b Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nct1008.h74
1 files changed, 30 insertions, 44 deletions
diff --git a/include/linux/nct1008.h b/include/linux/nct1008.h
index c6b396246659..d65693507299 100644
--- a/include/linux/nct1008.h
+++ b/include/linux/nct1008.h
@@ -1,54 +1,40 @@
/*
- * Copyright (C) 2010 Motorola, Inc.
+ * include/linux/nct1008.h
+ *
+ * NCT1008, temperature monitoring device from ON Semiconductors
+ *
+ * Copyright (c) 2010, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#ifndef _LINUX_NCT1008_H__
-#define _LINUX_NCT1008_H__
-
-/* NCT1008 Read Only Registers */
-#define NCT_LOCAL_TEMP_RD 0x00
-#define NCT_EXT_TEMP_HIGH_RD 0x01
-#define NCT_EXT_TEMP_LOW_RD 0x10
-#define NCT_STATUS_RD 0x02
-
-/* NCT1008 Control Registers */
-#define NCT_CONFIG_RD 0x03
-#define NCT_CONFIG_WR 0x09
-#define NCT_CONV_RATE_RD 0x04
-#define NCT_CONV_RATE_WR 0x0A
-
-/* NCT1008 Limit Registers */
-#define NCT_LOCAL_TEMP_HIGH_LIMIT_RD 0x05
-#define NCT_LOCAL_TEMP_LOW_LIMIT_RD 0x06
-#define NCT_LOCAL_TEMP_HIGH_LIMIT_WR 0x0B
-#define NCT_LOCAL_TEMP_LOW_LIMIT_WR 0x0C
+#ifndef _LINUX_NCT1008_H
+#define _LINUX_NCT1008_H
-#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_RD 0x07
-#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_RD 0x08
-#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_WR 0x0D
-#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_WR 0x0E
-#define NCT_EXT_TEMP_HIGH_LIMIT_LBYTE_RDWR 0x13
-#define NCT_EXT_TEMP_LOW_LIMIT_LBYTE_RDWR 0x14
-#define NCT_EXT_THERM_LIMIT 0x19
-#define NCT_LOCAL_THERM_LIMIT 0x20
+#include <linux/types.h>
-#define NCT_EXT_TEMP_OFFSET_HIGH_RDWR 0x11
-#define NCT_EXT_TEMP_OFFSET_LOW_RDWR 0x12
-#define NCT_THERM_HYST 0x21
-#define NCT_CONSEC_ALERT 0x22
+struct nct1008_platform_data {
+ bool supported_hwrev;
+ bool ext_range;
+ u8 conv_rate;
+ u8 offset;
+ u8 hysteresis;
+ u8 shutdown_ext_limit;
+ u8 shutdown_local_limit;
+ u8 throttling_ext_limit;
+ void (*alarm_fn)(bool raised);
+};
-#endif /* _LINUX_NCT1008_H__ */
+#endif /* _LINUX_NCT1008_H */