summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2009-01-17 20:30:28 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2009-01-17 20:30:28 +0000
commitd185b1a4f081405ed3f21065bbdaf7b3f355362c (patch)
treec6b1b16030eab39bb6101f5355c4322e478471ab
parent734e401a06c3fd1808628861bab9653af16377e5 (diff)
Add support for DS1822 to owtemp(4).
-rw-r--r--share/man/man4/owtemp.48
-rw-r--r--sys/dev/onewire/owtemp.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/share/man/man4/owtemp.4 b/share/man/man4/owtemp.4
index 8f4deee2810..b28e914c1f5 100644
--- a/share/man/man4/owtemp.4
+++ b/share/man/man4/owtemp.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: owtemp.4,v 1.6 2007/05/31 19:19:51 jmc Exp $
+.\" $OpenBSD: owtemp.4,v 1.7 2009/01/17 20:30:27 grange Exp $
.\"
.\" Copyright (c) 2006 Alexander Yurchenko <grange@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: May 31 2007 $
+.Dd $Mdocdate: January 17 2009 $
.Dt OWTEMP 4
.Os
.Sh NAME
@@ -35,7 +35,9 @@ The following chips are supported by the driver:
.Pp
.Bl -bullet -compact -offset indent
.It
-Maxim/Dallas DS1820/DS18S20/DS1920
+Maxim/Dallas DS1820/DS18B20/DS18S20/DS1822
+.It
+Maxim/Dallas DS1920
.El
.Sh SEE ALSO
.Xr intro 4 ,
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index 0016c9393db..5901afb68ed 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.11 2008/12/26 18:17:25 todd Exp $ */
+/* $OpenBSD: owtemp.c,v 1.12 2009/01/17 20:30:27 grange Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -79,7 +79,8 @@ struct cfdriver owtemp_cd = {
static const struct onewire_matchfam owtemp_fams[] = {
{ ONEWIRE_FAMILY_DS1920 },
- { ONEWIRE_FAMILY_DS18B20 }
+ { ONEWIRE_FAMILY_DS18B20 },
+ { ONEWIRE_FAMILY_DS1822 }
};
int
@@ -174,7 +175,8 @@ owtemp_update(void *arg)
if (onewire_crc(data, 8) == data[DS1920_SP_CRC]) {
temp = data[DS1920_SP_TEMP_MSB] << 8 |
data[DS1920_SP_TEMP_LSB];
- if (ONEWIRE_ROM_FAMILY(sc->sc_rom) == ONEWIRE_FAMILY_DS18B20) {
+ if (ONEWIRE_ROM_FAMILY(sc->sc_rom) == ONEWIRE_FAMILY_DS18B20 ||
+ ONEWIRE_ROM_FAMILY(sc->sc_rom) == ONEWIRE_FAMILY_DS1822) {
/*
* DS18B20 decoding
* default 12 bit 0.0625 C resolution