Introduced sane limits checking for all chip modules

Like the LM78 before, all chips now handle strange values written to /proc/...
with grace - that is, they convert them to the most sane value considering
the circumstances, instead of reacting with strange resulting values
(note that they were already crash-free).

I also removed a factor '2' in the computation of the fan speeds in the
gl518sm module. This is conforming with the sheet; if your fan gives two
'ticks' for each rotation, just modify sensors.conf.

I tried to introduce rounding and limit checking to the maxilife module.
The VID computation is not yet rounded - I need the real formula for that.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@382 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1999-04-11 21:23:57 +00:00
1 parent 3e38c3f87e
commit 76c1926109
8 files changed
+143 -150

No files matched your search

+5 -2
View File
@@ -43,9 +43,12 @@ SENSORS_INSMOD_1(lm75);
#define LM75_REG_TEMP_HYST 0x02
#define LM75_REG_TEMP_OS 0x03
/* Conversions */
/* Conversions. Rounding and limit checking is only done on the TO_REG
variants. Note that you should be a bit careful with which arguments
these macros are called: arguments may be evaluated more than once.
Fixing this is just not worth it. */
#define TEMP_FROM_REG(val) (((val) >> 7) * 5)
#define TEMP_TO_REG(val) (((((val) + 2) / 5) << 7) & 0xff80)
#define TEMP_TO_REG(val) (SENSORS_LIMIT(((((val) + 2) / 5) << 7),0,0xffff))
/* Initial values */
#define LM75_INIT_TEMP_OS 600