summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-10-07 06:29:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-10-07 06:29:46 +0000
commit339893ab8bc37bfa669dcdddafac9931ab7a8cb0 (patch)
treec1199e124f9bc30745168dcffe067a5a902bcf2c
parentad48b2727d9660da9cac97dde4f90ad21cbf2411 (diff)
Detect the ts3000b3 and stts2002, and weaken the cat34ts02 model check
since a similar device (not yet named as far as I can see) has showed up on the market. cat34ts02 tested by weerd.
-rw-r--r--share/man/man4/sdtemp.48
-rw-r--r--sys/dev/i2c/i2c_scan.c25
-rw-r--r--sys/dev/i2c/sdtemp.c4
3 files changed, 23 insertions, 14 deletions
diff --git a/share/man/man4/sdtemp.4 b/share/man/man4/sdtemp.4
index 90cb118261b..eee9df5d9c1 100644
--- a/share/man/man4/sdtemp.4
+++ b/share/man/man4/sdtemp.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sdtemp.4,v 1.8 2010/07/09 08:05:46 deraadt Exp $
+.\" $OpenBSD: sdtemp.4,v 1.9 2011/10/07 06:29:45 deraadt Exp $
.\"
.\" Copyright (c) 2008 Theo de Raadt <deraadt@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 9 2010 $
+.Dd $Mdocdate: October 7 2011 $
.Dt SDTEMP 4
.Os
.Sh NAME
@@ -30,8 +30,8 @@ modules which contain sensor chips defined in JEDEC JC-42.4.
.Pp
Current sensor chips include the NXP SE97, NXP SE98,
Maxim 6604, Microchip MCP9805, Microchip MCP98242,
-Microchip MCP98243, AD ADT7408, ST STTS424, ON CAT6095 and
-ON CAT34TS02.
+Microchip MCP98243, IDT TS3000B3, ADT ADT7408, ST STTS424,
+ST STTS2002, ON CAT6095 and ON CAT34TS02.
.Sh SEE ALSO
.Xr iic 4
.Sh HISTORY
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 534a2297ca7..99d7847f386 100644
--- a/sys/dev/i2c/i2c_scan.c
+++ b/sys/dev/i2c/i2c_scan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c_scan.c,v 1.139 2011/05/26 01:40:33 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.140 2011/10/07 06:29:43 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -875,9 +875,8 @@ iic_probe_sensor(struct device *self, u_int8_t addr)
iicprobe(0x16) == 0x41 && ((iicprobe(0x17) & 0xf0) == 0x40)) {
name = "adm1026";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x1131 &&
- (iicprobew(0x07) & 0xfffc) == 0xa200 &&
- (iicprobew(0x00) & 0xfff0) == 0x0010) {
- name = "se97";
+ (iicprobew(0x07) & 0xfffc) == 0xa200) {
+ name = "se97"; /* or se97b */
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x1131 &&
(iicprobew(0x07) & 0xfffc) == 0xa101 &&
(iicprobew(0x00) & 0xfff0) == 0x0010) {
@@ -887,15 +886,15 @@ iic_probe_sensor(struct device *self, u_int8_t addr)
(iicprobew(0x00) & 0xffe0) == 0x0000) {
name = "max6604";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x0054 &&
- iicprobew(0x07) == 0x0000 &&
+ (iicprobew(0x07) & 0xff00) == 0x0000 &&
(iicprobew(0x00) & 0xffe0) == 0x0000) {
- name = "mcp9805";
+ name = "mcp9805"; /* or mcp9843 */
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x0054 &&
(iicprobew(0x07) & 0xfffc) == 0x2000 &&
(iicprobew(0x00) & 0xffe0) == 0x0000) {
name = "mcp98242";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x0054 &&
- (iicprobew(0x07) & 0xfffc) == 0x2100 &&
+ (iicprobew(0x07) & 0xff00) == 0x2100 &&
(iicprobew(0x00) & 0xff00) == 0x0000) {
name = "mcp98243";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x11d4 &&
@@ -907,13 +906,21 @@ iic_probe_sensor(struct device *self, u_int8_t addr)
(iicprobew(0x00) == 0x002d || iicprobew(0x00) == 0x002f)) {
name = "stts424e02";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x104a &&
+ (iicprobew(0x07) & 0xfffe) == 0x0300 &&
+ (iicprobew(0x00) == 0x006f)) {
+ name = "stts2002";
+ } else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x104a &&
(iicprobew(0x07) & 0xfffe) == 0x0101 &&
(iicprobew(0x00) == 0x002d || iicprobew(0x00) == 0x002f)) {
name = "stts424";
} else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x1b09 &&
(iicprobew(0x07) & 0xffe0) == 0x0800 &&
- iicprobew(0x00) == 0x001f) {
- name = "cat34ts02"; /* or cat6095 */
+ (iicprobew(0x00) & 0x001f) == 0x001f) {
+ name = "cat34ts02"; /* or cat6095, prod 0x0813 */
+ } else if ((addr & 0x78) == 0x18 && iicprobew(0x06) == 0x00b3 &&
+ (iicprobew(0x07) & 0xffff) == 0x2903 &&
+ (iicprobew(0x00) == 0x004f)) {
+ name = "ts3000b3"; /* or tse2002b3 */
} else if ((addr & 0x7e) == 0x1c && iicprobe(0x0f) == 0x3b &&
(iicprobe(0x21) & 0x60) == 0x00 &&
iicprobe(0x0f) == iicprobe(0x8f) && /* registers address is 7 bits */
diff --git a/sys/dev/i2c/sdtemp.c b/sys/dev/i2c/sdtemp.c
index 99599f1038b..48b7bc5d25d 100644
--- a/sys/dev/i2c/sdtemp.c
+++ b/sys/dev/i2c/sdtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdtemp.c,v 1.12 2010/07/09 08:05:45 deraadt Exp $ */
+/* $OpenBSD: sdtemp.c,v 1.13 2011/10/07 06:29:43 deraadt Exp $ */
/*
* Copyright (c) 2008 Theo de Raadt
@@ -65,6 +65,8 @@ sdtemp_match(struct device *parent, void *match, void *aux)
strcmp(ia->ia_name, "adt7408") == 0 ||
strcmp(ia->ia_name, "stts424e02") == 0 ||
strcmp(ia->ia_name, "stts424") == 0 ||
+ strcmp(ia->ia_name, "stts2002") == 0 ||
+ strcmp(ia->ia_name, "ts3000b3") == 0 ||
strcmp(ia->ia_name, "cat34ts02") == 0)
return (1);
return (0);