diff --git a/doc/chips/SUMMARY b/doc/chips/SUMMARY index a5b20334..0222369f 100644 --- a/doc/chips/SUMMARY +++ b/doc/chips/SUMMARY @@ -158,8 +158,8 @@ pc87360 pc87360 - - 2 2 pwm no yes (LPC) pc87363 - - 2 2 pwm no yes (LPC) pc87364 - - 3 3 pwm no yes (LPC) - pc87365 - - 3 3 pwm no yes (LPC) - pc87366 - - 3 3 pwm no yes (LPC) + pc87365 2 11 3 3 pwm no yes (LPC) + pc87366 3 11 3 3 pwm no yes (LPC) sis5595 sis5595 0-1 4-5 2 - no yes diff --git a/doc/chips/pc87360 b/doc/chips/pc87360 index 5d35db8b..1a1332ba 100644 --- a/doc/chips/pc87360 +++ b/doc/chips/pc87360 @@ -32,8 +32,7 @@ PC87364 chip has monitoring and PWM control for a third fan. The National Semiconductor PC87365 and PC87366 Super I/O chips are complete hardware monitoring chipsets, not only controling and monitoring three fans, but also monitoring eleven voltage inputs and two (PC87365) or three -(PC87366) remote temperatures. For now, the driver doesn't handle these -features and treat these two chips as PC87364. +(PC87366) remote temperatures. Fan rotation speeds are reported in RPM (revolutions per minute). An alarm is triggered if the rotation speed has dropped below a programmable limit. @@ -47,6 +46,15 @@ measured. It is suggested to increase the fan divisor in this case. PWM values are from 0 to 255. +Temperatures are reported in degrees Celcius. Each temperature measured has +associated low limit, high limit and overtemperature limit, each of which +triggers an alarm when crossed. + +Voltages are reported relatively to a relative voltage, either internal or +external. Some of them are divided by two internally, you will have to +compensate in sensors.conf. Each voltage measured has associated low and +high limit, each of which triggers an alarm when crossed. + If an alarm triggers, it will remain triggered until the hardware register is read at least once. This means that the cause for the alarm may already have disappeared! Note that in the current implementation, all @@ -58,7 +66,7 @@ miss once-only alarms. Limitations ----------- -This driver only supports fans at the moment. +The voltages and temperatures are read-only at the moment. The datasheets suggests that some values (fan mins, fan divisors) shouldn't be changed once the monitoring has started, but we ignore that diff --git a/kernel/chips/pc87360.c b/kernel/chips/pc87360.c index 87868b17..7f9a6cc8 100644 --- a/kernel/chips/pc87360.c +++ b/kernel/chips/pc87360.c @@ -44,15 +44,26 @@ static unsigned short normal_i2c_range[] = { SENSORS_I2C_END }; static unsigned int normal_isa[] = { 0x0000, SENSORS_ISA_END }; static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; static u8 devid; +static unsigned int extra_isa[] = { 0x0000, 0x0000, 0x0000 }; SENSORS_INSMOD_5(pc87360, pc87363, pc87364, pc87365, pc87366); -/* modified from kernel/include/traps.c */ +/* + * Super-I/O registers and operations + */ + #define REG 0x2e /* The register to read/write */ -#define DEV 0x07 /* Register: Logical device select */ #define VAL 0x2f /* The value to read/write */ -#define FSCM 0x09 /* The device with the fan registers in it */ + +#define DEV 0x07 /* Register: Logical device select */ #define DEVID 0x20 /* Register: Device ID */ +#define ACT 0x30 /* Register: Device activation */ +#define BASE 0x60 /* Register: Base address */ + +#define FSCM 0x09 /* Logical device: fans */ +#define VLM 0x0d /* Logical device: voltages */ +#define TMS 0x0e /* Logical device: temperatures */ +static const u8 logdev[3] = { FSCM, VLM, TMS }; static inline void superio_outb(int reg, int val) { @@ -66,33 +77,18 @@ static inline int superio_inb(int reg) return inb(VAL); } -static inline void superio_select(void) -{ - outb(DEV, REG); - outb(FSCM, VAL); -} - static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); } -/* - * The PC87360 (device id 0xE1) and PC87363 (device id 0xE8) monitor and - * control two fans. - * The PC87364 (device id 0xE4), PC87365 (device id 0xE5) and PC87366 - * (device id 0xE9) monitor and control three fans. - */ -#define PC87360_DEVID_MATCH(id) ((id) == 0xE1 || (id) == 0xE8 || \ - (id) == 0xE4 || (id) == 0xE5 || \ - (id) == 0xE9) - -#define PC87360_BASE_REG 0x60 -#define PC87360_ACTIVATE_REG 0x30 - #define PC87360_EXTENT 0x10 +/* + * Fan registers and conversions + */ + /* nr has to be 0 or 1 (PC87360/87363) or 2 (PC87364/87365/87366) */ #define PC87360_REG_PRESCALE(nr) (0x00 + 2 * (nr)) #define PC87360_REG_PWM(nr) (0x01 + 2 * (nr)) @@ -100,29 +96,77 @@ static inline void superio_exit(void) #define PC87360_REG_FAN(nr) (0x07 + 3 * (nr)) #define PC87360_REG_FAN_STATUS(nr) (0x08 + 3 * (nr)) -#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0: \ - 960000/((val)*(div))) -#define FAN_TO_REG(val,div) ((val)<=0?255: \ - 960000/((val)*(div))) -#define FAN_DIV_FROM_REG(val) (1 << ((val >> 5) & 0x03)) -#define FAN_DIV_TO_REG(val) ((val)==8?0x60:(val)==4?0x40:(val)==1?0x00:0x20) -#define ALARM_FROM_REG(val) ((val) & 0x07) +#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0: \ + 960000/((val)*(div))) +#define FAN_TO_REG(val,div) ((val)<=0?255: \ + 960000/((val)*(div))) +#define FAN_DIV_FROM_REG(val) (1 << ((val >> 5) & 0x03)) +#define FAN_DIV_TO_REG(val) ((val)==8?0x60:(val)==4?0x40:(val)==1?0x00:0x20) +#define FAN_STATUS_FROM_REG(val) ((val) & 0x07) + +/* + * Voltage registers and conversions + */ + +#define PC87365_REG_IN_BANK 0x09 + +/* nr has to be 0 to 11 (PC87365/87366) */ +#define PC87365_REG_IN 0x0B +#define PC87365_REG_IN_MIN 0x0D +#define PC87365_REG_IN_MAX 0x0C +#define PC87365_REG_IN_STATUS 0x0A +#define PC87365_REG_IN_ALARMS1 0x00 +#define PC87365_REG_IN_ALARMS2 0x01 + +#define IN_FROM_REG(val) (((val) * 2967 + 127) / 255) +#define IN_STATUS_FROM_REG(val) ((val) & 0x86) + +/* + * Temperature registers and conversions + */ + +#define PC87365_REG_TEMP_BANK 0x09 + +/* nr has to be 0 to 1 (PC87365) or 2 (PC87366) */ +#define PC87365_REG_TEMP 0x0B +#define PC87365_REG_TEMP_MIN 0x0D +#define PC87365_REG_TEMP_MAX 0x0C +#define PC87365_REG_TEMP_CRIT 0x0D +#define PC87365_REG_TEMP_STATUS 0x0A +#define PC87365_REG_TEMP_ALARMS 0x00 + +#define TEMP_FROM_REG(val) ((val)&0x80 ? (val) : (val) - 128) +#define TEMP_STATUS_FROM_REG(val) ((val) & 0xCE) struct pc87360_data { struct i2c_client client; struct semaphore lock; int sysctl_id; + int address[3]; struct semaphore update_lock; char valid; /* !=0 if following fields are valid */ unsigned long last_updated; /* In jiffies */ - u8 fannr; + u8 fannr, innr, tempnr; u8 fan[3]; /* Register value */ u8 fan_min[3]; /* Register value */ u8 fan_status[3]; /* Register value */ u8 pwm[3]; /* Register value */ + + u8 in[11]; /* Register value */ + u8 in_min[11]; /* Register value */ + u8 in_max[11]; /* Register value */ + u8 in_status[11]; /* Register value */ + u16 in_alarms; /* Register values, combined */ + + u8 temp[3]; /* Register value */ + u8 temp_min[3]; /* Register value */ + u8 temp_max[3]; /* Register value */ + u8 temp_crit[3]; /* Register value */ + u8 temp_status[3]; /* Register value */ + u8 temp_alarms; /* Register value */ }; @@ -131,14 +175,16 @@ static int pc87360_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind); static int pc87360_detach_client(struct i2c_client *client); -static int pc87360_read_value(struct i2c_client *client, u8 register); -static int pc87360_write_value(struct i2c_client *client, u8 register, +static int pc87360_read_value(struct pc87360_data *data, int ldi, u8 reg); +static int pc87360_write_value(struct pc87360_data *data, int ldi, u8 reg, u8 value); static void pc87360_update_client(struct i2c_client *client); -static void pc87360_init_client(struct i2c_client *client); -static int pc87360_find(int *address, u8 *devid); +static int pc87360_find(u8 *devid, int *address); +void pc87365_alarms(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results); + static void pc87360_fan(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results); static void pc87360_fan_status(struct i2c_client *client, int operation, @@ -148,6 +194,16 @@ static void pc87360_fan_div(struct i2c_client *client, int operation, static void pc87360_pwm(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results); +void pc87365_in(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results); +void pc87365_in_status(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results); + +void pc87365_temp(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results); +void pc87365_temp_status(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results); + static int pc87360_id = 0; static struct i2c_driver pc87360_driver = { @@ -160,6 +216,8 @@ static struct i2c_driver pc87360_driver = { /* -- SENSORS SYSCTL START -- */ +#define PC87365_SYSCTL_ALARMS 100 /* bit field */ + #define PC87360_SYSCTL_FAN1 1101 /* Rotations/min */ #define PC87360_SYSCTL_FAN2 1102 #define PC87360_SYSCTL_FAN3 1103 /* not for PC87360/PC87363 */ @@ -171,31 +229,51 @@ static struct i2c_driver pc87360_driver = { #define PC87360_SYSCTL_PWM2 1402 #define PC87360_SYSCTL_PWM3 1403 /* not for PC87360/PC87363 */ -#define PC87360_ALARM_FAN_READY 0x01 -#define PC87360_ALARM_FAN_LOW 0x02 -#define PC87360_ALARM_FAN_OVERFLOW 0x04 +#define PC87360_STATUS_FAN_READY 0x01 +#define PC87360_STATUS_FAN_LOW 0x02 +#define PC87360_STATUS_FAN_OVERFLOW 0x04 + +#define PC87365_SYSCTL_IN0 2100 /* mV */ +#define PC87365_SYSCTL_IN1 2101 +#define PC87365_SYSCTL_IN2 2102 +#define PC87365_SYSCTL_IN3 2103 +#define PC87365_SYSCTL_IN4 2104 +#define PC87365_SYSCTL_IN5 2105 +#define PC87365_SYSCTL_IN6 2106 +#define PC87365_SYSCTL_IN7 2107 +#define PC87365_SYSCTL_IN8 2108 +#define PC87365_SYSCTL_IN9 2109 +#define PC87365_SYSCTL_IN10 2110 +#define PC87365_SYSCTL_IN0_STATUS 2300 /* bit field */ +#define PC87365_SYSCTL_IN1_STATUS 2301 +#define PC87365_SYSCTL_IN2_STATUS 2302 +#define PC87365_SYSCTL_IN3_STATUS 2303 +#define PC87365_SYSCTL_IN4_STATUS 2304 +#define PC87365_SYSCTL_IN5_STATUS 2305 +#define PC87365_SYSCTL_IN6_STATUS 2306 +#define PC87365_SYSCTL_IN7_STATUS 2307 +#define PC87365_SYSCTL_IN8_STATUS 2308 +#define PC87365_SYSCTL_IN9_STATUS 2309 +#define PC87365_SYSCTL_IN10_STATUS 2310 + +#define PC87365_STATUS_IN_MIN 0x02 +#define PC87365_STATUS_IN_MAX 0x04 + +#define PC87365_SYSCTL_TEMP1 3101 /* degrees Celcius */ +#define PC87365_SYSCTL_TEMP2 3102 +#define PC87365_SYSCTL_TEMP3 3103 /* not for PC87365 */ +#define PC87365_SYSCTL_TEMP1_STATUS 3101 /* bit field */ +#define PC87365_SYSCTL_TEMP2_STATUS 3102 +#define PC87365_SYSCTL_TEMP3_STATUS 3103 /* not for PC87365 */ + +#define PC87365_STATUS_TEMP_MIN 0x02 +#define PC87365_STATUS_TEMP_MAX 0x04 +#define PC87365_STATUS_TEMP_CRIT 0x08 +#define PC87365_STATUS_TEMP_OPEN 0x40 /* -- SENSORS SYSCTL END -- */ -static ctl_table pc87360_dir_table_template[] = { /* PC87363 too */ - {PC87360_SYSCTL_FAN1, "fan1", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, - {PC87360_SYSCTL_FAN2, "fan2", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, - {PC87360_SYSCTL_FAN_DIV, "fan_div", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_div}, - {PC87360_SYSCTL_FAN1_STATUS, "fan1_status", NULL, 0, 0444, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_status}, - {PC87360_SYSCTL_FAN2_STATUS, "fan2_status", NULL, 0, 0444, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_status}, - {PC87360_SYSCTL_PWM1, "pwm1", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_pwm}, - {PC87360_SYSCTL_PWM2, "pwm2", NULL, 0, 0644, NULL, - &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_pwm}, - {0} -}; - -static ctl_table pc87364_dir_table_template[] = { /* PC87365 and PC87366 too */ +static ctl_table pc87360_dir_table_template[] = { /* PC87363 and PC87364 too */ {PC87360_SYSCTL_FAN1, "fan1", NULL, 0, 0644, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, {PC87360_SYSCTL_FAN2, "fan2", NULL, 0, 0644, NULL, @@ -219,45 +297,148 @@ static ctl_table pc87364_dir_table_template[] = { /* PC87365 and PC87366 too */ {0} }; +static ctl_table pc87365_dir_table_template[] = { /* PC87366 too */ + {PC87365_SYSCTL_ALARMS, "alarms", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_alarms}, + {PC87360_SYSCTL_FAN1, "fan1", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, + {PC87360_SYSCTL_FAN2, "fan2", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, + {PC87360_SYSCTL_FAN3, "fan3", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan}, + {PC87360_SYSCTL_FAN_DIV, "fan_div", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_div}, + {PC87360_SYSCTL_FAN1_STATUS, "fan1_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_status}, + {PC87360_SYSCTL_FAN2_STATUS, "fan2_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_status}, + {PC87360_SYSCTL_FAN3_STATUS, "fan3_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_fan_status}, + {PC87360_SYSCTL_PWM1, "pwm1", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_pwm}, + {PC87360_SYSCTL_PWM2, "pwm2", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_pwm}, + {PC87360_SYSCTL_PWM3, "pwm3", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87360_pwm}, + {PC87365_SYSCTL_IN0, "in0", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN1, "in1", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN2, "in2", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN3, "in3", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN4, "in4", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN5, "in5", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN6, "in6", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN7, "in7", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN8, "in8", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN9, "in9", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN10, "in10", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in}, + {PC87365_SYSCTL_IN0_STATUS, "in0_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN1_STATUS, "in1_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN2_STATUS, "in2_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN3_STATUS, "in3_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN4_STATUS, "in4_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN5_STATUS, "in5_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN6_STATUS, "in6_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN7_STATUS, "in7_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN8_STATUS, "in8_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN9_STATUS, "in9_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_IN10_STATUS, "in10_status", NULL, 0, 0444, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, + {PC87365_SYSCTL_TEMP1, "temp1", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp}, + {PC87365_SYSCTL_TEMP2, "temp2", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp}, + {PC87365_SYSCTL_TEMP3, "temp3", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp}, + {PC87365_SYSCTL_TEMP1_STATUS, "temp1_status", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp_status}, + {PC87365_SYSCTL_TEMP2_STATUS, "temp2_status", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp_status}, + {PC87365_SYSCTL_TEMP3_STATUS, "temp3_status", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_temp_status}, + {0} +}; + static int pc87360_attach_adapter(struct i2c_adapter *adapter) { return i2c_detect(adapter, &addr_data, pc87360_detect); } -static int pc87360_find(int *address, u8 *devid) +static int pc87360_find(u8 *devid, int *address) { u16 val; + int i; + int nrdev; /* logical device count */ /* no superio_enter */ + + /* identify device */ val = superio_inb(DEVID); - if (!PC87360_DEVID_MATCH(val)) { + switch (val) { + case 0xE1: /* PC87360 */ + case 0xE8: /* PC87363 */ + case 0xE4: /* PC87364 */ + nrdev = 1; + break; + case 0xE5: /* PC87365 */ + case 0xE9: /* PC87366 */ + nrdev = 3; + break; + default: superio_exit(); return -ENODEV; } + /* remember the device id */ *devid = val; - superio_select(); + for (i = 0; i < nrdev; i++) { + /* select logical device */ + superio_outb(DEV, logdev[i]); - val = superio_inb(PC87360_ACTIVATE_REG); - if (!(val & 0x01)) { - printk("pc87360.o: device not activated\n"); - superio_exit(); - return -ENODEV; - } + val = superio_inb(ACT); + if (!(val & 0x01)) { + printk(KERN_INFO "pc87360.o: device 0x%02x not " + "activated\n", logdev[i]); + continue; + } - val = (superio_inb(PC87360_BASE_REG) << 8) - | superio_inb(PC87360_BASE_REG + 1); - *address = val & ~(PC87360_EXTENT - 1); - if (*address == 0) { - printk("pc87360.o: base address not set\n"); - superio_exit(); - return -ENODEV; + val = (superio_inb(BASE) << 8) + | superio_inb(BASE + 1); + if (!val) { + printk(KERN_INFO "pc87360.o: base address not set for " + "device 0x%02x\n", logdev[i]); + continue; + } + + address[i] = val; } superio_exit(); return 0; } +/* We should not trust the address, it is unset. + Read from extra_isa instead. */ int pc87360_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) { @@ -272,9 +453,11 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, return 0; } - if (check_region(address, PC87360_EXTENT)) { - printk("pc87360.o: region 0x%x already in use!\n", address); - return -ENODEV; + for (i = 0; i < 3; i++) { + if (extra_isa[i] && check_region(extra_isa[i], PC87360_EXTENT)) { + printk("pc87360.o: region 0x%x already in use!\n", address); + return -ENODEV; + } } if (!(data = kmalloc(sizeof(struct pc87360_data), GFP_KERNEL))) { @@ -290,26 +473,36 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, new_client->flags = 0; data->fannr = 2; - + data->innr = 0; + data->tempnr = 0; + switch (devid) { - case 0xe8: - type_name = "pc87363"; - break; - case 0xe4: - type_name = "pc87364"; - data->fannr = 3; - break; - case 0xe5: - type_name = "pc87365"; - data->fannr = 3; - break; - case 0xe9: - type_name = "pc87366"; - data->fannr = 3; - break; + case 0xe8: + type_name = "pc87363"; + break; + case 0xe4: + type_name = "pc87364"; + data->fannr = 3; + break; + case 0xe5: + type_name = "pc87365"; + data->fannr = 3; + data->innr = 11; + data->tempnr = 2; + break; + case 0xe9: + type_name = "pc87366"; + data->fannr = 3; + data->innr = 11; + data->tempnr = 3; + break; } - request_region(address, PC87360_EXTENT, "pc87360"); + for (i = 0; i < 3; i++) { + if ((data->address[i] = extra_isa[i])) { + request_region(extra_isa[i], PC87360_EXTENT, "pc87360"); + } + } strcpy(new_client->name, client_name); new_client->id = pc87360_id++; @@ -320,16 +513,14 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, goto ERROR1; if ((i = i2c_register_entry((struct i2c_client *) new_client, - type_name, - (data->fannr == 3) ? - pc87364_dir_table_template : + type_name, data->innr ? + pc87365_dir_table_template : pc87360_dir_table_template)) < 0) { err = i; goto ERROR2; } data->sysctl_id = i; - pc87360_init_client(new_client); return 0; ERROR2: @@ -342,9 +533,10 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, static int pc87360_detach_client(struct i2c_client *client) { - int err; + struct pc87360_data *data = client->data; + int i, err; - i2c_deregister_entry(((struct pc87360_data *) (client->data))->sysctl_id); + i2c_deregister_entry(data->sysctl_id); if ((err = i2c_detach_client(client))) { printk("pc87360.o: Client deregistration failed, " @@ -352,31 +544,39 @@ static int pc87360_detach_client(struct i2c_client *client) return err; } - release_region(client->addr, PC87360_EXTENT); + for (i = 0; i < 3; i++) { + if (data->address[i]) { + release_region(data->address[i], PC87360_EXTENT); + } + } kfree(client->data); return 0; } -static int pc87360_read_value(struct i2c_client *client, u8 reg) +/* ldi is the logical device index: + 0: fans + 1: voltages + 2: temperatures */ +static int pc87360_read_value(struct pc87360_data *data, int ldi, u8 reg) { int res; - res = inb_p(client->addr + reg); + down(&(data->lock)); + res = inb_p(data->address[ldi] + reg); + up(&(data->lock)); return res; } -static int pc87360_write_value(struct i2c_client *client, u8 reg, u8 value) +static int pc87360_write_value(struct pc87360_data *data, int ldi, u8 reg, + u8 value) { - outb_p(value, client->addr + reg); + down(&(data->lock)); + outb_p(value, data->address[ldi] + reg); + up(&(data->lock)); return 0; } -static void pc87360_init_client(struct i2c_client *client) -{ - /* nothing yet, read only driver */ -} - static void pc87360_update_client(struct i2c_client *client) { struct pc87360_data *data = client->data; @@ -387,10 +587,34 @@ static void pc87360_update_client(struct i2c_client *client) if ((jiffies - data->last_updated > HZ + HZ / 2) || (jiffies < data->last_updated) || !data->valid) { for (i = 0; i < data->fannr; i++) { - data->fan[i] = pc87360_read_value(client, PC87360_REG_FAN(i)); - data->fan_min[i] = pc87360_read_value(client, PC87360_REG_FAN_MIN(i)); - data->fan_status[i] = pc87360_read_value(client, PC87360_REG_FAN_STATUS(i)); - data->pwm[i] = pc87360_read_value(client, PC87360_REG_PWM(i)); + data->fan[i] = pc87360_read_value(data, 0, PC87360_REG_FAN(i)); + data->fan_min[i] = pc87360_read_value(data, 0, PC87360_REG_FAN_MIN(i)); + data->fan_status[i] = pc87360_read_value(data, 0, PC87360_REG_FAN_STATUS(i)); + data->pwm[i] = pc87360_read_value(data, 0, PC87360_REG_PWM(i)); + } + + for (i = 0; i < data->innr; i++) { + pc87360_write_value(data, 1, PC87365_REG_IN_BANK, i); + data->in_status[i] = pc87360_read_value(data, 1, PC87365_REG_IN_STATUS); + if (data->in_status[i] & 0x01) { + data->in[i] = pc87360_read_value(data, 1, PC87365_REG_IN); + data->in_min[i] = pc87360_read_value(data, 1, PC87365_REG_IN_MIN); + data->in_max[i] = pc87360_read_value(data, 1, PC87365_REG_IN_MAX); + } + data->in_alarms = pc87360_read_value(data, 1, PC87365_REG_IN_ALARMS1) + | (pc87360_read_value(data, 1, PC87365_REG_IN_ALARMS2) << 8); + } + + for (i = 0; i < data->tempnr; i++) { + pc87360_write_value(data, 2, PC87365_REG_TEMP_BANK, i); + data->temp_status[i] = pc87360_read_value(data, 2, PC87365_REG_TEMP_STATUS); + if (data->temp_status[i] & 0x01) { + data->temp[i] = pc87360_read_value(data, 2, PC87365_REG_TEMP); + data->temp_min[i] = pc87360_read_value(data, 2, PC87365_REG_TEMP_MIN); + data->temp_max[i] = pc87360_read_value(data, 2, PC87365_REG_TEMP_MAX); + data->temp_crit[i] = pc87360_read_value(data, 2, PC87365_REG_TEMP_CRIT); + } + data->temp_alarms = pc87360_read_value(data, 2, PC87365_REG_TEMP_ALARMS); } data->last_updated = jiffies; @@ -401,6 +625,21 @@ static void pc87360_update_client(struct i2c_client *client) } +void pc87365_alarms(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct pc87360_data *data = client->data; + + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 0; + else if (operation == SENSORS_PROC_REAL_READ) { + pc87360_update_client(client); + results[0] = data->in_alarms; + results[1] = data->temp_alarms; + *nrels_mag = 2; + } +} + void pc87360_fan(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results) { @@ -422,7 +661,7 @@ void pc87360_fan(struct i2c_client *client, int operation, int ctl_name, if (*nrels_mag >= 1) { data->fan_min[nr] = FAN_TO_REG(results[0], FAN_DIV_FROM_REG(data->fan_status[nr])); - pc87360_write_value(client, PC87360_REG_FAN_MIN(nr), + pc87360_write_value(data, 0, PC87360_REG_FAN_MIN(nr), data->fan_min[nr]); } } @@ -451,11 +690,11 @@ void pc87360_fan_div(struct i2c_client *client, int operation, FAN_DIV_FROM_REG(data->fan_status[i])); data->fan_status[i] = (data->fan_status[i] & 0x9F) | FAN_DIV_TO_REG(results[i]); - pc87360_write_value(client, PC87360_REG_FAN_STATUS(i), + pc87360_write_value(data, 0, PC87360_REG_FAN_STATUS(i), data->fan_status[i]); data->fan_min[i] = FAN_TO_REG(fan_min, FAN_DIV_FROM_REG(data->fan_status[i])); - pc87360_write_value(client, PC87360_REG_FAN_MIN(i), + pc87360_write_value(data, 0, PC87360_REG_FAN_MIN(i), data->fan_min[i]); } } @@ -478,7 +717,7 @@ void pc87360_pwm(struct i2c_client *client, int operation, int ctl_name, if (*nrels_mag >= 1) { data->pwm[nr] = SENSORS_LIMIT(results[0], 0, 255); - pc87360_write_value(client, PC87360_REG_PWM(nr), + pc87360_write_value(data, 0, PC87360_REG_PWM(nr), data->pwm[nr]); } } @@ -494,22 +733,85 @@ void pc87360_fan_status(struct i2c_client *client, int operation, int ctl_name, *nrels_mag = 0; else if (operation == SENSORS_PROC_REAL_READ) { pc87360_update_client(client); - results[0] = ALARM_FROM_REG(data->pwm[nr]); + results[0] = FAN_STATUS_FROM_REG(data->fan_status[nr]); *nrels_mag = 1; } } +void pc87365_in(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct pc87360_data *data = client->data; + int nr = ctl_name - PC87365_SYSCTL_IN0; + + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 3; + else if (operation == SENSORS_PROC_REAL_READ) { + pc87360_update_client(client); + results[0] = IN_FROM_REG(data->in_max[nr]); + results[1] = IN_FROM_REG(data->in_min[nr]); + results[2] = IN_FROM_REG(data->in[nr]); + *nrels_mag = 3; + } +} + +void pc87365_in_status(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct pc87360_data *data = client->data; + int nr = ctl_name - PC87365_SYSCTL_IN0_STATUS; + + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 0; + else if (operation == SENSORS_PROC_REAL_READ) { + pc87360_update_client(client); + results[0] = IN_STATUS_FROM_REG(data->in_status[nr]); + *nrels_mag = 1; + } +} + +void pc87365_temp(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct pc87360_data *data = client->data; + int nr = ctl_name - PC87365_SYSCTL_TEMP1; + + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 0; + else if (operation == SENSORS_PROC_REAL_READ) { + pc87360_update_client(client); + results[0] = TEMP_FROM_REG(data->temp_max[nr]); + results[1] = TEMP_FROM_REG(data->temp_min[nr]); + results[1] = TEMP_FROM_REG(data->temp_crit[nr]); + results[2] = TEMP_FROM_REG(data->temp[nr]); + *nrels_mag = 4; + } +} + +void pc87365_temp_status(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct pc87360_data *data = client->data; + int nr = ctl_name - PC87365_SYSCTL_TEMP1_STATUS; + + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 0; + else if (operation == SENSORS_PROC_REAL_READ) { + pc87360_update_client(client); + results[0] = TEMP_STATUS_FROM_REG(data->temp_status[nr]); + *nrels_mag = 1; + } +} + + static int __init pc87360_init(void) { - int addr; - printk("pc87360.o version %s (%s)\n", LM_VERSION, LM_DATE); - if (pc87360_find(&addr, &devid)) { + if (pc87360_find(&devid, extra_isa)) { printk("pc87360.o: PC8736x not detected, module not inserted.\n"); return -ENODEV; } - normal_isa[0] = addr; return i2c_add_driver(&pc87360_driver); } diff --git a/lib/chips.c b/lib/chips.c index 77dab755..042282b2 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -4257,25 +4257,38 @@ static sensors_chip_feature pc87360_features[] = PC87360_SYSCTL_FAN1, VALUE(2), 0 }, { SENSORS_PC87360_FAN2, "fan2", NOMAP, NOMAP, R, PC87360_SYSCTL_FAN2, VALUE(2), 0 }, + { SENSORS_PC87360_FAN3, "fan3", NOMAP, NOMAP, R, + PC87360_SYSCTL_FAN3, VALUE(2), 0 }, { SENSORS_PC87360_FAN1_MIN, "fan1_min", SENSORS_PC87360_FAN1, SENSORS_PC87360_FAN1, RW, PC87360_SYSCTL_FAN1, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_MIN, "fan2_min", SENSORS_PC87360_FAN2, SENSORS_PC87360_FAN2, RW, PC87360_SYSCTL_FAN2, VALUE(1), 0 }, + { SENSORS_PC87360_FAN3_MIN, "fan3_min", SENSORS_PC87360_FAN3, + SENSORS_PC87360_FAN3, RW, PC87360_SYSCTL_FAN3, + VALUE(1), 0 }, { SENSORS_PC87360_FAN1_DIV, "fan1_div", SENSORS_PC87360_FAN1, NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_DIV, "fan2_div", SENSORS_PC87360_FAN2, NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(2), 0 }, + { SENSORS_PC87360_FAN3_DIV, "fan3_div", SENSORS_PC87360_FAN3, + NOMAP, RW, PC87360_SYSCTL_FAN_DIV, VALUE(3), 0 }, { SENSORS_PC87360_FAN1_STATUS, "fan1_status", SENSORS_PC87360_FAN1, NOMAP, R, PC87360_SYSCTL_FAN1_STATUS, VALUE(1), 0 }, { SENSORS_PC87360_FAN2_STATUS, "fan2_status", SENSORS_PC87360_FAN2, NOMAP, R, PC87360_SYSCTL_FAN2_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_FAN3_STATUS, "fan3_status", SENSORS_PC87360_FAN3, + NOMAP, R, PC87360_SYSCTL_FAN3_STATUS, VALUE(1), 0 }, { 0 } }; -static sensors_chip_feature pc87364_features[] = +static sensors_chip_feature pc87365_features[] = { + { SENSORS_PC87360_ALARMS_IN, "alarms_in", NOMAP, NOMAP, R, + PC87365_SYSCTL_ALARMS, VALUE(1), 0 }, + { SENSORS_PC87360_ALARMS_TEMP, "alarms_temp", NOMAP, NOMAP, R, + PC87365_SYSCTL_ALARMS, VALUE(2), 0 }, { SENSORS_PC87360_FAN1, "fan1", NOMAP, NOMAP, R, PC87360_SYSCTL_FAN1, VALUE(2), 0 }, { SENSORS_PC87360_FAN2, "fan2", NOMAP, NOMAP, R, @@ -4303,6 +4316,155 @@ static sensors_chip_feature pc87364_features[] = NOMAP, R, PC87360_SYSCTL_FAN2_STATUS, VALUE(1), 0 }, { SENSORS_PC87360_FAN3_STATUS, "fan3_status", SENSORS_PC87360_FAN3, NOMAP, R, PC87360_SYSCTL_FAN3_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN0, "in0", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN0, VALUE(3), 2 }, + { SENSORS_PC87360_IN1, "in1", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN1, VALUE(3), 2 }, + { SENSORS_PC87360_IN2, "in2", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN2, VALUE(3), 2 }, + { SENSORS_PC87360_IN3, "in3", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN3, VALUE(3), 2 }, + { SENSORS_PC87360_IN4, "in4", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN4, VALUE(3), 2 }, + { SENSORS_PC87360_IN5, "in5", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN5, VALUE(3), 2 }, + { SENSORS_PC87360_IN6, "in6", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN6, VALUE(3), 2 }, + { SENSORS_PC87360_IN7, "in7", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN7, VALUE(3), 2 }, + { SENSORS_PC87360_IN8, "in8", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN8, VALUE(3), 2 }, + { SENSORS_PC87360_IN9, "in9", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN9, VALUE(3), 2 }, + { SENSORS_PC87360_IN10, "in10", NOMAP, NOMAP, R, + PC87365_SYSCTL_IN10, VALUE(3), 2 }, + { SENSORS_PC87360_IN0_MIN, "in0_min", SENSORS_PC87360_IN0, + SENSORS_PC87360_IN0, RW, PC87365_SYSCTL_IN0, + VALUE(1), 2 }, + { SENSORS_PC87360_IN1_MIN, "in1_min", SENSORS_PC87360_IN1, + SENSORS_PC87360_IN1, RW, PC87365_SYSCTL_IN1, + VALUE(1), 2 }, + { SENSORS_PC87360_IN2_MIN, "in2_min", SENSORS_PC87360_IN2, + SENSORS_PC87360_IN2, RW, PC87365_SYSCTL_IN2, + VALUE(1), 2 }, + { SENSORS_PC87360_IN3_MIN, "in3_min", SENSORS_PC87360_IN3, + SENSORS_PC87360_IN3, RW, PC87365_SYSCTL_IN3, + VALUE(1), 2 }, + { SENSORS_PC87360_IN4_MIN, "in4_min", SENSORS_PC87360_IN4, + SENSORS_PC87360_IN4, RW, PC87365_SYSCTL_IN4, + VALUE(1), 2 }, + { SENSORS_PC87360_IN5_MIN, "in5_min", SENSORS_PC87360_IN5, + SENSORS_PC87360_IN5, RW, PC87365_SYSCTL_IN5, + VALUE(1), 2 }, + { SENSORS_PC87360_IN6_MIN, "in6_min", SENSORS_PC87360_IN6, + SENSORS_PC87360_IN6, RW, PC87365_SYSCTL_IN6, + VALUE(1), 2 }, + { SENSORS_PC87360_IN7_MIN, "in7_min", SENSORS_PC87360_IN7, + SENSORS_PC87360_IN7, RW, PC87365_SYSCTL_IN7, + VALUE(1), 2 }, + { SENSORS_PC87360_IN8_MIN, "in8_min", SENSORS_PC87360_IN8, + SENSORS_PC87360_IN8, RW, PC87365_SYSCTL_IN8, + VALUE(1), 2 }, + { SENSORS_PC87360_IN9_MIN, "in9_min", SENSORS_PC87360_IN9, + SENSORS_PC87360_IN9, RW, PC87365_SYSCTL_IN9, + VALUE(1), 2 }, + { SENSORS_PC87360_IN10_MIN, "in10_min", SENSORS_PC87360_IN10, + SENSORS_PC87360_IN10, RW, PC87365_SYSCTL_IN10, + VALUE(1), 2 }, + { SENSORS_PC87360_IN0_MAX, "in0_max", SENSORS_PC87360_IN0, + SENSORS_PC87360_IN0, RW, PC87365_SYSCTL_IN0, + VALUE(2), 2 }, + { SENSORS_PC87360_IN1_MAX, "in1_max", SENSORS_PC87360_IN1, + SENSORS_PC87360_IN1, RW, PC87365_SYSCTL_IN1, + VALUE(2), 2 }, + { SENSORS_PC87360_IN2_MAX, "in2_max", SENSORS_PC87360_IN2, + SENSORS_PC87360_IN2, RW, PC87365_SYSCTL_IN2, + VALUE(2), 2 }, + { SENSORS_PC87360_IN3_MAX, "in3_max", SENSORS_PC87360_IN3, + SENSORS_PC87360_IN3, RW, PC87365_SYSCTL_IN3, + VALUE(2), 2 }, + { SENSORS_PC87360_IN4_MAX, "in4_max", SENSORS_PC87360_IN4, + SENSORS_PC87360_IN4, RW, PC87365_SYSCTL_IN4, + VALUE(2), 2 }, + { SENSORS_PC87360_IN5_MAX, "in5_max", SENSORS_PC87360_IN5, + SENSORS_PC87360_IN5, RW, PC87365_SYSCTL_IN5, + VALUE(2), 2 }, + { SENSORS_PC87360_IN6_MAX, "in6_max", SENSORS_PC87360_IN6, + SENSORS_PC87360_IN6, RW, PC87365_SYSCTL_IN6, + VALUE(2), 2 }, + { SENSORS_PC87360_IN7_MAX, "in7_max", SENSORS_PC87360_IN7, + SENSORS_PC87360_IN7, RW, PC87365_SYSCTL_IN7, + VALUE(2), 2 }, + { SENSORS_PC87360_IN8_MAX, "in8_max", SENSORS_PC87360_IN8, + SENSORS_PC87360_IN8, RW, PC87365_SYSCTL_IN8, + VALUE(2), 2 }, + { SENSORS_PC87360_IN9_MAX, "in9_max", SENSORS_PC87360_IN9, + SENSORS_PC87360_IN9, RW, PC87365_SYSCTL_IN9, + VALUE(2), 2 }, + { SENSORS_PC87360_IN10_MAX, "in10_max", SENSORS_PC87360_IN10, + SENSORS_PC87360_IN10, RW, PC87365_SYSCTL_IN10, + VALUE(2), 2 }, + { SENSORS_PC87360_IN0_STATUS, "in0_status", SENSORS_PC87360_IN0, + NOMAP, R, PC87365_SYSCTL_IN0_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN1_STATUS, "in1_status", SENSORS_PC87360_IN1, + NOMAP, R, PC87365_SYSCTL_IN1_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN2_STATUS, "in2_status", SENSORS_PC87360_IN2, + NOMAP, R, PC87365_SYSCTL_IN2_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN3_STATUS, "in3_status", SENSORS_PC87360_IN3, + NOMAP, R, PC87365_SYSCTL_IN3_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN4_STATUS, "in4_status", SENSORS_PC87360_IN4, + NOMAP, R, PC87365_SYSCTL_IN4_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN5_STATUS, "in5_status", SENSORS_PC87360_IN5, + NOMAP, R, PC87365_SYSCTL_IN5_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN6_STATUS, "in6_status", SENSORS_PC87360_IN6, + NOMAP, R, PC87365_SYSCTL_IN6_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN7_STATUS, "in7_status", SENSORS_PC87360_IN7, + NOMAP, R, PC87365_SYSCTL_IN7_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN8_STATUS, "in8_status", SENSORS_PC87360_IN8, + NOMAP, R, PC87365_SYSCTL_IN8_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN9_STATUS, "in9_status", SENSORS_PC87360_IN9, + NOMAP, R, PC87365_SYSCTL_IN0_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_IN10_STATUS, "in10_status", SENSORS_PC87360_IN10, + NOMAP, R, PC87365_SYSCTL_IN10_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_TEMP1, "temp1", NOMAP, NOMAP, R, + PC87365_SYSCTL_TEMP1, VALUE(4), 0 }, + { SENSORS_PC87360_TEMP2, "temp2", NOMAP, NOMAP, R, + PC87365_SYSCTL_TEMP2, VALUE(4), 0 }, + { SENSORS_PC87360_TEMP3, "temp3", NOMAP, NOMAP, R, + PC87365_SYSCTL_TEMP3, VALUE(4), 0 }, + { SENSORS_PC87360_TEMP1_MIN, "temp1_min", SENSORS_PC87360_TEMP1, + SENSORS_PC87360_TEMP1, RW, PC87365_SYSCTL_TEMP1, + VALUE(2), 0 }, + { SENSORS_PC87360_TEMP2_MIN, "temp2_min", SENSORS_PC87360_TEMP2, + SENSORS_PC87360_TEMP2, RW, PC87365_SYSCTL_TEMP2, + VALUE(2), 0 }, + { SENSORS_PC87360_TEMP3_MIN, "temp3_min", SENSORS_PC87360_TEMP3, + SENSORS_PC87360_TEMP3, RW, PC87365_SYSCTL_TEMP3, + VALUE(2), 0 }, + { SENSORS_PC87360_TEMP1_MAX, "temp1_max", SENSORS_PC87360_TEMP1, + SENSORS_PC87360_TEMP1, RW, PC87365_SYSCTL_TEMP1, + VALUE(1), 0 }, + { SENSORS_PC87360_TEMP2_MAX, "temp2_max", SENSORS_PC87360_TEMP2, + SENSORS_PC87360_TEMP2, RW, PC87365_SYSCTL_TEMP2, + VALUE(1), 0 }, + { SENSORS_PC87360_TEMP3_MAX, "temp3_max", SENSORS_PC87360_TEMP3, + SENSORS_PC87360_TEMP3, RW, PC87365_SYSCTL_TEMP3, + VALUE(1), 0 }, + { SENSORS_PC87360_TEMP1_CRIT, "temp1_crit", SENSORS_PC87360_TEMP1, + SENSORS_PC87360_TEMP1, RW, PC87365_SYSCTL_TEMP1, + VALUE(3), 0 }, + { SENSORS_PC87360_TEMP2_CRIT, "temp2_crit", SENSORS_PC87360_TEMP2, + SENSORS_PC87360_TEMP2, RW, PC87365_SYSCTL_TEMP2, + VALUE(3), 0 }, + { SENSORS_PC87360_TEMP3_CRIT, "temp3_crit", SENSORS_PC87360_TEMP3, + SENSORS_PC87360_TEMP3, RW, PC87365_SYSCTL_TEMP3, + VALUE(3), 0 }, + { SENSORS_PC87360_TEMP1_STATUS, "temp1_status", SENSORS_PC87360_TEMP1, + NOMAP, R, PC87365_SYSCTL_TEMP1_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_TEMP2_STATUS, "temp2_status", SENSORS_PC87360_TEMP2, + NOMAP, R, PC87365_SYSCTL_TEMP2_STATUS, VALUE(1), 0 }, + { SENSORS_PC87360_TEMP3_STATUS, "temp3_status", SENSORS_PC87360_TEMP3, + NOMAP, R, PC87365_SYSCTL_TEMP3_STATUS, VALUE(1), 0 }, { 0 } }; @@ -4854,9 +5016,9 @@ sensors_chip_features sensors_chip_features_list[] = { SENSORS_SMSC47M1_PREFIX, smsc47m1_features }, { SENSORS_PC87360_PREFIX, pc87360_features }, { SENSORS_PC87363_PREFIX, pc87360_features }, - { SENSORS_PC87364_PREFIX, pc87364_features }, - { SENSORS_PC87365_PREFIX, pc87364_features }, - { SENSORS_PC87366_PREFIX, pc87364_features }, + { SENSORS_PC87364_PREFIX, pc87360_features }, + { SENSORS_PC87365_PREFIX, pc87365_features }, + { SENSORS_PC87366_PREFIX, pc87365_features }, { SENSORS_LM92_PREFIX, lm92_features }, { SENSORS_VT8231_PREFIX, vt8231_features }, { SENSORS_BMC_PREFIX, bmc_features }, diff --git a/lib/chips.h b/lib/chips.h index 921997a7..cfc01479 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1624,18 +1624,82 @@ #define SENSORS_PC87365_PREFIX "pc87365" #define SENSORS_PC87366_PREFIX "pc87366" -#define SENSORS_PC87360_FAN1 31 /* R */ -#define SENSORS_PC87360_FAN2 32 /* R */ -#define SENSORS_PC87360_FAN3 33 /* R */ -#define SENSORS_PC87360_FAN1_MIN 41 /* R */ -#define SENSORS_PC87360_FAN2_MIN 42 /* R */ -#define SENSORS_PC87360_FAN3_MIN 43 /* R */ -#define SENSORS_PC87360_FAN1_DIV 71 /* R */ -#define SENSORS_PC87360_FAN2_DIV 72 /* R */ -#define SENSORS_PC87360_FAN3_DIV 73 /* R */ -#define SENSORS_PC87360_FAN1_STATUS 81 /* R */ -#define SENSORS_PC87360_FAN2_STATUS 82 /* R */ -#define SENSORS_PC87360_FAN3_STATUS 83 /* R */ +#define SENSORS_PC87360_ALARMS_IN 10 /* R */ +#define SENSORS_PC87360_ALARMS_TEMP 11 /* R */ + +#define SENSORS_PC87360_FAN1 31 /* R */ +#define SENSORS_PC87360_FAN2 32 /* R */ +#define SENSORS_PC87360_FAN3 33 /* R */ +#define SENSORS_PC87360_FAN1_MIN 41 /* RW */ +#define SENSORS_PC87360_FAN2_MIN 42 /* RW */ +#define SENSORS_PC87360_FAN3_MIN 43 /* RW */ +#define SENSORS_PC87360_FAN1_DIV 71 /* RW */ +#define SENSORS_PC87360_FAN2_DIV 72 /* RW */ +#define SENSORS_PC87360_FAN3_DIV 73 /* RW */ +#define SENSORS_PC87360_FAN1_STATUS 81 /* R */ +#define SENSORS_PC87360_FAN2_STATUS 82 /* R */ +#define SENSORS_PC87360_FAN3_STATUS 83 /* R */ + +#define SENSORS_PC87360_IN0 90 /* R */ +#define SENSORS_PC87360_IN1 91 /* R */ +#define SENSORS_PC87360_IN2 92 /* R */ +#define SENSORS_PC87360_IN3 93 /* R */ +#define SENSORS_PC87360_IN4 94 /* R */ +#define SENSORS_PC87360_IN5 95 /* R */ +#define SENSORS_PC87360_IN6 96 /* R */ +#define SENSORS_PC87360_IN7 97 /* R */ +#define SENSORS_PC87360_IN8 98 /* R */ +#define SENSORS_PC87360_IN9 99 /* R */ +#define SENSORS_PC87360_IN10 100 /* R */ +#define SENSORS_PC87360_IN0_MIN 110 /* RW */ +#define SENSORS_PC87360_IN1_MIN 111 /* RW */ +#define SENSORS_PC87360_IN2_MIN 112 /* RW */ +#define SENSORS_PC87360_IN3_MIN 113 /* RW */ +#define SENSORS_PC87360_IN4_MIN 114 /* RW */ +#define SENSORS_PC87360_IN5_MIN 115 /* RW */ +#define SENSORS_PC87360_IN6_MIN 116 /* RW */ +#define SENSORS_PC87360_IN7_MIN 117 /* RW */ +#define SENSORS_PC87360_IN8_MIN 118 /* RW */ +#define SENSORS_PC87360_IN9_MIN 119 /* RW */ +#define SENSORS_PC87360_IN10_MIN 120 /* RW */ +#define SENSORS_PC87360_IN0_MAX 130 /* RW */ +#define SENSORS_PC87360_IN1_MAX 131 /* RW */ +#define SENSORS_PC87360_IN2_MAX 132 /* RW */ +#define SENSORS_PC87360_IN3_MAX 133 /* RW */ +#define SENSORS_PC87360_IN4_MAX 134 /* RW */ +#define SENSORS_PC87360_IN5_MAX 135 /* RW */ +#define SENSORS_PC87360_IN6_MAX 136 /* RW */ +#define SENSORS_PC87360_IN7_MAX 137 /* RW */ +#define SENSORS_PC87360_IN8_MAX 138 /* RW */ +#define SENSORS_PC87360_IN9_MAX 139 /* RW */ +#define SENSORS_PC87360_IN10_MAX 140 /* RW */ +#define SENSORS_PC87360_IN0_STATUS 150 /* R */ +#define SENSORS_PC87360_IN1_STATUS 151 /* R */ +#define SENSORS_PC87360_IN2_STATUS 152 /* R */ +#define SENSORS_PC87360_IN3_STATUS 153 /* R */ +#define SENSORS_PC87360_IN4_STATUS 154 /* R */ +#define SENSORS_PC87360_IN5_STATUS 155 /* R */ +#define SENSORS_PC87360_IN6_STATUS 156 /* R */ +#define SENSORS_PC87360_IN7_STATUS 157 /* R */ +#define SENSORS_PC87360_IN8_STATUS 158 /* R */ +#define SENSORS_PC87360_IN9_STATUS 159 /* R */ +#define SENSORS_PC87360_IN10_STATUS 160 /* R */ + +#define SENSORS_PC87360_TEMP1 171 /* R */ +#define SENSORS_PC87360_TEMP2 172 /* R */ +#define SENSORS_PC87360_TEMP3 173 /* R */ +#define SENSORS_PC87360_TEMP1_MIN 181 /* RW */ +#define SENSORS_PC87360_TEMP2_MIN 182 /* RW */ +#define SENSORS_PC87360_TEMP3_MIN 183 /* RW */ +#define SENSORS_PC87360_TEMP1_MAX 191 /* RW */ +#define SENSORS_PC87360_TEMP2_MAX 192 /* RW */ +#define SENSORS_PC87360_TEMP3_MAX 193 /* RW */ +#define SENSORS_PC87360_TEMP1_CRIT 201 /* RW */ +#define SENSORS_PC87360_TEMP2_CRIT 202 /* RW */ +#define SENSORS_PC87360_TEMP3_CRIT 203 /* RW */ +#define SENSORS_PC87360_TEMP1_STATUS 211 /* R */ +#define SENSORS_PC87360_TEMP2_STATUS 212 /* R */ +#define SENSORS_PC87360_TEMP3_STATUS 213 /* R */ #define SENSORS_LM92_PREFIX "lm92" diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 53e02006..12f7ee33 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -4009,8 +4009,8 @@ void print_pc87360(const sensors_chip_name *name) print_label(label, 10); printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", cur, min, fdiv, - status&PC87360_ALARM_FAN_OVERFLOW?"OVERFLOW": - status&PC87360_ALARM_FAN_LOW?"ALARM":""); + status&PC87360_STATUS_FAN_OVERFLOW?"OVERFLOW": + status&PC87360_STATUS_FAN_LOW?"ALARM":""); } } else printf("ERROR: Can't get FAN1 data!\n"); @@ -4031,8 +4031,8 @@ void print_pc87360(const sensors_chip_name *name) print_label(label, 10); printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", cur, min, fdiv, - status&PC87360_ALARM_FAN_OVERFLOW?"OVERFLOW": - status&PC87360_ALARM_FAN_LOW?"ALARM":""); + status&PC87360_STATUS_FAN_OVERFLOW?"OVERFLOW": + status&PC87360_STATUS_FAN_LOW?"ALARM":""); } } else printf("ERROR: Can't get FAN2 data!\n"); @@ -4062,14 +4062,285 @@ void print_pc87364(const sensors_chip_name *name) print_label(label, 10); printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", cur, min, fdiv, - status&PC87360_ALARM_FAN_OVERFLOW?"OVERFLOW": - status&PC87360_ALARM_FAN_LOW?"ALARM":""); + status&PC87360_STATUS_FAN_OVERFLOW?"OVERFLOW": + status&PC87360_STATUS_FAN_LOW?"ALARM":""); } } else printf("ERROR: Can't get FAN3 data!\n"); free_the_label(&label); } +void print_pc87366(const sensors_chip_name *name) +{ + char *label = NULL; + double cur, min, max; + int alarms, valid; + + if (!sensors_get_feature(*name, SENSORS_PC87360_ALARMS_IN, &cur)) + alarms = cur + 0.5; + else { + printf("ERROR: Can't get IN alarms data!\n"); + alarms = 0; + } + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN0, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN0, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN0_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN0_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<0)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN0 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN1, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN1, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN1_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN1_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<1)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN1 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN2, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN2, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN2_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN2_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<2)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN2 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN3, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN3, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN3_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN3_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<3)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN3 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN4, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<4)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN4 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN4, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN4_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<4)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN4 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN5, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN5, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN5_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN5_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<5)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN5 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN6, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN6, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN6_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN6_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<6)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN6 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN7, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN7, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN7_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN7_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<7)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN7 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN8, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN8, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN8_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN8_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<8)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN8 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN9, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN9, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN9_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN9_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<9)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN9 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_IN10, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_IN10, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_IN10_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_IN10_MAX, &max)) { + if (valid) { + print_label(label, 10); + printf("%+6.2f V (min = %+6.2f V, max = %6.2f V) %s\n", + cur, min, max, + alarms&(1<<10)?"ALARM":""); + } + } else + printf("ERROR: Can't get IN10 data!\n"); + free_the_label(&label); + + print_pc87364(name); + + if (!sensors_get_feature(*name, SENSORS_PC87360_ALARMS_TEMP, &cur)) + alarms = cur + 0.5; + else { + printf("ERROR: Can't get TEMP alarms data!\n"); + alarms = 0; + } + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP1, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP1, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP1_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP1_MAX, &max)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, max, min, MINMAX, 0, 0); + if (alarms&(1<<0)) + printf("ALARM"); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP1 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP1_CRIT, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP1_CRIT, &cur)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP1 overtemperature data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP2, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP2, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP2_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP2_MAX, &max)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, max, min, MINMAX, 0, 0); + if (alarms&(1<<1)) + printf("ALARM"); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP2 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP2_CRIT, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP2_CRIT, &cur)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP2 overtemperature data!\n"); + free_the_label(&label); + + if (!strcmp(name->prefix, "pc87366")) { + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP3, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP3, &cur) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP3_MIN, &min) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP3_MAX, &max)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, max, min, MINMAX, 0, 0); + if (alarms&(1<<2)) + printf("ALARM"); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP3 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name, SENSORS_PC87360_TEMP3_CRIT, &label, &valid) + && !sensors_get_feature(*name, SENSORS_PC87360_TEMP3_CRIT, &cur)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, 0, 0, SINGLE, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get TEMP3 overtemperature data!\n"); + free_the_label(&label); + } +} + static void lm92_print_temp (float n_cur,float n_high,float n_low,float n_crit,float n_hyst) { if (fahrenheit) { diff --git a/prog/sensors/chips.h b/prog/sensors/chips.h index 7eb7d437..360049e8 100644 --- a/prog/sensors/chips.h +++ b/prog/sensors/chips.h @@ -54,6 +54,7 @@ extern void print_vt1211(const sensors_chip_name *name); extern void print_smsc47m1(const sensors_chip_name *name); extern void print_pc87360(const sensors_chip_name *name); extern void print_pc87364(const sensors_chip_name *name); +extern void print_pc87366(const sensors_chip_name *name); extern void print_lm92(const sensors_chip_name *name); extern void print_vt8231(const sensors_chip_name *name); extern void print_bmc(const sensors_chip_name *name); diff --git a/prog/sensors/main.c b/prog/sensors/main.c index 1f9ba70e..f1233337 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -413,8 +413,8 @@ struct match matches[] = { { "pc87360", print_pc87360 }, { "pc87363", print_pc87360 }, { "pc87364", print_pc87364 }, - { "pc87365", print_pc87364 }, - { "pc87366", print_pc87364 }, + { "pc87365", print_pc87366 }, + { "pc87366", print_pc87366 }, { "lm92", print_lm92 }, { "vt8231", print_vt8231 }, { "bmc", print_bmc },