From 00cb4739053fa0ce4594a7798a4095007a1c7c79 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 8 May 2007 17:21:59 +0200 Subject: hwmon/smsc47m192: Document the LPC47M292 as supported The new SMSC LPC47M292 Super-I/O chip includes a hardware monitoring block which is compatible with those of the LPC47M192. Signed-off-by: Jean Delvare Cc: Hartmut Rick --- Documentation/hwmon/smsc47m192 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/hwmon/smsc47m192 b/Documentation/hwmon/smsc47m192 index 45d6453cd435..6d54ecb7b3f8 100644 --- a/Documentation/hwmon/smsc47m192 +++ b/Documentation/hwmon/smsc47m192 @@ -2,12 +2,13 @@ Kernel driver smsc47m192 ======================== Supported chips: - * SMSC LPC47M192 and LPC47M997 + * SMSC LPC47M192, LPC47M15x, LPC47M292 and LPC47M997 Prefix: 'smsc47m192' Addresses scanned: I2C 0x2c - 0x2d Datasheet: The datasheet for LPC47M192 is publicly available from http://www.smsc.com/ - The LPC47M997 is compatible for hardware monitoring. + The LPC47M15x, LPC47M292 and LPC47M997 are compatible for + hardware monitoring. Author: Hartmut Rick Special thanks to Jean Delvare for careful checking @@ -18,7 +19,7 @@ Description ----------- This driver implements support for the hardware sensor capabilities -of the SMSC LPC47M192 and LPC47M997 Super-I/O chips. +of the SMSC LPC47M192 and compatible Super-I/O chips. These chips support 3 temperature channels and 8 voltage inputs as well as CPU voltage VID input. -- cgit v1.2.3 From 8eccbb6fb97a5b54a9db166399f0d24f33114522 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 8 May 2007 17:21:59 +0200 Subject: hwmon/smsc47m1: Add support for the LPC47M292 The new SMSC LPC47M292 Super-I/O chip is a bit different from the previous ones, it supports a 3rd fan, but unfortunately the pin configuration registers are different. Signed-off-by: Jean Delvare --- Documentation/hwmon/smsc47m1 | 11 ++- drivers/hwmon/Kconfig | 9 +-- drivers/hwmon/smsc47m1.c | 160 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 139 insertions(+), 41 deletions(-) (limited to 'Documentation') diff --git a/Documentation/hwmon/smsc47m1 b/Documentation/hwmon/smsc47m1 index 04a11124f667..42c8431b3c9d 100644 --- a/Documentation/hwmon/smsc47m1 +++ b/Documentation/hwmon/smsc47m1 @@ -14,6 +14,10 @@ Supported chips: http://www.smsc.com/main/datasheets/47m14x.pdf http://www.smsc.com/main/tools/discontinued/47m15x.pdf http://www.smsc.com/main/datasheets/47m192.pdf + * SMSC LPC47M292 + Addresses scanned: none, address read from Super I/O config space + Prefix: 'smsc47m2' + Datasheet: Not public * SMSC LPC47M997 Addresses scanned: none, address read from Super I/O config space Prefix: 'smsc47m1' @@ -32,9 +36,10 @@ Description The Standard Microsystems Corporation (SMSC) 47M1xx Super I/O chips contain monitoring and PWM control circuitry for two fans. -The 47M15x and 47M192 chips contain a full 'hardware monitoring block' -in addition to the fan monitoring and control. The hardware monitoring -block is not supported by the driver. +The LPC47M15x, LPC47M192 and LPC47M292 chips contain a full 'hardware +monitoring block' in addition to the fan monitoring and control. The +hardware monitoring block is not supported by this driver, use the +smsc47m192 driver for that. No documentation is available for the 47M997, but it has the same device ID as the 47M15x and 47M192 chips and seems to be compatible. diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 68ee9702e339..399b6a92e9b0 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -422,11 +422,12 @@ config SENSORS_SMSC47M1 If you say yes here you get support for the integrated fan monitoring and control capabilities of the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x, LPC47M14x, LPC47M15x, - LPC47M192 and LPC47M997 chips. + LPC47M192, LPC47M292 and LPC47M997 chips. - The temperature and voltage sensor features of the LPC47M192 - and LPC47M997 are supported by another driver, select also - "SMSC LPC47M192 and compatibles" below for those. + The temperature and voltage sensor features of the LPC47M15x, + LPC47M192, LPC47M292 and LPC47M997 are supported by another + driver, select also "SMSC LPC47M192 and compatibles" below for + those. This driver can also be built as a module. If so, the module will be called smsc47m1. diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index beb881c4b2e8..16762cca87e5 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c @@ -3,10 +3,11 @@ for hardware monitoring Supports the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x, - LPC47M14x, LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips. + LPC47M14x, LPC47M15x, LPC47M192, LPC47M292 and LPC47M997 + Super-I/O chips. Copyright (C) 2002 Mark D. Studebaker - Copyright (C) 2004 Jean Delvare + Copyright (C) 2004-2007 Jean Delvare Ported to Linux 2.6 by Gabriele Gorla and Jean Delvare @@ -40,6 +41,8 @@ /* Address is autodetected, there is no default value */ static unsigned short address; +static u8 devid; +enum chips { smsc47m1, smsc47m2 }; /* Super-I/0 registers and commands */ @@ -87,10 +90,18 @@ superio_exit(void) #define SMSC47M1_REG_ALARM 0x04 #define SMSC47M1_REG_TPIN(nr) (0x34 - (nr)) #define SMSC47M1_REG_PPIN(nr) (0x36 - (nr)) -#define SMSC47M1_REG_PWM(nr) (0x56 + (nr)) #define SMSC47M1_REG_FANDIV 0x58 -#define SMSC47M1_REG_FAN(nr) (0x59 + (nr)) -#define SMSC47M1_REG_FAN_PRELOAD(nr) (0x5B + (nr)) + +static const u8 SMSC47M1_REG_FAN[3] = { 0x59, 0x5a, 0x6b }; +static const u8 SMSC47M1_REG_FAN_PRELOAD[3] = { 0x5b, 0x5c, 0x6c }; +static const u8 SMSC47M1_REG_PWM[3] = { 0x56, 0x57, 0x69 }; + +#define SMSC47M2_REG_ALARM6 0x09 +#define SMSC47M2_REG_TPIN1 0x38 +#define SMSC47M2_REG_TPIN2 0x37 +#define SMSC47M2_REG_TPIN3 0x2d +#define SMSC47M2_REG_PPIN3 0x2c +#define SMSC47M2_REG_FANDIV3 0x6a #define MIN_FROM_REG(reg,div) ((reg)>=192 ? 0 : \ 983040/((192-(reg))*(div))) @@ -103,17 +114,18 @@ superio_exit(void) struct smsc47m1_data { struct i2c_client client; + enum chips type; struct class_device *class_dev; struct mutex lock; struct mutex update_lock; unsigned long last_updated; /* In jiffies */ - u8 fan[2]; /* Register value */ - u8 fan_preload[2]; /* Register value */ - u8 fan_div[2]; /* Register encoding, shifted right */ + u8 fan[3]; /* Register value */ + u8 fan_preload[3]; /* Register value */ + u8 fan_div[3]; /* Register encoding, shifted right */ u8 alarms; /* Register encoding */ - u8 pwm[2]; /* Register value (bit 7 is enable) */ + u8 pwm[3]; /* Register value (bit 0 is disable) */ }; @@ -200,7 +212,7 @@ static ssize_t set_fan_min(struct device *dev, const char *buf, } data->fan_preload[nr] = 192 - ((983040 + rpmdiv / 2) / rpmdiv); - smsc47m1_write_value(client, SMSC47M1_REG_FAN_PRELOAD(nr), + smsc47m1_write_value(client, SMSC47M1_REG_FAN_PRELOAD[nr], data->fan_preload[nr]); mutex_unlock(&data->update_lock); @@ -234,15 +246,26 @@ static ssize_t set_fan_div(struct device *dev, const char *buf, return -EINVAL; } - tmp = smsc47m1_read_value(client, SMSC47M1_REG_FANDIV) & 0x0F; - tmp |= (data->fan_div[0] << 4) | (data->fan_div[1] << 6); - smsc47m1_write_value(client, SMSC47M1_REG_FANDIV, tmp); + switch (nr) { + case 0: + case 1: + tmp = smsc47m1_read_value(client, SMSC47M1_REG_FANDIV) + & ~(0x03 << (4 + 2 * nr)); + tmp |= data->fan_div[nr] << (4 + 2 * nr); + smsc47m1_write_value(client, SMSC47M1_REG_FANDIV, tmp); + break; + case 2: + tmp = smsc47m1_read_value(client, SMSC47M2_REG_FANDIV3) & 0xCF; + tmp |= data->fan_div[2] << 4; + smsc47m1_write_value(client, SMSC47M2_REG_FANDIV3, tmp); + break; + } /* Preserve fan min */ tmp = 192 - (old_div * (192 - data->fan_preload[nr]) + new_div / 2) / new_div; data->fan_preload[nr] = SENSORS_LIMIT(tmp, 0, 191); - smsc47m1_write_value(client, SMSC47M1_REG_FAN_PRELOAD(nr), + smsc47m1_write_value(client, SMSC47M1_REG_FAN_PRELOAD[nr], data->fan_preload[nr]); mutex_unlock(&data->update_lock); @@ -263,7 +286,7 @@ static ssize_t set_pwm(struct device *dev, const char *buf, mutex_lock(&data->update_lock); data->pwm[nr] &= 0x81; /* Preserve additional bits */ data->pwm[nr] |= PWM_TO_REG(val); - smsc47m1_write_value(client, SMSC47M1_REG_PWM(nr), + smsc47m1_write_value(client, SMSC47M1_REG_PWM[nr], data->pwm[nr]); mutex_unlock(&data->update_lock); @@ -284,7 +307,7 @@ static ssize_t set_pwm_en(struct device *dev, const char *buf, mutex_lock(&data->update_lock); data->pwm[nr] &= 0xFE; /* preserve the other bits */ data->pwm[nr] |= !val; - smsc47m1_write_value(client, SMSC47M1_REG_PWM(nr), + smsc47m1_write_value(client, SMSC47M1_REG_PWM[nr], data->pwm[nr]); mutex_unlock(&data->update_lock); @@ -345,6 +368,7 @@ static DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, \ fan_present(1); fan_present(2); +fan_present(3); static DEVICE_ATTR(alarms, S_IRUGO, get_alarms, NULL); @@ -358,11 +382,16 @@ static struct attribute *smsc47m1_attributes[] = { &dev_attr_fan2_input.attr, &dev_attr_fan2_min.attr, &dev_attr_fan2_div.attr, + &dev_attr_fan3_input.attr, + &dev_attr_fan3_min.attr, + &dev_attr_fan3_div.attr, &dev_attr_pwm1.attr, &dev_attr_pwm1_enable.attr, &dev_attr_pwm2.attr, &dev_attr_pwm2_enable.attr, + &dev_attr_pwm3.attr, + &dev_attr_pwm3_enable.attr, &dev_attr_alarms.attr, NULL @@ -377,7 +406,7 @@ static int __init smsc47m1_find(unsigned short *addr) u8 val; superio_enter(); - val = superio_inb(SUPERIO_REG_DEVID); + devid = superio_inb(SUPERIO_REG_DEVID); /* * SMSC LPC47M10x/LPC47M112/LPC47M13x (device id 0x59), LPC47M14x @@ -386,18 +415,29 @@ static int __init smsc47m1_find(unsigned short *addr) * can do much more besides (device id 0x60). * The LPC47M997 is undocumented, but seems to be compatible with * the LPC47M192, and has the same device id. + * The LPC47M292 (device id 0x6B) is somewhat compatible, but it + * supports a 3rd fan, and the pin configuration registers are + * unfortunately different. */ - if (val == 0x51) + switch (devid) { + case 0x51: printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n"); - else if (val == 0x59) + break; + case 0x59: printk(KERN_INFO "smsc47m1: Found SMSC " "LPC47M10x/LPC47M112/LPC47M13x\n"); - else if (val == 0x5F) + break; + case 0x5F: printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n"); - else if (val == 0x60) + break; + case 0x60: printk(KERN_INFO "smsc47m1: Found SMSC " "LPC47M15x/LPC47M192/LPC47M997\n"); - else { + break; + case 0x6B: + printk(KERN_INFO "smsc47m1: Found SMSC LPC47M292\n"); + break; + default: superio_exit(); return -ENODEV; } @@ -421,7 +461,7 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) struct i2c_client *new_client; struct smsc47m1_data *data; int err = 0; - int fan1, fan2, pwm1, pwm2; + int fan1, fan2, fan3, pwm1, pwm2, pwm3; if (!request_region(address, SMSC_EXTENT, smsc47m1_driver.driver.name)) { dev_err(&adapter->dev, "Region 0x%x already in use!\n", address); @@ -433,6 +473,7 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) goto error_release; } + data->type = devid == 0x6B ? smsc47m2 : smsc47m1; new_client = &data->client; i2c_set_clientdata(new_client, data); new_client->addr = address; @@ -441,20 +482,35 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) new_client->driver = &smsc47m1_driver; new_client->flags = 0; - strlcpy(new_client->name, "smsc47m1", I2C_NAME_SIZE); + strlcpy(new_client->name, + data->type == smsc47m2 ? "smsc47m2" : "smsc47m1", + I2C_NAME_SIZE); mutex_init(&data->update_lock); /* If no function is properly configured, there's no point in actually registering the chip. */ - fan1 = (smsc47m1_read_value(new_client, SMSC47M1_REG_TPIN(0)) & 0x05) - == 0x05; - fan2 = (smsc47m1_read_value(new_client, SMSC47M1_REG_TPIN(1)) & 0x05) - == 0x05; pwm1 = (smsc47m1_read_value(new_client, SMSC47M1_REG_PPIN(0)) & 0x05) == 0x04; pwm2 = (smsc47m1_read_value(new_client, SMSC47M1_REG_PPIN(1)) & 0x05) == 0x04; - if (!(fan1 || fan2 || pwm1 || pwm2)) { + if (data->type == smsc47m2) { + fan1 = (smsc47m1_read_value(new_client, SMSC47M2_REG_TPIN1) + & 0x0d) == 0x09; + fan2 = (smsc47m1_read_value(new_client, SMSC47M2_REG_TPIN2) + & 0x0d) == 0x09; + fan3 = (smsc47m1_read_value(new_client, SMSC47M2_REG_TPIN3) + & 0x0d) == 0x0d; + pwm3 = (smsc47m1_read_value(new_client, SMSC47M2_REG_PPIN3) + & 0x0d) == 0x08; + } else { + fan1 = (smsc47m1_read_value(new_client, SMSC47M1_REG_TPIN(0)) + & 0x05) == 0x05; + fan2 = (smsc47m1_read_value(new_client, SMSC47M1_REG_TPIN(1)) + & 0x05) == 0x05; + fan3 = 0; + pwm3 = 0; + } + if (!(fan1 || fan2 || fan3 || pwm1 || pwm2 || pwm3)) { dev_warn(&adapter->dev, "Device at 0x%x is not configured, " "will not use\n", new_client->addr); err = -ENODEV; @@ -497,6 +553,18 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) dev_dbg(&new_client->dev, "Fan 2 not enabled by hardware, " "skipping\n"); + if (fan3) { + if ((err = device_create_file(&new_client->dev, + &dev_attr_fan3_input)) + || (err = device_create_file(&new_client->dev, + &dev_attr_fan3_min)) + || (err = device_create_file(&new_client->dev, + &dev_attr_fan3_div))) + goto error_remove_files; + } else + dev_dbg(&new_client->dev, "Fan 3 not enabled by hardware, " + "skipping\n"); + if (pwm1) { if ((err = device_create_file(&new_client->dev, &dev_attr_pwm1)) @@ -506,6 +574,7 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) } else dev_dbg(&new_client->dev, "PWM 1 not enabled by hardware, " "skipping\n"); + if (pwm2) { if ((err = device_create_file(&new_client->dev, &dev_attr_pwm2)) @@ -516,6 +585,16 @@ static int smsc47m1_detect(struct i2c_adapter *adapter) dev_dbg(&new_client->dev, "PWM 2 not enabled by hardware, " "skipping\n"); + if (pwm3) { + if ((err = device_create_file(&new_client->dev, + &dev_attr_pwm3)) + || (err = device_create_file(&new_client->dev, + &dev_attr_pwm3_enable))) + goto error_remove_files; + } else + dev_dbg(&new_client->dev, "PWM 3 not enabled by hardware, " + "skipping\n"); + if ((err = device_create_file(&new_client->dev, &dev_attr_alarms))) goto error_remove_files; @@ -580,15 +659,16 @@ static struct smsc47m1_data *smsc47m1_update_device(struct device *dev, mutex_lock(&data->update_lock); if (time_after(jiffies, data->last_updated + HZ + HZ / 2) || init) { - int i; + int i, fan_nr; + fan_nr = data->type == smsc47m2 ? 3 : 2; - for (i = 0; i < 2; i++) { + for (i = 0; i < fan_nr; i++) { data->fan[i] = smsc47m1_read_value(client, - SMSC47M1_REG_FAN(i)); + SMSC47M1_REG_FAN[i]); data->fan_preload[i] = smsc47m1_read_value(client, - SMSC47M1_REG_FAN_PRELOAD(i)); + SMSC47M1_REG_FAN_PRELOAD[i]); data->pwm[i] = smsc47m1_read_value(client, - SMSC47M1_REG_PWM(i)); + SMSC47M1_REG_PWM[i]); } i = smsc47m1_read_value(client, SMSC47M1_REG_FANDIV); @@ -601,6 +681,18 @@ static struct smsc47m1_data *smsc47m1_update_device(struct device *dev, if (data->alarms) smsc47m1_write_value(client, SMSC47M1_REG_ALARM, 0xC0); + if (fan_nr >= 3) { + data->fan_div[2] = (smsc47m1_read_value(client, + SMSC47M2_REG_FANDIV3) >> 4) & 0x03; + data->alarms |= (smsc47m1_read_value(client, + SMSC47M2_REG_ALARM6) & 0x40) >> 4; + /* Clear alarm if needed */ + if (data->alarms & 0x04) + smsc47m1_write_value(client, + SMSC47M2_REG_ALARM6, + 0x40); + } + data->last_updated = jiffies; } -- cgit v1.2.3 From 2dbc514a2ed2b6f71eb6d18671d2c663160788c9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 8 May 2007 17:22:00 +0200 Subject: hwmon: Document the new fan1_target interface file Signed-off-by: Jean Delvare --- Documentation/hwmon/sysfs-interface | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation') diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index d73d2e8c7534..a9a18ad0d17a 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface @@ -152,6 +152,13 @@ fan[1-*]_div Fan divisor. Note that this is actually an internal clock divisor, which affects the measurable speed range, not the read value. +fan[1-*]_target + Desired fan speed + Unit: revolution/min (RPM) + RW + Only makes sense if the chip supports closed-loop fan speed + control based on the measured fan speed. + Also see the Alarms section for status flags associated with fans. -- cgit v1.2.3 From d20620de0c3de622a9d6a841725bafaed6d1aec2 Mon Sep 17 00:00:00 2001 From: Hans-Juergen Koch Date: Tue, 8 May 2007 17:22:00 +0200 Subject: hwmon: New max6650 driver This driver supports the Maxim MAX6650 and MAX6651 fan speed monitoring and control chips. Signed-off-by: Hans J. Koch Signed-off-by: Jean Delvare --- Documentation/hwmon/max6650 | 53 ++++ MAINTAINERS | 6 + drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/max6650.c | 693 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 763 insertions(+) create mode 100644 Documentation/hwmon/max6650 create mode 100644 drivers/hwmon/max6650.c (limited to 'Documentation') diff --git a/Documentation/hwmon/max6650 b/Documentation/hwmon/max6650 new file mode 100644 index 000000000000..8be7beb9e3e8 --- /dev/null +++ b/Documentation/hwmon/max6650 @@ -0,0 +1,53 @@ +Kernel driver max6650 +===================== + +Supported chips: + * Maxim 6650 / 6651 + Prefix: 'max6650' + Addresses scanned: I2C 0x1b, 0x1f, 0x48, 0x4b + Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf + +Authors: + Hans J. Koch + John Morris + Claus Gindhart + +Description +----------- + +This driver implements support for the Maxim 6650/6651 + +The 2 devices are very similar, but the Maxim 6550 has a reduced feature +set, e.g. only one fan-input, instead of 4 for the 6651. + +The driver is not able to distinguish between the 2 devices. + +The driver provides the following sensor accesses in sysfs: + +fan1_input ro fan tachometer speed in RPM +fan2_input ro " +fan3_input ro " +fan4_input ro " +fan1_target rw desired fan speed in RPM (closed loop mode only) +pwm1_enable rw regulator mode, 0=full on, 1=open loop, 2=closed loop +pwm1 rw relative speed (0-255), 255=max. speed. + Used in open loop mode only. +fan1_div rw sets the speed range the inputs can handle. Legal + values are 1, 2, 4, and 8. Use lower values for + faster fans. + +Module parameters +----------------- + +If your board has a BIOS that initializes the MAX6650/6651 correctly, you can +simply load your module without parameters. It won't touch the configuration +registers then. If your board BIOS doesn't initialize the chip, or you want +different settings, you can set the following parameters: + +voltage_12V: 5=5V fan, 12=12V fan, 0=don't change +prescaler: Possible values are 1,2,4,8,16, or 0 for don't change +clock: The clock frequency in Hz of the chip the driver should assume [254000] + +Please have a look at the MAX6650/6651 data sheet and make sure that you fully +understand the meaning of these parameters before you attempt to change them. + diff --git a/MAINTAINERS b/MAINTAINERS index 6d665ac13f99..a328862731c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2304,6 +2304,12 @@ M: vandrove@vc.cvut.cz L: linux-fbdev-devel@lists.sourceforge.net (subscribers-only) S: Maintained +MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER +P: Hans J. Koch +M: hjk@linutronix.de +L: lm-sensors@lm-sensors.org +S: Maintained + MEGARAID SCSI DRIVERS P: Neela Syam Kolli M: Neela.Kolli@engenio.com diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 6362d02b18df..d89bd5eb50ae 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -375,6 +375,16 @@ config SENSORS_MAX1619 This driver can also be built as a module. If so, the module will be called max1619. +config SENSORS_MAX6650 + tristate "Maxim MAX6650 sensor chip" + depends on HWMON && I2C && EXPERIMENTAL + help + If you say yes here you get support for the MAX6650 / MAX6651 + sensor chips. + + This driver can also be built as a module. If so, the module + will be called max6650. + config SENSORS_PC87360 tristate "National Semiconductor PC87360 family" depends on HWMON && I2C && EXPERIMENTAL diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 4165c27a2f25..bbbe86bf5da1 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_SENSORS_LM87) += lm87.o obj-$(CONFIG_SENSORS_LM90) += lm90.o obj-$(CONFIG_SENSORS_LM92) += lm92.o obj-$(CONFIG_SENSORS_MAX1619) += max1619.o +obj-$(CONFIG_SENSORS_MAX6650) += max6650.o obj-$(CONFIG_SENSORS_PC87360) += pc87360.o obj-$(CONFIG_SENSORS_PC87427) += pc87427.o obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c new file mode 100644 index 000000000000..8415664f33c2 --- /dev/null +++ b/drivers/hwmon/max6650.c @@ -0,0 +1,693 @@ +/* + * max6650.c - Part of lm_sensors, Linux kernel modules for hardware + * monitoring. + * + * (C) 2007 by Hans J. Koch + * + * based on code written by John Morris + * Copyright (c) 2003 Spirent Communications + * and Claus Gindhart + * + * This module has only been tested with the MAX6650 chip. It should + * also work with the MAX6651. It does not distinguish max6650 and max6651 + * chips. + * + * Tha datasheet was last seen at: + * + * http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Addresses to scan. There are four disjoint possibilities, by pin config. + */ + +static unsigned short normal_i2c[] = {0x1b, 0x1f, 0x48, 0x4b, I2C_CLIENT_END}; + +/* + * Insmod parameters + */ + +/* fan_voltage: 5=5V fan, 12=12V fan, 0=don't change */ +static int fan_voltage; +/* prescaler: Possible values are 1, 2, 4, 8, 16 or 0 for don't change */ +static int prescaler; +/* clock: The clock frequency of the chip the driver should assume */ +static int clock = 254000; + +module_param(fan_voltage, int, S_IRUGO); +module_param(prescaler, int, S_IRUGO); +module_param(clock, int, S_IRUGO); + +I2C_CLIENT_INSMOD_1(max6650); + +/* + * MAX 6650/6651 registers + */ + +#define MAX6650_REG_SPEED 0x00 +#define MAX6650_REG_CONFIG 0x02 +#define MAX6650_REG_GPIO_DEF 0x04 +#define MAX6650_REG_DAC 0x06 +#define MAX6650_REG_ALARM_EN 0x08 +#define MAX6650_REG_ALARM 0x0A +#define MAX6650_REG_TACH0 0x0C +#define MAX6650_REG_TACH1 0x0E +#define MAX6650_REG_TACH2 0x10 +#define MAX6650_REG_TACH3 0x12 +#define MAX6650_REG_GPIO_STAT 0x14 +#define MAX6650_REG_COUNT 0x16 + +/* + * Config register bits + */ + +#define MAX6650_CFG_V12 0x08 +#define MAX6650_CFG_PRESCALER_MASK 0x07 +#define MAX6650_CFG_PRESCALER_2 0x01 +#define MAX6650_CFG_PRESCALER_4 0x02 +#define MAX6650_CFG_PRESCALER_8 0x03 +#define MAX6650_CFG_PRESCALER_16 0x04 +#define MAX6650_CFG_MODE_MASK 0x30 +#define MAX6650_CFG_MODE_ON 0x00 +#define MAX6650_CFG_MODE_OFF 0x10 +#define MAX6650_CFG_MODE_CLOSED_LOOP 0x20 +#define MAX6650_CFG_MODE_OPEN_LOOP 0x30 +#define MAX6650_COUNT_MASK 0x03 + +/* Minimum and maximum values of the FAN-RPM */ +#define FAN_RPM_MIN 240 +#define FAN_RPM_MAX 30000 + +#define DIV_FROM_REG(reg) (1 << (reg & 7)) + +static int max6650_attach_adapter(struct i2c_adapter *adapter); +static int max6650_detect(struct i2c_adapter *adapter, int address, int kind); +static int max6650_init_client(struct i2c_client *client); +static int max6650_detach_client(struct i2c_client *client); +static struct max6650_data *max6650_update_device(struct device *dev); + +/* + * Driver data (common to all clients) + */ + +static struct i2c_driver max6650_driver = { + .driver = { + .name = "max6650", + }, + .attach_adapter = max6650_attach_adapter, + .detach_client = max6650_detach_client, +}; + +/* + * Client data (each client gets its own) + */ + +struct max6650_data +{ + struct i2c_client client; + struct class_device *class_dev; + struct mutex update_lock; + char valid; /* zero until following fields are valid */ + unsigned long last_updated; /* in jiffies */ + + /* register values */ + u8 speed; + u8 config; + u8 tach[4]; + u8 count; + u8 dac; +}; + +static ssize_t get_fan(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct max6650_data *data = max6650_update_device(dev); + int rpm; + + /* + * Calculation details: + * + * Each tachometer counts over an interval given by the "count" + * register (0.25, 0.5, 1 or 2 seconds). This module assumes + * that the fans produce two pulses per revolution (this seems + * to be the most common). + */ + + rpm = ((data->tach[attr->index] * 120) / DIV_FROM_REG(data->count)); + return sprintf(buf, "%d\n", rpm); +} + +/* + * Set the fan speed to the specified RPM (or read back the RPM setting). + * This works in closed loop mode only. Use pwm1 for open loop speed setting. + * + * The MAX6650/1 will automatically control fan speed when in closed loop + * mode. + * + * Assumptions: + * + * 1) The MAX6650/1 internal 254kHz clock frequency is set correctly. Use + * the clock module parameter if you need to fine tune this. + * + * 2) The prescaler (low three bits of the config register) has already + * been set to an appropriate value. Use the prescaler module parameter + * if your BIOS doesn't initialize the chip properly. + * + * The relevant equations are given on pages 21 and 22 of the datasheet. + * + * From the datasheet, the relevant equation when in regulation is: + * + * [fCLK / (128 x (KTACH + 1))] = 2 x FanSpeed / KSCALE + * + * where: + * + * fCLK is the oscillator frequency (either the 254kHz internal + * oscillator or the externally applied clock) + * + * KTACH is the value in the speed register + * + * FanSpeed is the speed of the fan in rps + * + * KSCALE is the prescaler value (1, 2, 4, 8, or 16) + * + * When reading, we need to solve for FanSpeed. When writing, we need to + * solve for KTACH. + * + * Note: this tachometer is completely separate from the tachometers + * used to measure the fan speeds. Only one fan's speed (fan1) is + * controlled. + */ + +static ssize_t get_target(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct max6650_data *data = max6650_update_device(dev); + int kscale, ktach, rpm; + + /* + * Use the datasheet equation: + * + * FanSpeed = KSCALE x fCLK / [256 x (KTACH + 1)] + * + * then multiply by 60 to give rpm. + */ + + kscale = DIV_FROM_REG(data->config); + ktach = data->speed; + rpm = 60 * kscale * clock / (256 * (ktach + 1)); + return sprintf(buf, "%d\n", rpm); +} + +static ssize_t set_target(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct max6650_data *data = i2c_get_clientdata(client); + int rpm = simple_strtoul(buf, NULL, 10); + int kscale, ktach; + + rpm = SENSORS_LIMIT(rpm, FAN_RPM_MIN, FAN_RPM_MAX); + + /* + * Divide the required speed by 60 to get from rpm to rps, then + * use the datasheet equation: + * + * KTACH = [(fCLK x KSCALE) / (256 x FanSpeed)] - 1 + */ + + mutex_lock(&data->update_lock); + + kscale = DIV_FROM_REG(data->config); + ktach = ((clock * kscale) / (256 * rpm / 60)) - 1; + if (ktach < 0) + ktach = 0; + if (ktach > 255) + ktach = 255; + data->speed = ktach; + + i2c_smbus_write_byte_data(client, MAX6650_REG_SPEED, data->speed); + + mutex_unlock(&data->update_lock); + + return count; +} + +/* + * Get/set the fan speed in open loop mode using pwm1 sysfs file. + * Speed is given as a relative value from 0 to 255, where 255 is maximum + * speed. Note that this is done by writing directly to the chip's DAC, + * it won't change the closed loop speed set by fan1_target. + * Also note that due to rounding errors it is possible that you don't read + * back exactly the value you have set. + */ + +static ssize_t get_pwm(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + int pwm; + struct max6650_data *data = max6650_update_device(dev); + + /* Useful range for dac is 0-180 for 12V fans and 0-76 for 5V fans. + Lower DAC values mean higher speeds. */ + if (data->config & MAX6650_CFG_V12) + pwm = 255 - (255 * (int)data->dac)/180; + else + pwm = 255 - (255 * (int)data->dac)/76; + + if (pwm < 0) + pwm = 0; + + return sprintf(buf, "%d\n", pwm); +} + +static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct max6650_data *data = i2c_get_clientdata(client); + int pwm = simple_strtoul(buf, NULL, 10); + + pwm = SENSORS_LIMIT(pwm, 0, 255); + + mutex_lock(&data->update_lock); + + if (data->config & MAX6650_CFG_V12) + data->dac = 180 - (180 * pwm)/255; + else + data->dac = 76 - (76 * pwm)/255; + + i2c_smbus_write_byte_data(client, MAX6650_REG_DAC, data->dac); + + mutex_unlock(&data->update_lock); + + return count; +} + +/* + * Get/Set controller mode: + * Possible values: + * 0 = Fan always on + * 1 = Open loop, Voltage is set according to speed, not regulated. + * 2 = Closed loop, RPM for all fans regulated by fan1 tachometer + */ + +static ssize_t get_enable(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct max6650_data *data = max6650_update_device(dev); + int mode = (data->config & MAX6650_CFG_MODE_MASK) >> 4; + int sysfs_modes[4] = {0, 1, 2, 1}; + + return sprintf(buf, "%d\n", sysfs_modes[mode]); +} + +static ssize_t set_enable(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct max6650_data *data = i2c_get_clientdata(client); + int mode = simple_strtoul(buf, NULL, 10); + int max6650_modes[3] = {0, 3, 2}; + + if ((mode < 0)||(mode > 2)) { + dev_err(&client->dev, + "illegal value for pwm1_enable (%d)\n", mode); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + + data->config = i2c_smbus_read_byte_data(client, MAX6650_REG_CONFIG); + data->config = (data->config & ~MAX6650_CFG_MODE_MASK) + | (max6650_modes[mode] << 4); + + i2c_smbus_write_byte_data(client, MAX6650_REG_CONFIG, data->config); + + mutex_unlock(&data->update_lock); + + return count; +} + +/* + * Read/write functions for fan1_div sysfs file. The MAX6650 has no such + * divider. We handle this by converting between divider and counttime: + * + * (counttime == k) <==> (divider == 2^k), k = 0, 1, 2, or 3 + * + * Lower values of k allow to connect a faster fan without the risk of + * counter overflow. The price is lower resolution. You can also set counttime + * using the module parameter. Note that the module parameter "prescaler" also + * influences the behaviour. Unfortunately, there's no sysfs attribute + * defined for that. See the data sheet for details. + */ + +static ssize_t get_div(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct max6650_data *data = max6650_update_device(dev); + + return sprintf(buf, "%d\n", DIV_FROM_REG(data->count)); +} + +static ssize_t set_div(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct max6650_data *data = i2c_get_clientdata(client); + int div = simple_strtoul(buf, NULL, 10); + + mutex_lock(&data->update_lock); + switch (div) { + case 1: + data->count = 0; + break; + case 2: + data->count = 1; + break; + case 4: + data->count = 2; + break; + case 8: + data->count = 3; + break; + default: + dev_err(&client->dev, + "illegal value for fan divider (%d)\n", div); + return -EINVAL; + } + + i2c_smbus_write_byte_data(client, MAX6650_REG_COUNT, data->count); + mutex_unlock(&data->update_lock); + + return count; +} + +static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, get_fan, NULL, 0); +static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, get_fan, NULL, 1); +static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, get_fan, NULL, 2); +static SENSOR_DEVICE_ATTR(fan4_input, S_IRUGO, get_fan, NULL, 3); +static DEVICE_ATTR(fan1_target, S_IWUSR | S_IRUGO, get_target, set_target); +static DEVICE_ATTR(fan1_div, S_IWUSR | S_IRUGO, get_div, set_div); +static DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO, get_enable, set_enable); +static DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, get_pwm, set_pwm); + + +static struct attribute *max6650_attrs[] = { + &sensor_dev_attr_fan1_input.dev_attr.attr, + &sensor_dev_attr_fan2_input.dev_attr.attr, + &sensor_dev_attr_fan3_input.dev_attr.attr, + &sensor_dev_attr_fan4_input.dev_attr.attr, + &dev_attr_fan1_target.attr, + &dev_attr_fan1_div.attr, + &dev_attr_pwm1_enable.attr, + &dev_attr_pwm1.attr, + NULL +}; + +static struct attribute_group max6650_attr_grp = { + .attrs = max6650_attrs, +}; + +/* + * Real code + */ + +static int max6650_attach_adapter(struct i2c_adapter *adapter) +{ + if (!(adapter->class & I2C_CLASS_HWMON)) { + dev_dbg(&adapter->dev, + "FATAL: max6650_attach_adapter class HWMON not set\n"); + return 0; + } + + return i2c_probe(adapter, &addr_data, max6650_detect); +} + +/* + * The following function does more than just detection. If detection + * succeeds, it also registers the new chip. + */ + +static int max6650_detect(struct i2c_adapter *adapter, int address, int kind) +{ + struct i2c_client *client; + struct max6650_data *data; + int err = -ENODEV; + + dev_dbg(&adapter->dev, "max6650_detect called, kind = %d\n", kind); + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { + dev_dbg(&adapter->dev, "max6650: I2C bus doesn't support " + "byte read mode, skipping.\n"); + return 0; + } + + if (!(data = kzalloc(sizeof(struct max6650_data), GFP_KERNEL))) { + dev_err(&adapter->dev, "max6650: out of memory.\n"); + return -ENOMEM; + } + + client = &data->client; + i2c_set_clientdata(client, data); + client->addr = address; + client->adapter = adapter; + client->driver = &max6650_driver; + + /* + * Now we do the remaining detection. A negative kind means that + * the driver was loaded with no force parameter (default), so we + * must both detect and identify the chip (actually there is only + * one possible kind of chip for now, max6650). A zero kind means that + * the driver was loaded with the force parameter, the detection + * step shall be skipped. A positive kind means that the driver + * was loaded with the force parameter and a given kind of chip is + * requested, so both the detection and the identification steps + * are skipped. + * + * Currently I can find no way to distinguish between a MAX6650 and + * a MAX6651. This driver has only been tried on the former. + */ + + if ((kind < 0) && + ( (i2c_smbus_read_byte_data(client, MAX6650_REG_CONFIG) & 0xC0) + ||(i2c_smbus_read_byte_data(client, MAX6650_REG_GPIO_STAT) & 0xE0) + ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM_EN) & 0xE0) + ||(i2c_smbus_read_byte_data(client, MAX6650_REG_ALARM) & 0xE0) + ||(i2c_smbus_read_byte_data(client, MAX6650_REG_COUNT) & 0xFC))) { + dev_dbg(&adapter->dev, + "max6650: detection failed at 0x%02x.\n", address); + goto err_free; + } + + dev_info(&adapter->dev, "max6650: chip found at 0x%02x.\n", address); + + strlcpy(client->name, "max6650", I2C_NAME_SIZE); + mutex_init(&data->update_lock); + + if ((err = i2c_attach_client(client))) { + dev_err(&adapter->dev, "max6650: failed to attach client.\n"); + goto err_free; + } + + /* + * Initialize the max6650 chip + */ + if (max6650_init_client(client)) + goto err_detach; + + err = sysfs_create_group(&client->dev.kobj, &max6650_attr_grp); + if (err) + goto err_detach; + + data->class_dev = hwmon_device_register(&client->dev); + if (!IS_ERR(data->class_dev)) + return 0; + + err = PTR_ERR(data->class_dev); + dev_err(&client->dev, "error registering hwmon device.\n"); + sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); +err_detach: + i2c_detach_client(client); +err_free: + kfree(data); + return err; +} + +static int max6650_detach_client(struct i2c_client *client) +{ + struct max6650_data *data = i2c_get_clientdata(client); + int err; + + sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); + hwmon_device_unregister(data->class_dev); + err = i2c_detach_client(client); + if (!err) + kfree(data); + return err; +} + +static int max6650_init_client(struct i2c_client *client) +{ + struct max6650_data *data = i2c_get_clientdata(client); + int config; + int err = -EIO; + + config = i2c_smbus_read_byte_data(client, MAX6650_REG_CONFIG); + + if (config < 0) { + dev_err(&client->dev, "Error reading config, aborting.\n"); + return err; + } + + switch (fan_voltage) { + case 0: + break; + case 5: + config &= ~MAX6650_CFG_V12; + break; + case 12: + config |= MAX6650_CFG_V12; + break; + default: + dev_err(&client->dev, + "illegal value for fan_voltage (%d)\n", + fan_voltage); + } + + dev_info(&client->dev, "Fan voltage is set to %dV.\n", + (config & MAX6650_CFG_V12) ? 12 : 5); + + switch (prescaler) { + case 0: + break; + case 1: + config &= ~MAX6650_CFG_PRESCALER_MASK; + break; + case 2: + config = (config & ~MAX6650_CFG_PRESCALER_MASK) + | MAX6650_CFG_PRESCALER_2; + break; + case 4: + config = (config & ~MAX6650_CFG_PRESCALER_MASK) + | MAX6650_CFG_PRESCALER_4; + break; + case 8: + config = (config & ~MAX6650_CFG_PRESCALER_MASK) + | MAX6650_CFG_PRESCALER_8; + break; + case 16: + config = (config & ~MAX6650_CFG_PRESCALER_MASK) + | MAX6650_CFG_PRESCALER_16; + break; + default: + dev_err(&client->dev, + "illegal value for prescaler (%d)\n", + prescaler); + } + + dev_info(&client->dev, "Prescaler is set to %d.\n", + 1 << (config & MAX6650_CFG_PRESCALER_MASK)); + + /* If mode is set to "full off", we change it to "open loop" and + * set DAC to 255, which has the same effect. We do this because + * there's no "full off" mode defined in hwmon specifcations. + */ + + if ((config & MAX6650_CFG_MODE_MASK) == MAX6650_CFG_MODE_OFF) { + dev_dbg(&client->dev, "Change mode to open loop, full off.\n"); + config = (config & ~MAX6650_CFG_MODE_MASK) + | MAX6650_CFG_MODE_OPEN_LOOP; + if (i2c_smbus_write_byte_data(client, MAX6650_REG_DAC, 255)) { + dev_err(&client->dev, "DAC write error, aborting.\n"); + return err; + } + } + + if (i2c_smbus_write_byte_data(client, MAX6650_REG_CONFIG, config)) { + dev_err(&client->dev, "Config write error, aborting.\n"); + return err; + } + + data->config = config; + data->count = i2c_smbus_read_byte_data(client, MAX6650_REG_COUNT); + + return 0; +} + +static const u8 tach_reg[] = { + MAX6650_REG_TACH0, + MAX6650_REG_TACH1, + MAX6650_REG_TACH2, + MAX6650_REG_TACH3, +}; + +static struct max6650_data *max6650_update_device(struct device *dev) +{ + int i; + struct i2c_client *client = to_i2c_client(dev); + struct max6650_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { + data->speed = i2c_smbus_read_byte_data(client, + MAX6650_REG_SPEED); + data->config = i2c_smbus_read_byte_data(client, + MAX6650_REG_CONFIG); + for (i = 0; i < 4; i++) { + data->tach[i] = i2c_smbus_read_byte_data(client, + tach_reg[i]); + } + data->count = i2c_smbus_read_byte_data(client, + MAX6650_REG_COUNT); + data->dac = i2c_smbus_read_byte_data(client, MAX6650_REG_DAC); + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +static int __init sensors_max6650_init(void) +{ + return i2c_add_driver(&max6650_driver); +} + +static void __exit sensors_max6650_exit(void) +{ + i2c_del_driver(&max6650_driver); +} + +MODULE_AUTHOR("Hans J. Koch"); +MODULE_DESCRIPTION("MAX6650 sensor driver"); +MODULE_LICENSE("GPL"); + +module_init(sensors_max6650_init); +module_exit(sensors_max6650_exit); -- cgit v1.2.3 From d58ee056cc40117afe4d3bb03006ac537d779634 Mon Sep 17 00:00:00 2001 From: Rudolf Marek Date: Tue, 8 May 2007 17:22:02 +0200 Subject: hwmon/coretemp: Add documentation Documentation for the coretemp driver. Signed-off-by: Rudolf Marek Signed-off-by: Jean Delvare --- Documentation/hwmon/coretemp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/hwmon/coretemp (limited to 'Documentation') diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp new file mode 100644 index 000000000000..870cda9416e9 --- /dev/null +++ b/Documentation/hwmon/coretemp @@ -0,0 +1,36 @@ +Kernel driver coretemp +====================== + +Supported chips: + * All Intel Core family + Prefix: 'coretemp' + CPUID: family 0x6, models 0xe, 0xf + Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual + Volume 3A: System Programming Guide + +Author: Rudolf Marek + +Description +----------- + +This driver permits reading temperature sensor embedded inside Intel Core CPU. +Temperature is measured in degrees Celsius and measurement resolution is +1 degree C. Valid temperatures are from 0 to TjMax degrees C, because +the actual value of temperature register is in fact a delta from TjMax. + +Temperature known as TjMax is the maximum junction temperature of processor. +Intel defines this temperature as 85C or 100C. At this temperature, protection +mechanism will perform actions to forcibly cool down the processor. Alarm +may be raised, if the temperature grows enough (more than TjMax) to trigger +the Out-Of-Spec bit. Following table summarizes the exported sysfs files: + +temp1_input - Core temperature (in millidegrees Celsius). +temp1_crit - Maximum junction temperature (in millidegrees Celsius). +temp1_crit_alarm - Set when Out-of-spec bit is set, never clears. + Correct CPU operation is no longer guaranteed. +temp1_label - Contains string "Core X", where X is processor + number. + +The TjMax temperature is set to 85 degrees C if undocumented model specific +register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as +(sometimes) documented in processor datasheet. -- cgit v1.2.3