Changeset 921
- Timestamp:
- 11/01/00 17:48:18 (13 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/chips/lm87.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/lm87.c
r897 r921 62 62 #define LM87_REG_IN(nr) (0x20 + (nr)) 63 63 64 #define AIN1 0 65 #define VCCP1 1 66 #define VCCP2 5 67 68 /* Initial limits */ 64 69 65 70 /* … … 167 172 #define DIV_TO_REG(val) ((val)==1?0:((val)==8?3:((val)==4?2:1))) 168 173 174 #if 0 169 175 #define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\ 170 176 205-(val)*5) 171 172 /* Initial limits */ 177 #endif 178 173 179 #define LM87_INIT_IN_0 190 174 180 #define LM87_INIT_IN_1 190 … … 216 222 (LM87_INIT_IN_5 + ((LM87_INIT_IN_5 * LM87_INIT_IN_PERCENTAGE) / 100)) 217 223 218 #define LM87_INIT_FAN_MIN 4000219 220 #define LM87_INIT_EXT_TEMP_MAX 800224 #define LM87_INIT_FAN_MIN 3000 225 226 #define LM87_INIT_EXT_TEMP_MAX 600 221 227 #define LM87_INIT_EXT_TEMP_MIN 50 222 #define LM87_INIT_INT_TEMP_MAX 700228 #define LM87_INIT_INT_TEMP_MAX 600 223 229 #define LM87_INIT_INT_TEMP_MIN 50 224 230 … … 571 577 down(&data->update_lock); 572 578 573 if ( 574 (jiffies - data->last_updated > 575 (data->type == LM87 ? HZ / 2 : HZ * 2)) 576 || (jiffies < data->last_updated) || !data->valid) { 579 if ((jiffies - data->last_updated > HZ) || /* 1 sec cache */ 580 (jiffies < data->last_updated) || 581 !data->valid) { 577 582 578 583 #ifdef DEBUG … … 674 679 * against 1.25V value. 675 680 ************************************************************/ 676 int scales[6] = { 260, 2 60, 344, 520, 1250, 260 };681 int scales[6] = { 260, 200, 344, 520, 1250, 260 }; 677 682 678 683 struct LM87_data *data = client->data; … … 683 688 else if (operation == SENSORS_PROC_REAL_READ) { 684 689 LM87_update_client(client); 690 685 691 results[0] = 686 692 IN_FROM_REG(data->in_min[nr], nr) * scales[nr] / 192; 687 693 results[1] = 688 694 IN_FROM_REG(data->in_max[nr], nr) * scales[nr] / 192; 689 results[2] = 690 IN_FROM_REG(data->in[nr], nr) * scales[nr] / 192; 695 696 if (nr == AIN1) { 697 results[2] = ((data->in[nr] * 10) * 98) / 1000; 698 } 699 else if (nr == VCCP1 || nr == VCCP2) { 700 results[2] = ((data->in[nr] * 10) * 141) / 1000; 701 } 702 else { 703 results[2] = 704 IN_FROM_REG(data->in[nr], nr) * scales[nr] / 192; 705 } 706 691 707 *nrels_mag = 3; 692 708 } else if (operation == SENSORS_PROC_REAL_WRITE) { … … 866 882 struct LM87_data *data = client->data; 867 883 884 868 885 if (operation == SENSORS_PROC_REAL_INFO) 869 886 *nrels_mag = 2; 870 887 else if (operation == SENSORS_PROC_REAL_READ) { 888 871 889 LM87_update_client(client); 872 results[0] = VID_FROM_REG(data->vid); 873 *nrels_mag = 1; 890 if ((data->vid == 0x1f) || (data->vid == 0x0f)) { 891 results[0] = 0; 892 } 893 else if (data->vid > 0x0f) { 894 results[0] = (1275 - (((data->vid - 0x10) * 1000) * 0.025))/10; 895 } 896 else { 897 results[0] = 200 - ((data->vid * 100) * 0.05); 898 } 899 900 *nrels_mag = 1; 874 901 } 875 902 } … … 914 941 ("Frodo Looijaard <frodol@dds.nl>, Philip Edelbrock <phil@netroedge.com>, 915 942 and Stephen Rousset <stephen.rousset@rocketlogix.com>"); 943 916 944 MODULE_DESCRIPTION("LM87 driver"); 917 945
