diff -Naur lm_sensors-2.8.8/etc/sensors.conf.eg lm_sensors-2.8.8new/etc/sensors.conf.eg --- lm_sensors-2.8.8/etc/sensors.conf.eg 2004-09-22 22:50:43.000000000 +0200 +++ lm_sensors-2.8.8new/etc/sensors.conf.eg 2004-10-14 22:02:05.000000000 +0200 @@ -2203,3 +2203,17 @@ set fan1_min 2000 set fan2_min 2000 + +chip "w83l785r-*" + + label temp1 "Temp1" + label temp2 "Temp2" + label in0 "VCore" + label in1 "V2.5" + label in2 "V1.5" + label in3 "Vcc" + label fan1 "Fan1" + label fan2 "Fan2" + + #in3 has internal divisor 3 + compute in3 3*@ , @/3 diff -Naur lm_sensors-2.8.8/kernel/chips/twosixdrv.c lm_sensors-2.8.8new/kernel/chips/twosixdrv.c --- lm_sensors-2.8.8/kernel/chips/twosixdrv.c 1970-01-01 01:00:00.000000000 +0100 +++ lm_sensors-2.8.8new/kernel/chips/twosixdrv.c 2004-10-14 22:02:05.000000000 +0200 @@ -0,0 +1,39 @@ +/* + twosixdrv - Part of lm_sensors, Linux kernel modules + for hardware monitoring + + Copyright (c) 2004 Rudolf Marek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* Fake file for sysctl entries for non-2.4 drivers */ + +/* The /proc/sys entries */ + +/* -- SENSORS SYSCTL START -- */ +#define W83L785R_SYSCTL_IN0 1000 +#define W83L785R_SYSCTL_IN1 1001 +#define W83L785R_SYSCTL_IN2 1002 +#define W83L785R_SYSCTL_IN3 1003 +#define W83L785R_SYSCTL_IN4 1004 +#define W83L785R_SYSCTL_FAN1 1101 +#define W83L785R_SYSCTL_FAN2 1102 +#define W83L785R_SYSCTL_TEMP1 1200 +#define W83L785R_SYSCTL_TEMP2 1201 +#define W83L785R_SYSCTL_FAN_DIV 2000 + +/* -- SENSORS SYSCTL END -- */ + diff -Naur lm_sensors-2.8.8/kernel/include/sensors.h.template lm_sensors-2.8.8new/kernel/include/sensors.h.template --- lm_sensors-2.8.8/kernel/include/sensors.h.template 2004-09-22 22:52:26.000000000 +0200 +++ lm_sensors-2.8.8new/kernel/include/sensors.h.template 2004-10-14 22:02:05.000000000 +0200 @@ -18,6 +18,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- THIS FILE IS AUTOGENERATED DO NOT EDIT -- + + Put your legacy SYCTLs lines in kernel/chips/twosixdrv.c + + Thank you */ #ifndef LIB_SENSORS_H diff -Naur lm_sensors-2.8.8/lib/chips.c lm_sensors-2.8.8new/lib/chips.c --- lm_sensors-2.8.8/lib/chips.c 2004-09-25 13:24:11.000000000 +0200 +++ lm_sensors-2.8.8new/lib/chips.c 2004-10-14 22:02:05.000000000 +0200 @@ -1662,6 +1662,76 @@ { 0 } }; +static sensors_chip_feature w83l785r_features[] = + { + { SENSORS_W83L785R_TEMP1, "temp1", NOMAP, NOMAP, + R, W83L785R_SYSCTL_TEMP1, VALUE(4), 3 }, + { SENSORS_W83L785R_TEMP1_MAX, "temp1_max", SENSORS_W83L785R_TEMP1, + SENSORS_W83L785R_TEMP1, + RW, W83L785R_SYSCTL_TEMP1, VALUE(3), 3 }, + { SENSORS_W83L785R_TEMP1_CRIT, "temp1_crit", SENSORS_W83L785R_TEMP1, + SENSORS_W83L785R_TEMP1, + RW, W83L785R_SYSCTL_TEMP1, VALUE(2), 3 }, + { SENSORS_W83L785R_TEMP1_HYST, "temp1_hyst", SENSORS_W83L785R_TEMP1, + SENSORS_W83L785R_TEMP1, + RW, W83L785R_SYSCTL_TEMP1, VALUE(1), 3 }, + { SENSORS_W83L785R_TEMP1_SENS, "temp1_type", SENSORS_W83L785R_TEMP1, + SENSORS_W83L785R_TEMP1, + RW, W83L785R_SYSCTL_TEMP1, VALUE(1), 0 }, + { SENSORS_W83L785R_TEMP2, "temp2", NOMAP, NOMAP, + R, W83L785R_SYSCTL_TEMP2, VALUE(4), 3 }, + { SENSORS_W83L785R_TEMP2_MAX, "temp2_max", SENSORS_W83L785R_TEMP2, + SENSORS_W83L785R_TEMP2, + RW, W83L785R_SYSCTL_TEMP2, VALUE(3), 3 }, + { SENSORS_W83L785R_TEMP2_CRIT, "temp2_crit", SENSORS_W83L785R_TEMP2, + SENSORS_W83L785R_TEMP2, + RW, W83L785R_SYSCTL_TEMP2, VALUE(2), 3 }, + { SENSORS_W83L785R_TEMP2_HYST, "temp2_hyst", SENSORS_W83L785R_TEMP2, + SENSORS_W83L785R_TEMP2, + RW, W83L785R_SYSCTL_TEMP2, VALUE(1), 3 }, + { SENSORS_W83L785R_TEMP2_SENS, "temp2_type", SENSORS_W83L785R_TEMP2, + SENSORS_W83L785R_TEMP2, + RW, W83L785R_SYSCTL_TEMP2, VALUE(1), 0 }, + { SENSORS_W83L785R_FAN1, "fan1", NOMAP, NOMAP, + R, W83L785R_SYSCTL_FAN1, VALUE(2), 0 }, + { SENSORS_W83L785R_FAN1_MIN, "fan1_min", SENSORS_W83L785R_FAN1, SENSORS_W83L785R_FAN1, + RW, W83L785R_SYSCTL_FAN1, VALUE(1), 0 }, + { SENSORS_W83L785R_FAN1_DIV, "fan1_div", SENSORS_W83L785R_FAN1, SENSORS_W83L785R_FAN1, + RW, W83L785R_SYSCTL_FAN1, VALUE(1), 0 }, + { SENSORS_W83L785R_FAN2, "fan2", NOMAP, NOMAP, + R, W83L785R_SYSCTL_FAN2, VALUE(2), 0 }, + { SENSORS_W83L785R_FAN2_MIN, "fan2_min", SENSORS_W83L785R_FAN2, SENSORS_W83L785R_FAN2, + RW, W83L785R_SYSCTL_FAN2, VALUE(2), 0 }, + { SENSORS_W83L785R_FAN2_DIV, "fan2_div", SENSORS_W83L785R_FAN2, SENSORS_W83L785R_FAN2, + RW, W83L785R_SYSCTL_FAN2, VALUE(2), 0 }, + { SENSORS_W83L785R_IN0, "in0", NOMAP, NOMAP, + R, W83L785R_SYSCTL_IN0, VALUE(3), 3 }, + { SENSORS_W83L785R_IN1, "in1", NOMAP, NOMAP, + R, W83L785R_SYSCTL_IN1, VALUE(3), 3 }, + { SENSORS_W83L785R_IN2, "in2", NOMAP, NOMAP, + R, W83L785R_SYSCTL_IN2, VALUE(3), 3 }, + { SENSORS_W83L785R_IN3, "in3", NOMAP, NOMAP, + R, W83L785R_SYSCTL_IN3, VALUE(3), 3 }, + { SENSORS_W83L785R_IN0_MIN, "in0_min", SENSORS_W83L785R_IN0, SENSORS_W83L785R_IN0, + RW, W83L785R_SYSCTL_IN0, VALUE(3), 3 }, + { SENSORS_W83L785R_IN1_MIN, "in1_min", SENSORS_W83L785R_IN1, SENSORS_W83L785R_IN1, + RW, W83L785R_SYSCTL_IN1, VALUE(3), 3 }, + { SENSORS_W83L785R_IN2_MIN, "in2_min", SENSORS_W83L785R_IN2, SENSORS_W83L785R_IN2, + RW, W83L785R_SYSCTL_IN2, VALUE(3), 3 }, + { SENSORS_W83L785R_IN3_MIN, "in3_min", SENSORS_W83L785R_IN3, SENSORS_W83L785R_IN3, + RW, W83L785R_SYSCTL_IN3, VALUE(3), 3 }, + { SENSORS_W83L785R_IN0_MAX, "in0_max", SENSORS_W83L785R_IN0, SENSORS_W83L785R_IN0, + RW, W83L785R_SYSCTL_IN0, VALUE(2), 3 }, + { SENSORS_W83L785R_IN1_MAX, "in1_max", SENSORS_W83L785R_IN1, SENSORS_W83L785R_IN1, + RW, W83L785R_SYSCTL_IN1, VALUE(2), 3 }, + { SENSORS_W83L785R_IN2_MAX, "in2_max", SENSORS_W83L785R_IN2, SENSORS_W83L785R_IN2, + RW, W83L785R_SYSCTL_IN2, VALUE(2), 3 }, + { SENSORS_W83L785R_IN3_MAX, "in3_max", SENSORS_W83L785R_IN3, SENSORS_W83L785R_IN3, + RW, W83L785R_SYSCTL_IN3, VALUE(2), 3 }, + + { 0 } + }; + static sensors_chip_feature adm9240_features[] = { { SENSORS_ADM9240_IN0, "2.5V", NOMAP, NOMAP, @@ -5224,6 +5294,7 @@ { SENSORS_W83637HF_PREFIX, w83782d_features }, { SENSORS_W83791D_PREFIX, w83791d_features }, { SENSORS_W83L785TS_PREFIX, w83l785ts_features }, + { SENSORS_W83L785R_PREFIX, w83l785r_features }, { SENSORS_AS99127F_PREFIX, as99127f_features }, { SENSORS_ASB100_PREFIX, asb100_features }, { SENSORS_ADM9240_PREFIX, adm9240_features }, diff -Naur lm_sensors-2.8.8/lib/chips.h lm_sensors-2.8.8new/lib/chips.h --- lm_sensors-2.8.8/lib/chips.h 2004-09-28 22:44:11.000000000 +0200 +++ lm_sensors-2.8.8new/lib/chips.h 2004-10-14 22:49:41.000000000 +0200 @@ -748,6 +748,42 @@ #define SENSORS_W83L785TS_TEMP 51 /* R */ #define SENSORS_W83L785TS_TEMP_OVER 52 /* R for now */ +/* W83L785R chips */ + +#define SENSORS_W83L785R_PREFIX "w83l785r" + +#define SENSORS_W83L785R_TEMP1 51 /* R */ +#define SENSORS_W83L785R_TEMP2 52 /* R */ +#define SENSORS_W83L785R_TEMP1_MAX 53 /* RW */ +#define SENSORS_W83L785R_TEMP2_MAX 54 /* RW */ +#define SENSORS_W83L785R_TEMP1_CRIT 55 /* RW */ +#define SENSORS_W83L785R_TEMP2_CRIT 56 /* RW */ +#define SENSORS_W83L785R_TEMP1_HYST 57 /* RW */ +#define SENSORS_W83L785R_TEMP2_HYST 58 /* RW */ +#define SENSORS_W83L785R_TEMP1_SENS 59 /* RW */ +#define SENSORS_W83L785R_TEMP2_SENS 60 /* RW */ + +#define SENSORS_W83L785R_FAN1 31 /* R */ +#define SENSORS_W83L785R_FAN2 32 /* R */ +#define SENSORS_W83L785R_FAN1_DIV 33 /* RW */ +#define SENSORS_W83L785R_FAN2_DIV 34 /* RW */ +#define SENSORS_W83L785R_FAN1_MIN 35 /* RW */ +#define SENSORS_W83L785R_FAN2_MIN 36 /* RW */ + +#define SENSORS_W83L785R_IN0 1 /* R */ +#define SENSORS_W83L785R_IN1 2 /* R */ +#define SENSORS_W83L785R_IN2 3 /* R */ +#define SENSORS_W83L785R_IN3 4 /* R */ + +#define SENSORS_W83L785R_IN0_MIN 11 /* RW */ +#define SENSORS_W83L785R_IN1_MIN 12 /* RW */ +#define SENSORS_W83L785R_IN2_MIN 13 /* RW */ +#define SENSORS_W83L785R_IN3_MIN 14 /* RW */ + +#define SENSORS_W83L785R_IN0_MAX 21 /* RW */ +#define SENSORS_W83L785R_IN1_MAX 22 /* RW */ +#define SENSORS_W83L785R_IN2_MAX 23 /* RW */ +#define SENSORS_W83L785R_IN3_MAX 24 /* RW */ /* Analog Devices ADM9240 chips */ diff -Naur lm_sensors-2.8.8/prog/sensors/chips.c lm_sensors-2.8.8new/prog/sensors/chips.c --- lm_sensors-2.8.8/prog/sensors/chips.c 2004-09-19 19:09:59.000000000 +0200 +++ lm_sensors-2.8.8new/prog/sensors/chips.c 2004-10-14 22:54:29.000000000 +0200 @@ -4852,10 +4852,10 @@ } } -/* print_asb100_in() +/* print_in() * where in, in_min, and in_max are sensors feature IDs */ -static void print_asb100_in(const sensors_chip_name *name, int alarm, +static void print_in(const sensors_chip_name *name, int alarm, int in, int in_min, int in_max) { char *label = NULL; @@ -4877,15 +4877,15 @@ } #define PRINT_ASB100_IN(num, name, alarms) \ - print_asb100_in((name), ((alarms) & ASB100_ALARM_IN##num), \ + print_in((name), ((alarms) & ASB100_ALARM_IN##num), \ (SENSORS_ASB100_IN##num), \ (SENSORS_ASB100_IN##num##_MIN), \ (SENSORS_ASB100_IN##num##_MAX)) -/* print_asb100_fan() +/* print_fan() * where fan, fan_div, and fan_min are sensors feature IDs */ -static void print_asb100_fan(const sensors_chip_name *name, int alarm, +static void print_fan(const sensors_chip_name *name, int alarm, int fan, int fan_div, int fan_min) { char *label = NULL; @@ -4907,7 +4907,7 @@ } #define PRINT_ASB100_FAN(num, name, alarms) \ - print_asb100_fan((name), ((alarms) & ASB100_ALARM_FAN##num), \ + print_fan((name), ((alarms) & ASB100_ALARM_FAN##num), \ (SENSORS_ASB100_FAN##num), \ (SENSORS_ASB100_FAN##num##_DIV), \ (SENSORS_ASB100_FAN##num##_MIN)) @@ -4993,9 +4993,8 @@ } -/* happens to be similar to asb100*/ #define PRINT_LM93_IN(num, name, alarms) \ - print_asb100_in((name), ((alarms) & LM93_ALARM_IN##num), \ + print_in((name), ((alarms) & LM93_ALARM_IN##num), \ (SENSORS_LM93_IN##num), \ (SENSORS_LM93_IN##num##_MIN), \ (SENSORS_LM93_IN##num##_MAX)) @@ -5120,6 +5119,69 @@ print_lm93_vid(name, SENSORS_LM93_VID2); } +static void w83l785r_print_all_temp (float n_cur,float n_high,float n_crit,float n_hyst, int sens) +{ + if (fahrenheit) { + n_cur = deg_ctof (n_cur); + n_high = deg_ctof (n_high); + n_crit = deg_ctof (n_crit); + n_hyst = deg_ctof (n_hyst); + } + + printf ("%+2.0f%s high = %+2.0f%s, crit = %+2.0f%s, hyst = %+2.0f%s " + "sensor = %s", n_cur, degstr, n_high, degstr, + n_crit, degstr, n_hyst, degstr, + ((((int)sens)==1)?"PII/Celeron diode":(((int)sens)==2)? + "3904 transistor":"thermistor")); +} + +static void w83l785r_print_temp(const sensors_chip_name *name, int alarm, + int temp, int temp_max, int temp_hyst, int temp_crit, int sensort) +{ + char *label = NULL; + double cur, max, hyst, crit, sens; + int valid; + + if (!sensors_get_label_and_valid(*name,temp,&label,&valid) && + !sensors_get_feature(*name,temp,&cur) && + !sensors_get_feature(*name,temp_max,&max) && + !sensors_get_feature(*name,temp_crit,&crit) && + !sensors_get_feature(*name,sensort,&sens) && + !sensors_get_feature(*name,temp_hyst,&hyst)) { + + if (valid) { + print_label(label,10); + w83l785r_print_all_temp(cur,max,crit,hyst,sens); + printf(" %s\n", alarm ? "ALARM" : ""); + } + } else + printf("ERROR: Can't get TEMP data! (0x%04x)\n", temp); + + free_the_label(&label); +} + +void print_w83l785r(const sensors_chip_name *name) +{ + int i; + + for (i=0;i<4;i++) print_in(name, 0, \ + (SENSORS_W83L785R_IN0+i), \ + (SENSORS_W83L785R_IN0_MIN+i), \ + (SENSORS_W83L785R_IN0_MAX+i)); + + for (i=0;i<2;i++) print_fan(name, 0, \ + (SENSORS_W83L785R_FAN1+i), \ + (SENSORS_W83L785R_FAN1_DIV+i), \ + (SENSORS_W83L785R_FAN1_MIN+i)); + + for (i=0;i<2;i++) w83l785r_print_temp(name, 0, \ + (SENSORS_W83L785R_TEMP1+i), \ + (SENSORS_W83L785R_TEMP1_MAX+i), \ + (SENSORS_W83L785R_TEMP1_HYST+i), \ + (SENSORS_W83L785R_TEMP1_CRIT+i), \ + (SENSORS_W83L785R_TEMP1_SENS+i)); +} + void print_unknown_chip(const sensors_chip_name *name) { int a,b,valid; diff -Naur lm_sensors-2.8.8/prog/sensors/chips.h lm_sensors-2.8.8new/prog/sensors/chips.h --- lm_sensors-2.8.8/prog/sensors/chips.h 2004-09-08 18:21:44.000000000 +0200 +++ lm_sensors-2.8.8new/prog/sensors/chips.h 2004-10-14 22:02:05.000000000 +0200 @@ -40,6 +40,7 @@ extern void print_lm80(const sensors_chip_name *name); extern void print_lm85(const sensors_chip_name *name); extern void print_w83781d(const sensors_chip_name *name); +extern void print_w83l785r(const sensors_chip_name *name); extern void print_w83l785ts(const sensors_chip_name *name); extern void print_maxilife(const sensors_chip_name *name); extern void print_ddcmon(const sensors_chip_name *name); diff -Naur lm_sensors-2.8.8/prog/sensors/main.c lm_sensors-2.8.8new/prog/sensors/main.c --- lm_sensors-2.8.8/prog/sensors/main.c 2004-09-25 13:24:12.000000000 +0200 +++ lm_sensors-2.8.8new/prog/sensors/main.c 2004-10-14 22:02:05.000000000 +0200 @@ -398,6 +398,7 @@ { "w83637hf", print_w83781d }, { "w83697hf", print_w83781d }, { "w83791d", print_w83781d }, + { "w83l785r", print_w83l785r }, { "w83l785ts", print_w83l785ts }, { "as99127f", print_w83781d }, { "maxilife", print_maxilife },