Changeset 53
- Timestamp:
- 12/09/98 02:34:45 (14 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 5 modified
-
TODO (modified) (1 diff)
-
kernel/chips/lm75.c (modified) (2 diffs)
-
kernel/chips/lm78.c (modified) (2 diffs)
-
src/lm75.c (modified) (2 diffs)
-
src/lm78.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/TODO
r51 r53 1 1 Many, many things. Most notably: 2 2 3 * Check whether the FAN count divisors in the lm78 module are correct 4 (probably not!) 5 * Wouldn't it be better to display all natural voltages for the LM78 chip, 6 and do *all* conversions through a user program? 3 7 * kmalloc with GFP_KERNEL can cause a context switch! Check whether this is 4 8 safe everywhere it is used. -
lm-sensors/trunk/kernel/chips/lm75.c
r51 r53 38 38 39 39 /* Initial values */ 40 #define LM75_INIT_TEMP_OS 60 41 #define LM75_INIT_TEMP_HYST 50 40 #define LM75_INIT_TEMP_OS 600 41 #define LM75_INIT_TEMP_HYST 500 42 42 43 43 /* Each client has this additional data */ … … 171 171 172 172 /* Initialize the LM75 chip */ 173 lm75_write_value(new_client,LM75_REG_TEMP_OS,LM75_INIT_TEMP_OS); 174 lm75_write_value(new_client,LM75_REG_TEMP_HYST,LM75_INIT_TEMP_HYST); 173 lm75_write_value(new_client,LM75_REG_TEMP_OS, 174 TEMP_TO_REG(LM75_INIT_TEMP_OS)); 175 lm75_write_value(new_client,LM75_REG_TEMP_HYST, 176 TEMP_TO_REG(LM75_INIT_TEMP_HYST)); 175 177 lm75_write_value(new_client,LM75_REG_CONF,0); 176 178 -
lm-sensors/trunk/kernel/chips/lm78.c
r51 r53 64 64 65 65 66 /* Conversions */66 /* Conversions. Rounding is only done on the TO_REG variants. */ 67 67 static int lm78_in_conv[7] = {10000, 10000, 10000, 16892, 38000, 68 68 -34768, -15050 }; … … 71 71 #define IN_FROM_REG(val,nr) (((val) * 16 * lm78_in_conv[nr]) / 100000) 72 72 73 #define FAN_TO_REG(val) ((((val)==0)?255:((1350000+(val))/((val)*2))) & 0xff) 74 #define FAN_FROM_REG(val) (((val)==0)?-1:\ 75 ((val)==255)?0:(1350000 + (val))/((val)*2)) 76 77 #define TEMP_TO_REG(val) (((val)<0?(val/10)&0xff:(val/10)) & 0xff) 73 #define FAN_TO_REG(val) ((val)==0?255:((1350000+(val))/((val)*2)) & 0xff) 74 #define FAN_FROM_REG(val) ((val)==0?-1:(val)==255?0:1350000/((val)*2)) 75 76 #define TEMP_TO_REG(val) (((val)<0?(((val)-5)/10)&0xff:((val)+5)/10) & 0xff) 78 77 #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) 79 78 -
lm-sensors/trunk/src/lm75.c
r51 r53 38 38 39 39 /* Initial values */ 40 #define LM75_INIT_TEMP_OS 60 41 #define LM75_INIT_TEMP_HYST 50 40 #define LM75_INIT_TEMP_OS 600 41 #define LM75_INIT_TEMP_HYST 500 42 42 43 43 /* Each client has this additional data */ … … 171 171 172 172 /* Initialize the LM75 chip */ 173 lm75_write_value(new_client,LM75_REG_TEMP_OS,LM75_INIT_TEMP_OS); 174 lm75_write_value(new_client,LM75_REG_TEMP_HYST,LM75_INIT_TEMP_HYST); 173 lm75_write_value(new_client,LM75_REG_TEMP_OS, 174 TEMP_TO_REG(LM75_INIT_TEMP_OS)); 175 lm75_write_value(new_client,LM75_REG_TEMP_HYST, 176 TEMP_TO_REG(LM75_INIT_TEMP_HYST)); 175 177 lm75_write_value(new_client,LM75_REG_CONF,0); 176 178 -
lm-sensors/trunk/src/lm78.c
r51 r53 64 64 65 65 66 /* Conversions */66 /* Conversions. Rounding is only done on the TO_REG variants. */ 67 67 static int lm78_in_conv[7] = {10000, 10000, 10000, 16892, 38000, 68 68 -34768, -15050 }; … … 71 71 #define IN_FROM_REG(val,nr) (((val) * 16 * lm78_in_conv[nr]) / 100000) 72 72 73 #define FAN_TO_REG(val) ((((val)==0)?255:((1350000+(val))/((val)*2))) & 0xff) 74 #define FAN_FROM_REG(val) (((val)==0)?-1:\ 75 ((val)==255)?0:(1350000 + (val))/((val)*2)) 76 77 #define TEMP_TO_REG(val) (((val)<0?(val/10)&0xff:(val/10)) & 0xff) 73 #define FAN_TO_REG(val) ((val)==0?255:((1350000+(val))/((val)*2)) & 0xff) 74 #define FAN_FROM_REG(val) ((val)==0?-1:(val)==255?0:1350000/((val)*2)) 75 76 #define TEMP_TO_REG(val) (((val)<0?(((val)-5)/10)&0xff:((val)+5)/10) & 0xff) 78 77 #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) 79 78
