sdtemp_reg.h revision 1.12 1 /* $NetBSD: sdtemp_reg.h,v 1.12 2016/12/07 04:58:39 nonaka Exp $ */
2
3 /*
4 * Copyright (c) 2009 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Goyette.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef _DEV_I2C_SDTEMPREG_H
33 #define _DEV_I2C_SDTEMPREG_H
34
35 /*
36 * Following definitions derived from JEDEC Standard 21-C section 4.7
37 * available at http://www.jedec.org/download/search/4_07R15.pdf
38 */
39 #define SDTEMP_ADDRMASK 0x3f8
40 #define SDTEMP_ADDR 0x18 /* I2C address 001 1xxx */
41
42 #define SDTEMP_REG_CAPABILITY 0x00
43 #define SDTEMP_REG_CONFIG 0x01
44 #define SDTEMP_REG_UPPER_LIM 0x02
45 #define SDTEMP_REG_LOWER_LIM 0x03
46 #define SDTEMP_REG_CRIT_LIM 0x04
47 #define SDTEMP_REG_AMBIENT_TEMP 0x05
48 #define SDTEMP_REG_MFG_ID 0x06
49 #define SDTEMP_REG_DEV_REV 0x07
50
51 #define SDTEMP_CAP_HAS_ALARM 0x0001
52 #define SDTEMP_CAP_ACCURACY_1C 0x0002
53 #define SDTEMP_CAP_WIDER_RANGE 0x0004
54 #define SDTEMP_CAP_RESOLUTION 0x0018
55 #define SDTEMP_CAP_RESOLUTION_MAX 0x0003 /* 0.0625C */
56 #define SDTEMP_CAP_VHV 0x0020
57 #define SDTEMP_CAP_TMOUT 0x0040
58 #define SDTEMP_CAP_EVSD 0x0080
59
60
61 #define SDTEMP_CONFIG_EVENT_MODE 0x0001
62 #define SDTEMP_CONFIG_EVENT_POL_AH 0x0002
63 #define SDTEMP_CONFIG_EVENT_CRIT_ONLY 0x0004
64 #define SDTEMP_CONFIG_EVENT_ENABLED 0x0008
65 #define SDTEMP_CONFIG_EVENT_STATUS 0x0010
66 #define SDTEMP_CONFIG_INT_CLEAR 0x0020
67 #define SDTEMP_CONFIG_WINDOW_LOCKED 0x0040
68 #define SDTEMP_CONFIG_CRITICAL_LOCKED 0x0080
69 #define SDTEMP_CONFIG_SHUTDOWN_MODE 0x0100
70 #define SDTEMP_CONFIG_HYSTERESIS 0x0600
71
72 #define SDTEMP_HYSTERESIS_NONE 0x0000
73 #define SDTEMP_HYSTERESIS_15 0x0200
74 #define SDTEMP_HYSTERESIS_30 0x0400
75 #define SDTEMP_HYSTERESIS_60 0x0600
76
77 /*
78 * Temperature is a 13-bit value in the range of -256 <= x < +256 degrees.
79 * Maximum resolution is 0.0625C (1/16th degree, 4 bits), but some devices
80 * may have only 0.2500C or 0.1250C (1 or 2 bits), and some devices may not
81 * be able to represent negative values (not that we'd expect them, anyway).
82 */
83 #define SDTEMP_TEMP_MASK 0x0FFF
84 #define SDTEMP_TEMP_NEGATIVE 0x1000
85 #define SDTEMP_TEMP_SIGN_EXT 0xF000
86
87 /*
88 * Status bits set in SDTEMP_REG_AMBIENT_TEMP only
89 */
90 #define SDTEMP_ABOVE_CRIT 0x8000
91 #define SDTEMP_ABOVE_UPPER 0x4000
92 #define SDTEMP_BELOW_LOWER 0x2000
93
94 /*
95 * Devices known to conform to JEDEC JC42.4
96 */
97
98 /* TSE2004av definitions (JEDEC Standard No. 21-C Page 4.1.6) */
99 #define TSE2004AV_ID 0x2200
100 #define TSE2004AV_MASK 0xff00 /* ID is upper 8bits */
101 #define TSE2004AV_REV 0x00ff /* Revision is lower 8bits */
102 #define SDTEMP_IS_TSE2004AV(dev) (((dev) & TSE2004AV_MASK) == TSE2004AV_ID)
103
104 /* Atmel */
105 #define AT_MANUFACTURER_ID 0x001f
106 #define AT_30TS00_DEVICE_ID 0x8201 /* Also matches 002A and 002B */
107 #define AT_30TS00_MASK 0xFFFF
108
109 #define AT2_MANUFACTURER_ID 0x1114
110 #define AT2_30TSE004_DEVICE_ID 0x2200
111 #define AT2_30TSE004_MASK 0xFFFF
112
113 /* Giantec Semiconductor */
114 #define GT_MANUFACTURER_ID 0x1C68
115 #define GT_30TS00_DEVICE_ID 0x2201
116 #define GT_30TS00_MASK 0xFFFF
117
118 #define GT2_MANUFACTURER_ID 0x132D
119 #define GT2_34TS02_DEVICE_ID 0x3300
120 #define GT2_34TS02_MASK 0xFFFF
121
122 /* Maxim */
123 #define MAXIM_MANUFACTURER_ID 0x004D
124 #define MAX_6604_DEVICE_ID 0x3E00
125 #define MAX_6604_MASK 0xFFFF
126
127 /* Microchip */
128 #define MCP_MANUFACTURER_ID 0x0054
129 #define MCP_9804_DEVICE_ID 0x0200
130 #define MCP_9804_MASK 0xFFFC
131 #define MCP_9805_DEVICE_ID 0x0000 /* Also matches MCP9843 */
132 #define MCP_9805_MASK 0xFFFE
133 #define MCP_98242_DEVICE_ID 0x2000
134 #define MCP_98242_MASK 0xFFFC
135 #define MCP_98243_DEVICE_ID 0x2100
136 #define MCP_98243_MASK 0xFFFC
137 #define MCP_98244_DEVICE_ID 0x2200
138 #define MCP_98244_MASK 0xFFFC
139
140 #define SDTEMP_REG_MCP_RESOLUTION_9804 0x08 /* 9804, 9824[23] */
141 #define SDTEMP_REG_MCP_RESOLUTION_98244 0x09 /* 98244 */
142
143 /* NXP Semiconductors */
144 /* According to datasheets, SE97 and SE98 have same ID */
145 #define NXP_MANUFACTURER_ID 0x1131
146 #define NXP_SE98_DEVICE_ID 0xA100
147 #define NXP_SE98_MASK 0xFFFC
148 #define NXP_SE97_DEVICE_ID 0xA200
149 #define NXP_SE97_MASK 0xFFFC
150
151 /* Analog Devices */
152 #define ADT_MANUFACTURER_ID 0x11D4
153 #define ADT_7408_DEVICE_ID 0x8001
154 #define ADT_7408_MASK 0xFFFF
155
156 /* IDT */
157 #define IDT_MANUFACTURER_ID 0x00B3
158 #define IDT_TS3000B3_DEVICE_ID 0x2903 /* Also matches TSE2002B3 */
159 #define IDT_TS3000B3_MASK 0xFFFF
160 #define IDT_TS3000GB0_DEVICE_ID 0x2913
161 #define IDT_TS3000GB0_MASK 0xFFFF
162 #define IDT_TS3000GB2_DEVICE_ID 0x2912 /* Also matched TSE2002GB2 */
163 #define IDT_TS3000GB2_MASK 0xFFFF
164 #define IDT_TS3001GB2_DEVICE_ID 0x3001
165 #define IDT_TS3001GB2_MASK 0xFFFF
166 #define IDT_TSE2004GB2_DEVICE_ID 0x2214
167 #define IDT_TSE2004GB2_MASK 0xFFFF
168
169 #define SDTEMP_REG_IDT_RESOLUTION 0x08 /* 2002 */
170
171 /* STmicroelectronics */
172 #define STTS_MANUFACTURER_ID 0x104A
173 #define STTS_424_DEVICE_ID 0x0101
174 #define STTS_424_MASK 0xFFFF
175 #define STTS_424E_DEVICE_ID 0x0000
176 #define STTS_424E_MASK 0xFFFE
177 #define STTS_3000_DEVICE_ID 0x0200
178 #define STTS_3000_MASK 0xFFFF
179 #define STTS_2002_DEVICE_ID 0x0300
180 #define STTS_2002_MASK 0xFFFF
181 #define STTS_2004_DEVICE_ID 0x2201
182 #define STTS_2004_MASK 0xFFFF
183
184 /* On Semiconductor (Catalyst) */
185 /* According to datasheets, both the CAT6095 and CAT34TS02 have the same ID */
186 #define CAT_MANUFACTURER_ID 0x1B09
187 #define CAT_34TS02_DEVICE_ID 0x0800
188 #define CAT_34TS02_MASK 0xFFE0
189 #define CAT_34TS02C_DEVICE_ID 0x0a00
190 #define CAT_34TS02C_MASK 0xFFFE
191 #define CAT_34TS04_DEVICE_ID 0x2200
192 #define CAT_34TS04_MASK 0xFFFF
193
194 #endif /* _DEV_I2C_SDTEMPREG_H */
195