Changeset 543

Show
Ignore:
Timestamp:
08/30/99 06:15:55 (14 years ago)
Author:
phil
Message:

(Phil) Fixed temperature reporting of LM80 (I hope).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/chips/lm80.c

    r516 r543  
    100100{ 
    101101  long res; 
    102   res = ((temp & 0xff00) >> 8) * 10000 + ((temp & 0x10) >> 4) * 5000 + 
    103         ((temp & 0x20) >> 5) * 2500 + ((temp & 0x40) >> 6) * 1250 + 
    104         ((temp & 0x80) >> 7) * 625; 
    105   temp /= 100; 
    106   if (temp >= 0x80 * 100) 
    107     temp = - (0x100 * 100 - temp); 
    108   return temp; 
     102 
     103  temp= temp >> 4; 
     104  if (temp < 0x0800) { 
     105        res = (625 * (long)temp); 
     106  } else { 
     107        res = ((long)temp - 0x01000) * 625; 
     108  } 
     109  return res; 
    109110} 
    110111 
     
    603604  struct lm80_data *data = client->data; 
    604605  if (operation == SENSORS_PROC_REAL_INFO) 
    605     *nrels_mag = 1; 
     606    *nrels_mag = 4; 
    606607  else if (operation == SENSORS_PROC_REAL_READ) { 
    607608    lm80_update_client(client); 
    608     results[0] = TEMP_LIMIT_FROM_REG(data->temp_hot_max); 
    609     results[1] = TEMP_LIMIT_FROM_REG(data->temp_hot_hyst); 
    610     results[2] = TEMP_LIMIT_FROM_REG(data->temp_os_max); 
    611     results[3] = TEMP_LIMIT_FROM_REG(data->temp_os_hyst); 
     609    results[0] = TEMP_LIMIT_FROM_REG(data->temp_hot_max) * 10000; 
     610    results[1] = TEMP_LIMIT_FROM_REG(data->temp_hot_hyst) * 10000; 
     611    results[2] = TEMP_LIMIT_FROM_REG(data->temp_os_max) * 10000; 
     612    results[3] = TEMP_LIMIT_FROM_REG(data->temp_os_hyst) * 10000; 
    612613    results[4] = TEMP_FROM_REG(data->temp); 
    613614    *nrels_mag = 5;