summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2010-12-20 18:05:52 -0500
committerNicolin Chen <nicolinc@nvidia.com>2017-08-11 15:14:12 -0400
commit0233a9543d99932fa0ff058dbee4e097d84f9730 (patch)
tree2ac550337255f7c9476869a0bf0c07269d625188 /include/linux
parent027631c1aa79a541aad5d4a45eb2412bf2b30d94 (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> Rebase-Id: R50bf7691d332dd562e3ef125095c7cca7ccc3abf
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 c6b396246..d65693507 100644
--- a/include/linux/nct1008.h
+++ b/include/linux/nct1008.h
@@ -1,54 +1,40 @@
1/* 1/*
2 * Copyright (C) 2010 Motorola, Inc. 2 * include/linux/nct1008.h
3 *
4 * NCT1008, temperature monitoring device from ON Semiconductors
5 *
6 * Copyright (c) 2010, NVIDIA Corporation.
3 * 7 *
4 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License as published by
6 * published by the Free Software Foundation. 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
7 * 12 *
8 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * GNU General Public License for more details. 16 * more details.
12 * 17 *
13 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License along
14 * along with this program; if not, write to the Free Software 19 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * 02111-1307, USA
17 */ 21 */
18 22
19#ifndef _LINUX_NCT1008_H__ 23#ifndef _LINUX_NCT1008_H
20#define _LINUX_NCT1008_H__ 24#define _LINUX_NCT1008_H
21
22/* NCT1008 Read Only Registers */
23#define NCT_LOCAL_TEMP_RD 0x00
24#define NCT_EXT_TEMP_HIGH_RD 0x01
25#define NCT_EXT_TEMP_LOW_RD 0x10
26#define NCT_STATUS_RD 0x02
27
28/* NCT1008 Control Registers */
29#define NCT_CONFIG_RD 0x03
30#define NCT_CONFIG_WR 0x09
31#define NCT_CONV_RATE_RD 0x04
32#define NCT_CONV_RATE_WR 0x0A
33
34/* NCT1008 Limit Registers */
35#define NCT_LOCAL_TEMP_HIGH_LIMIT_RD 0x05
36#define NCT_LOCAL_TEMP_LOW_LIMIT_RD 0x06
37#define NCT_LOCAL_TEMP_HIGH_LIMIT_WR 0x0B
38#define NCT_LOCAL_TEMP_LOW_LIMIT_WR 0x0C
39 25
40#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_RD 0x07 26#include <linux/types.h>
41#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_RD 0x08
42#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_WR 0x0D
43#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_WR 0x0E
44#define NCT_EXT_TEMP_HIGH_LIMIT_LBYTE_RDWR 0x13
45#define NCT_EXT_TEMP_LOW_LIMIT_LBYTE_RDWR 0x14
46#define NCT_EXT_THERM_LIMIT 0x19
47#define NCT_LOCAL_THERM_LIMIT 0x20
48 27
49#define NCT_EXT_TEMP_OFFSET_HIGH_RDWR 0x11 28struct nct1008_platform_data {
50#define NCT_EXT_TEMP_OFFSET_LOW_RDWR 0x12 29 bool supported_hwrev;
51#define NCT_THERM_HYST 0x21 30 bool ext_range;
52#define NCT_CONSEC_ALERT 0x22 31 u8 conv_rate;
32 u8 offset;
33 u8 hysteresis;
34 u8 shutdown_ext_limit;
35 u8 shutdown_local_limit;
36 u8 throttling_ext_limit;
37 void (*alarm_fn)(bool raised);
38};
53 39
54#endif /* _LINUX_NCT1008_H__ */ 40#endif /* _LINUX_NCT1008_H */