From f0fc7dfc5f51dc51f96edbdca6fe4ab02d18c356 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 1 Feb 2004 13:20:41 +0000 Subject: [PATCH] Move FSC Hermes voltage conversions to sensors.conf. (Reinhard Nissl) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2257 7894878c-1315-0410-8ee3-d5d059ff63e0 --- etc/sensors.conf.eg | 24 +++++++++++++++++++--- kernel/chips/fscher.c | 47 ++++++++++--------------------------------- 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index b9fad8f8..76a3301a 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -1560,23 +1560,41 @@ chip "fscher-*" # Fujitsu-Siemens Hermes chip # Temperature - label temp1 "Temp1/CPU" label temp2 "Temp2/MB" label temp3 "Temp3/AUX" # Fans - label fan1 "Fan1/CPU" label fan2 "Fan2/AUX" label fan3 "Fan3/PS" # Voltage - label in0 "+12V" label in1 "+5V" label in2 "Battery" +# Compute Voltages using mainboard dependant MRO-values (see doc/chips/fscher) +# M R O O M R + compute in0 (@ * (49 * 33) / 255) + (0 / 100), (@ - (0 / 100)) * 255 / (49 * 33) + compute in1 (@ * (20 * 33) / 255) + (0 / 100), (@ - (0 / 100)) * 255 / (20 * 33) + compute in2 (@ * (10 * 33) / 255) + (0 / 100), (@ - (0 / 100)) * 255 / (10 * 33) + +# Allow fans to turn off +# set pwm1 0 +# set pwm2 0 +# set pwm3 0 + +# Min cooling +# set pwm1 2 +# set pwm2 1 +# set pwm3 1 + +# Max cooling +# set pwm1 255 +# set pwm2 255 +# set pwm3 255 + chip "pcf8591-*" # diff --git a/kernel/chips/fscher.c b/kernel/chips/fscher.c index 95425332..f838f04c 100644 --- a/kernel/chips/fscher.c +++ b/kernel/chips/fscher.c @@ -1,7 +1,7 @@ /* fscher.c - Part of lm_sensors, Linux kernel modules for hardware monitoring - Copyright (c) 2003 Reinhard Nissl + Copyright (C) 2003, 2004 Reinhard Nissl 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 @@ -21,8 +21,8 @@ /* fujitsu siemens hermes chip, module based on fscpos.c - Copyright (c) 2000 Hermann Jung - Copyright (c) 1998, 1999 Frodo Looijaard + Copyright (C) 2000 Hermann Jung + Copyright (C) 1998, 1999 Frodo Looijaard and Philip Edelbrock */ @@ -529,37 +529,12 @@ void fscher_temp(struct i2c_client *client, int operation, int ctl_name, } /* - * Multiplier, ReferenceVoltage and Offset were taken from dmidecode output: - * - * Handle 0x0002 - * DMI type 2, 8 bytes. - * Board Information Block - * Vendor: FUJITSU SIEMENS - * Product: D1562 - * Version: S26361-D1562 - * Serial Number: 11732921 - * - * Handle 0x0045 - * DMI type 185, 56 bytes. - * 13 - * ... - * 01 - * 14 00 - * 00 00 - * 02 - * 31 00 - * 00 00 - * 03 - * 0a 00 - * 00 00 - * ... - * 07 - * 21 00 - * ... + * The final conversion is specified in sensors.conf, as it depends on + * mainboard specific values. We export the registers contents as + * pseudo-hundreds-of-Volts (range 0V - 2.55V). Not that it makes much + * sense per se, but it minimizes the conversions count and keeps the + * values within a usual range. */ - -#define VOLT_FROM_REG(val,mult,ref,off) (val*mult*ref/255+off) - void fscher_volt(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results) { @@ -570,13 +545,13 @@ void fscher_volt(struct i2c_client *client, int operation, int ctl_name, fscher_update_client(client); switch(ctl_name) { case FSCHER_SYSCTL_VOLT0: - results[0] = VOLT_FROM_REG(data->volt[0],0x0031,0x0021,0x0000); + results[0] = data->volt[0]; break; case FSCHER_SYSCTL_VOLT1: - results[0] = VOLT_FROM_REG(data->volt[1],0x0014,0x0021,0x0000); + results[0] = data->volt[1]; break; case FSCHER_SYSCTL_VOLT2: - results[0] = VOLT_FROM_REG(data->volt[2],0x000a,0x0021,0x0000); + results[0] = data->volt[2]; break; default: printk("fscher: ctl_name %d not supported\n", ctl_name);