summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-02-24 11:16:18 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-02-24 11:16:18 +0000
commitb373e2053cf18ecb053eac18fd18369e0adb9e0d (patch)
treefe468266015720333bbcc01eb8f5887ad6ebfd61 /sys/dev
parent44baf8bc3034d0d2b034675d4974d020a0482a20 (diff)
Extend temperature lookup table for a wider range and provide a
conversion formula in the comment.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/isa/viasioreg.h165
1 files changed, 113 insertions, 52 deletions
diff --git a/sys/dev/isa/viasioreg.h b/sys/dev/isa/viasioreg.h
index d0b888c429c..75719006e23 100644
--- a/sys/dev/isa/viasioreg.h
+++ b/sys/dev/isa/viasioreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: viasioreg.h,v 1.2 2005/09/29 19:53:24 grange Exp $ */
+/* $OpenBSD: viasioreg.h,v 1.3 2006/02/24 11:16:17 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
*
@@ -192,59 +192,120 @@ static const int vt1211_hm_vrfact[] = {
5952, 8333, 5952, 4167, 1754, 6296
};
-/* Temperature conversion table */
+/*
+ * Temperature lookup table for the following conversion formula:
+ *
+ * temp (degC) = (1.0 / (((1.0 / 3435.0) * (log((253.0 - raw / 4.0) /
+ * (raw / 4.0 - 43.0)))) + (1.0 / 298.15))) - 273.15;
+ *
+ */
static const struct {
- int raw;
- int64_t temp;
+ int raw; /* raw value */
+ int64_t temp; /* temperature in uK */
} vt1211_hm_temptbl[] = {
- { 592, 298150000LLU },
- { 600, 299130000LLU },
- { 608, 300130000LLU },
- { 616, 301140000LLU },
- { 624, 302150000LLU },
- { 632, 303170000LLU },
- { 640, 304210000LLU },
- { 648, 305250000LLU },
- { 656, 306310000LLU },
- { 664, 307380000LLU },
- { 672, 308470000LLU },
- { 680, 309570000LLU },
- { 688, 310690000LLU },
- { 696, 311830000LLU },
- { 704, 312990000LLU },
- { 712, 314170000LLU },
- { 720, 315380000LLU },
- { 728, 316610000LLU },
- { 736, 317860000LLU },
- { 744, 319150000LLU },
- { 752, 320460000LLU },
- { 760, 321810000LLU },
- { 768, 323200000LLU },
- { 776, 324620000LLU },
- { 784, 326090000LLU },
- { 792, 327610000LLU },
- { 800, 329170000LLU },
- { 808, 330790000LLU },
- { 816, 332470000LLU },
- { 824, 334220000LLU },
- { 832, 336040000LLU },
- { 840, 337940000LLU },
- { 848, 339940000LLU },
- { 856, 342030000LLU },
- { 864, 344230000LLU },
- { 872, 346560000LLU },
- { 880, 349030000LLU },
- { 888, 351670000LLU },
- { 896, 354490000LLU },
- { 904, 357530000LLU },
- { 912, 360830000LLU },
- { 920, 364430000LLU },
- { 928, 368410000LLU },
- { 936, 372830000LLU },
- { 944, 377820000LLU },
- { 952, 383530000LLU },
- { 960, 390210000LLU },
- { 968, 398230000LLU }
+ { 176, 203690000LL },
+ { 184, 218020000LL },
+ { 192, 225470000LL },
+ { 200, 230710000LL },
+ { 208, 234830000LL },
+ { 216, 238260000LL },
+ { 224, 241230000LL },
+ { 232, 243850000LL },
+ { 240, 246220000LL },
+ { 248, 248390000LL },
+ { 256, 250390000LL },
+ { 264, 252260000LL },
+ { 272, 254020000LL },
+ { 280, 255680000LL },
+ { 288, 257260000LL },
+ { 296, 258760000LL },
+ { 304, 260210000LL },
+ { 312, 261600000LL },
+ { 320, 262940000LL },
+ { 328, 264240000LL },
+ { 336, 265500000LL },
+ { 344, 266730000LL },
+ { 352, 267930000LL },
+ { 360, 269100000LL },
+ { 368, 270240000LL },
+ { 376, 271360000LL },
+ { 384, 272460000LL },
+ { 392, 273540000LL },
+ { 400, 274610000LL },
+ { 408, 275660000LL },
+ { 416, 276700000LL },
+ { 424, 277720000LL },
+ { 432, 278730000LL },
+ { 440, 279740000LL },
+ { 448, 280730000LL },
+ { 456, 281720000LL },
+ { 464, 282700000LL },
+ { 472, 283670000LL },
+ { 480, 284640000LL },
+ { 488, 285610000LL },
+ { 496, 286570000LL },
+ { 504, 287530000LL },
+ { 512, 288490000LL },
+ { 520, 289450000LL },
+ { 528, 290400000LL },
+ { 536, 291360000LL },
+ { 544, 292320000LL },
+ { 552, 293280000LL },
+ { 560, 294250000LL },
+ { 568, 295210000LL },
+ { 576, 296190000LL },
+ { 584, 297160000LL },
+ { 592, 298150000LL },
+ { 600, 299130000LL },
+ { 608, 300130000LL },
+ { 616, 301140000LL },
+ { 624, 302150000LL },
+ { 632, 303170000LL },
+ { 640, 304210000LL },
+ { 648, 305250000LL },
+ { 656, 306310000LL },
+ { 664, 307380000LL },
+ { 672, 308470000LL },
+ { 680, 309570000LL },
+ { 688, 310690000LL },
+ { 696, 311830000LL },
+ { 704, 312990000LL },
+ { 712, 314170000LL },
+ { 720, 315380000LL },
+ { 728, 316610000LL },
+ { 736, 317860000LL },
+ { 744, 319150000LL },
+ { 752, 320460000LL },
+ { 760, 321810000LL },
+ { 768, 323200000LL },
+ { 776, 324620000LL },
+ { 784, 326090000LL },
+ { 792, 327610000LL },
+ { 800, 329170000LL },
+ { 808, 330790000LL },
+ { 816, 332470000LL },
+ { 824, 334220000LL },
+ { 832, 336040000LL },
+ { 840, 337940000LL },
+ { 848, 339940000LL },
+ { 856, 342030000LL },
+ { 864, 344230000LL },
+ { 872, 346560000LL },
+ { 880, 349030000LL },
+ { 888, 351670000LL },
+ { 896, 354490000LL },
+ { 904, 357530000LL },
+ { 912, 360830000LL },
+ { 920, 364430000LL },
+ { 928, 368410000LL },
+ { 936, 372830000LL },
+ { 944, 377820000LL },
+ { 952, 383530000LL },
+ { 960, 390210000LL },
+ { 968, 398230000LL },
+ { 976, 408200000LL },
+ { 984, 421270000LL },
+ { 992, 439960000LL }
};
/* Hardware monitor sensors */