From 339893ab8bc37bfa669dcdddafac9931ab7a8cb0 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 7 Oct 2011 06:29:46 +0000 Subject: 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. --- sys/dev/i2c/i2c_scan.c | 25 ++++++++++++++++--------- sys/dev/i2c/sdtemp.c | 4 +++- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'sys/dev') 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 @@ -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 && @@ -906,14 +905,22 @@ iic_probe_sensor(struct device *self, u_int8_t addr) (iicprobew(0x07) & 0xfffe) == 0x0000 && (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); -- cgit v1.2.3