diff --git a/doc/chips/lm90 b/doc/chips/lm90 index 2329598f..5166f7e1 100644 --- a/doc/chips/lm90 +++ b/doc/chips/lm90 @@ -1,7 +1,7 @@ Kernel driver `lm90.o' ===================== -Status: Complete but untested +Status: Complete and reasonably tested Supported chips: * National Semiconductor LM90 @@ -9,6 +9,11 @@ Supported chips: Addresses scanned: I2C 0x4c Datasheet: Publicly available at the National Semiconductor website http://www.national.com/pf/LM/LM90.html + * Analog Devices ADM1032 + Prefix: `adm1032' + Addresses scanned: I2C 0x4c + Datasheet: Publicly available at the Analog Devices website + http://products.analog.com/products/info.asp?product=ADM1032 Author: Jean Delvare @@ -24,6 +29,9 @@ Module Parameters * force_lm90: short array (min = 1, max = 48) List of adapter,address pairs which are unquestionably assumed to contain a `lm90' chip +* force_adm1032: short array (min = 1, max = 48) + List of adapter,address pairs which are unquestionably assumed to contain + a `adm1032' chip * probe: short array (min = 1, max = 48) List of adapter,address pairs to scan additionally * probe_range: short array (min = 1, max = 48) @@ -40,30 +48,33 @@ Description The LM90 is a digital temperature sensor. It senses its own temperature as well as the temperature of up to one external diode. It is compatible with many other devices such as the LM86, the LM89, the ADM1032, the -MAX6657 and the MAX6658. The particularity of the LM90 over the LM84 for -example is that it features critical limits with hysteresis, and an +MAX6657 and the MAX6658. Of these, only the ADM1032 is officially +supported for now, but the others can probably be successfully forced. + +The specificity of this family of chipsets over the ADM1021/LM84 +family is that it features critical limits with hysteresis, and an increased resolution of the remote temperature measurement. -Using the adm1021 or lm83 drivers for a LM90 should work, but the extra -features won't be supported. +The different chipsets of the family are not stricly identical, although +very similar. This driver doesn't handle any specific feature for now, +but could if there ever was a need for it. For reference, here comes a +non-exhaustive list of specific features: -The LM90 is found on many motherboards, too many for an exhaustive listing. -A list of confirmed motherboards follows. If you think the list is wrong or -want to add a specific motherboard to it, contact us. +LM90: + * Filter and alert configuration register at 0xBF. + * ALERT is triggered by temperatures over critical limits. -Confirmed motherboards: - Gigabyte GA-7VAX - Gigabyte GA-7VRXP +ADM1032: + * Consecutive alert register at 0x22. + * Conversion averaging. + * Up to 64 conversions/s. + * ALERT is triggered by open remote sensor. -The driver is untested so far. We want testers! Let us know if you want to -help. - -All temperature values are given in degrees Celcius. Local and remote -temperatures are given within a range of +25 to +125 degrees. Resolution +All temperature values are given in degrees Celcius. Resolution is 1.0 degree for the local temperature, 0.125 degree for the remote -temperature. Accuracy is guaranteed to 4.0 degrees, but should reach -1.5 degree (local) and 3.0 degrees (remote) under typical conditions (see -the datasheet for more details). +temperature. According to the datasheets, the ADM1032 has a better +range and accuracy than the LM90 (but is also way more expensive). +See the datasheets for details. Each sensor has its own high and low limits, plus a critical limit. Additionally, there is a relative hysteresis value common to both critical @@ -102,3 +113,29 @@ tcrit1 SENSORS_LM90_LOCAL_TCRIT tcrit1:1 tcrit2 SENSORS_LM90_REMOTE_TCRIT tcrit2:1 hyst SENSORS_LM90_TCRIT_HYST hyst:1 alarms SENSORS_LM90_ALARMS alarms:1 + +Chip 'adm1032' + +LABEL LABEL CLASS COMPUTE CLASS MODE MAGN +temp1 - - R- 0 +temp1_high temp1 temp1 RW 0 +temp1_low temp1 temp1 RW 0 +temp2 - - R- 1 +temp2_high temp2 temp2 RW 1 +temp2_low temp2 temp2 RW 1 +tcrit1 temp1 temp1 RW 0 +tcrit2 temp2 temp2 RW 0 +hyst - - RW 0 +alarms - - R- 0 + +LABEL FEATURE SYMBOL SYSCTL FILE:N +temp1 SENSORS_LM90_LOCAL_TEMP temp1:3 +temp1_high SENSORS_LM90_LOCAL_HIGH temp1:1 +temp1_low SENSORS_LM90_LOCAL_LOW temp1:2 +temp2 SENSORS_LM90_REMOTE_TEMP temp2:3 +temp2_high SENSORS_LM90_REMOTE_HIGH temp2:1 +temp2_low SENSORS_LM90_REMOTE_LOW temp2:2 +tcrit1 SENSORS_LM90_LOCAL_TCRIT tcrit1:1 +tcrit2 SENSORS_LM90_REMOTE_TCRIT tcrit2:1 +hyst SENSORS_LM90_TCRIT_HYST hyst:1 +alarms SENSORS_LM90_ALARMS alarms:1 diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index 0baa9d33..85e5b04b 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -1521,10 +1521,12 @@ chip "lm83-*" # should be higher than each of the high limits above # set tcrit 85 -chip "lm90-*" +chip "lm90-*" "adm1032-*" label temp1 "M/B Temp" label temp2 "CPU Temp" + label tcrit1 "M/B Crit" + label tcrit2 "CPU Crit" # change high and low limits to fit your needs # set temp1_low 10 diff --git a/kernel/chips/lm90.c b/kernel/chips/lm90.c index c2bd1ffe..daf10e9f 100644 --- a/kernel/chips/lm90.c +++ b/kernel/chips/lm90.c @@ -10,6 +10,16 @@ * obtained from National's website at: * http://www.national.com/pf/LM/LM90.html * + * This driver also supports the ADM1032, a sensor chip made by Analog + * Devices. That chip is similar to the LM90, with a few differences + * that are not handled by this driver. Complete datasheet can be + * obtained from Analog's website at: + * http://products.analog.com/products/info.asp?product=ADM1032 + * + * Since the LM90 was the first chipset supported by this driver, most + * comments will refer to this chipset, but are actually general and + * concern all supported chipsets, unless mentioned otherwise. + * * 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 @@ -46,11 +56,10 @@ static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; * Insmod parameters */ -SENSORS_INSMOD_1(lm90); +SENSORS_INSMOD_2(lm90, adm1032); /* * The LM90 registers - * Manufacturer ID is 0x01 for National Semiconductor. */ #define LM90_REG_R_MAN_ID 0xFE @@ -137,7 +146,7 @@ static void lm90_alarms(struct i2c_client *client, int operation, static struct i2c_driver lm90_driver = { .owner = THIS_MODULE, - .name = "LM90 sensor driver", + .name = "LM90/ADM1032 sensor driver", .id = I2C_DRIVERID_LM90, .flags = I2C_DF_NOTIFY, .attach_adapter = lm90_attach_adapter, @@ -234,6 +243,7 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int err = 0; const char *type_name = ""; const char *client_name = ""; + u8 reg_config1, reg_convrate; #ifdef DEBUG if (i2c_is_isa_adapter(adapter)) @@ -274,8 +284,7 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, /* * 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, LM90). A zero kind means that + * must both detect and identify the chip. 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 @@ -283,17 +292,17 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, * are skipped. */ + reg_config1 = i2c_smbus_read_byte_data(new_client, + LM90_REG_R_CONFIG1); + reg_convrate = i2c_smbus_read_byte_data(new_client, + LM90_REG_R_CONVRATE); if (kind < 0) /* detection */ { - if (((i2c_smbus_read_byte_data(new_client, LM90_REG_R_CONFIG1) - & 0x2A) != 0x00) - || (i2c_smbus_read_byte_data(new_client, LM90_REG_R_CONVRATE) - > 9) - || ((i2c_smbus_read_byte_data(new_client, LM90_REG_R_CONFIG2) - & 0xF8) != 0x00)) + if ((reg_config1 & 0x2A) != 0x00 + || reg_convrate > 0x0A) { #ifdef DEBUG - printk("lm90.o: LM90 detection failed at 0x%02x.\n", + printk("lm90.o: Detection failed at 0x%02x.\n", address); #endif goto ERROR1; @@ -308,9 +317,18 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, chip_id = i2c_smbus_read_byte_data(new_client, LM90_REG_R_CHIP_ID); if (man_id == 0x01) /* National Semiconductor */ { - if (chip_id >= 0x21 && chip_id < 0x30) + if (chip_id >= 0x21 && chip_id < 0x30 /* LM90 */ + && i2c_smbus_read_byte_data(new_client, + LM90_REG_R_CONFIG2 & 0xF8) == 0x00 + && reg_convrate <= 0x09) kind = lm90; } + else if (man_id == 0x41) /* Analog Devices */ + { + if ((chip_id & 0xF0) == 0x40 /* ADM1032 */ + && (reg_config1 & 0x3F) == 0x00) + kind = adm1032; + } } if (kind <= 0) /* identification failed */ @@ -324,6 +342,11 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, type_name = "lm90"; client_name = "LM90 chip"; } + else if (kind == adm1032) + { + type_name = "adm1032"; + client_name = "ADM1032 chip"; + } else { printk("lm90.o: Unknown kind %d.\n", kind); @@ -447,7 +470,7 @@ static void lm90_update_client(struct i2c_client *client) { u8 oldh, newh; #ifdef DEBUG - printk("lm90.o: Updating LM90 data.\n"); + printk("lm90.o: Updating data.\n"); #endif data->local_temp = @@ -680,7 +703,7 @@ static void __exit sm_lm90_exit(void) } MODULE_AUTHOR("Jean Delvare "); -MODULE_DESCRIPTION("LM90 sensor driver"); +MODULE_DESCRIPTION("LM90/ADM1032 sensor driver"); MODULE_LICENSE("GPL"); module_init(sm_lm90_init); diff --git a/lib/chips.c b/lib/chips.c index 56487342..62c163d3 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -4821,6 +4821,7 @@ sensors_chip_features sensors_chip_features_list[] = { SENSORS_ADT7463_PREFIX, adm1027_features }, { SENSORS_LM83_PREFIX, lm83_features }, { SENSORS_LM90_PREFIX, lm90_features }, + { SENSORS_ADM1032_PREFIX, lm90_features }, { SENSORS_XEONTEMP_PREFIX, xeontemp_features }, { SENSORS_MAX6650_PREFIX, max6650_features }, { 0 } diff --git a/lib/chips.h b/lib/chips.h index ad92b86d..1388b61f 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -443,9 +443,10 @@ #define SENSORS_LM85_ZONE3_RANGE 100 /* RW -- zone3_range */ #define SENSORS_LM85_ZONE3_SMOOTH 101 /* RW -- zone3_smooth */ -/* LM90 chips */ +/* LM90/ADM1032 chips */ #define SENSORS_LM90_PREFIX "lm90" +#define SENSORS_ADM1032_PREFIX "adm1032" #define SENSORS_LM90_LOCAL_TEMP 51 /* R */ #define SENSORS_LM90_LOCAL_HIGH 52 /* RW */ diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 6f8dbd6e..c56bbb76 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1131,7 +1131,7 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect }, { name => "Analog Devices ADM1032", - driver => "to-be-written", + driver => "lm90", i2c_addrs => [0x4c], i2c_detect => sub { lm90_detect 3, @_ }, }, diff --git a/prog/sensors/main.c b/prog/sensors/main.c index c8e16ead..e8e9cb99 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -379,7 +379,8 @@ void do_a_print(sensors_chip_name name) print_adm1026(&name); else if (!strcmp(name.prefix,"lm83")) print_lm83(&name); - else if (!strcmp(name.prefix,"lm90")) + else if (!strcmp(name.prefix,"lm90") + || !strcmp(name.prefix,"adm1032")) print_lm90(&name); else if (!strcmp(name.prefix,"xeontemp")) print_xeontemp(&name);