From d185b1a4f081405ed3f21065bbdaf7b3f355362c Mon Sep 17 00:00:00 2001 From: Alexander Yurchenko Date: Sat, 17 Jan 2009 20:30:28 +0000 Subject: Add support for DS1822 to owtemp(4). --- sys/dev/onewire/owtemp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys') 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 @@ -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 -- cgit v1.2.3