summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2006-06-23 13:16:09 +0000
committerJean Delvare <khali@linux-fr.org>2006-06-23 13:16:09 +0000
commitc7ce94770a7397efa2a0720058500c3c6e59f976 (patch)
tree39468fff4cc0fa83cc6a8557ba001809f67544c7
parentb78bf75922ded944c3756f3e774b5bb0ae5323ef (diff)
downloadlm-sensors-git-c7ce94770a7397efa2a0720058500c3c6e59f976.tar.gz
lm83: Add LM82 support (2.6 backport)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4048 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r--CHANGES1
-rw-r--r--README2
-rw-r--r--doc/chips/SUMMARY1
-rw-r--r--doc/chips/lm8316
-rw-r--r--kernel/chips/lm83.c32
-rw-r--r--mkpatch/Config.in2
-rwxr-xr-xmkpatch/mkpatch.pl4
7 files changed, 47 insertions, 11 deletions
diff --git a/CHANGES b/CHANGES
index dd5b13ea..812aeb2d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,7 @@ lm_sensors CHANGES file
Add ICH8 support (2.6 backport)
Module i2c-piix4: Add ServerWorks HT-1000 support (2.6 backport)
Module i2c-viapro: Fix compilation with kernels < 2.4.21
+ Module lm83: Add LM82 support (2.6 backport)
Module w83781d: Use real-time alarm registers when possible (2.6 backport)
Module w83792d: Fix PWM range (2.6 backport)
Program decode-dimms.pl: Decode depending on the memory type
diff --git a/README b/README
index 39fc868a..d80d3085 100644
--- a/README
+++ b/README
@@ -88,7 +88,7 @@ At least the following hardware sensor chips are supported:
Microchip TC1068, TCM1617, TCN75
Myson MTP008
National Semiconductor LM63, LM75, LM76, LM78, LM78-J, LM79,
- LM80, LM81, LM83, LM84, LM85, LM86, LM87,
+ LM80, LM81, LM82, LM83, LM84, LM85, LM86, LM87,
LM89, LM90, LM92, LM93, LM99, PC87360,
PC87363, PC87364, PC87365, PC87366
Philips NE1617, NE1617A, NE1619
diff --git a/doc/chips/SUMMARY b/doc/chips/SUMMARY
index d0fd4294..9d1b337b 100644
--- a/doc/chips/SUMMARY
+++ b/doc/chips/SUMMARY
@@ -144,6 +144,7 @@ lm80
lm83
lm83 4 - - - yes no
+ lm82 2 - - - yes no
lm85
lm85 3 5 4 3 pwm yes no
diff --git a/doc/chips/lm83 b/doc/chips/lm83
index e015fa67..b0af59bd 100644
--- a/doc/chips/lm83
+++ b/doc/chips/lm83
@@ -9,6 +9,10 @@ Supported chips:
Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
Datasheet: Publicly available at the National Semiconductor website
http://www.national.com/pf/LM/LM83.html
+ * National Semiconductor LM82
+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+ Datasheet: Publicly available at the National Semiconductor website
+ http://www.national.com/pf/LM/LM82.html
Author: Jean Delvare <khali@linux-fr.org>
@@ -38,10 +42,11 @@ Description
-----------
The LM83 is a digital temperature sensor. It senses its own temperature as
-well as the temperature of up to three external diodes. It is compatible
-with many other devices such as the LM84 and all other ADM1021 clones.
-The main difference between the LM83 and the LM84 in that the later can
-only sense the temperature of one external diode.
+well as the temperature of up to three external diodes. The LM82 is
+a stripped down version of the LM83 that only supports one external diode.
+Both are compatible with many other devices such as the LM84 and all
+other ADM1021 clones. The main difference between the LM83 and the LM84
+in that the later can only sense the temperature of one external diode.
Using the adm1021 driver for a LM83 should work, but only two temperatures
will be reported instead of four.
@@ -59,6 +64,9 @@ Unconfirmed motherboards:
Iwill MPX2
Soltek SL-75DRV5
+The LM82 is confirmed to have been found on most AMD Geode reference
+designs and test platforms.
+
The driver has been successfully tested by Magnus Forsström, who I'd
like to thank here. More testers will be of course welcome.
diff --git a/kernel/chips/lm83.c b/kernel/chips/lm83.c
index 9aa27975..d58d5c9d 100644
--- a/kernel/chips/lm83.c
+++ b/kernel/chips/lm83.c
@@ -12,6 +12,10 @@
* Since the datasheet omits to give the chip stepping code, I give it
* here: 0x03 (at register 0xff).
*
+ * Also supports the LM82 temp sensor, which is basically a stripped down
+ * model of the LM83. Datasheet is here:
+ * http://www.national.com/pf/LM/LM82.html
+ *
* 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
@@ -50,7 +54,7 @@ static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
* Insmod parameters
*/
-SENSORS_INSMOD_1(lm83);
+SENSORS_INSMOD_2(lm83, lm82);
/*
* The LM83 registers
@@ -200,6 +204,19 @@ static ctl_table lm83_dir_table_template[] =
{0}
};
+static ctl_table lm82_dir_table_template[] =
+{
+ {LM83_SYSCTL_LOCAL_TEMP, "temp1", NULL, 0, 0644, NULL,
+ &i2c_proc_real, &i2c_sysctl_real, NULL, &lm83_temp},
+ {LM83_SYSCTL_REMOTE2_TEMP, "temp3", NULL, 0, 0644, NULL,
+ &i2c_proc_real, &i2c_sysctl_real, NULL, &lm83_temp},
+ {LM83_SYSCTL_TCRIT, "tcrit", NULL, 0, 0644, NULL,
+ &i2c_proc_real, &i2c_sysctl_real, NULL, &lm83_tcrit},
+ {LM83_SYSCTL_ALARMS, "alarms", NULL, 0, 0444, NULL,
+ &i2c_proc_real, &i2c_sysctl_real, NULL, &lm83_alarms},
+ {0}
+};
+
/*
* Real code
*/
@@ -301,6 +318,8 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, unsigned
{
if (chip_id == 0x03)
kind = lm83;
+ else if (chip_id == 0x01)
+ kind = lm82;
}
}
@@ -315,6 +334,11 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, unsigned
type_name = "lm83";
client_name = "LM83 chip";
}
+ else if (kind == lm82)
+ {
+ type_name = "lm82";
+ client_name = "LM82 chip";
+ }
else
{
printk("lm83.o: Unknown kind %d.\n", kind);
@@ -346,8 +370,10 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, unsigned
* Register a new directory entry.
*/
- if ((err = i2c_register_entry(new_client, type_name,
- lm83_dir_table_template, THIS_MODULE)) < 0)
+ if ((kind == lm83 && (err = i2c_register_entry(new_client, type_name,
+ lm83_dir_table_template, THIS_MODULE)) < 0) ||
+ (kind == lm82 && (err = i2c_register_entry(new_client, type_name,
+ lm82_dir_table_template, THIS_MODULE)) < 0))
{
#ifdef DEBUG
printk("lm83.o: Failed registering directory entry.\n");
diff --git a/mkpatch/Config.in b/mkpatch/Config.in
index a68449eb..3f11a043 100644
--- a/mkpatch/Config.in
+++ b/mkpatch/Config.in
@@ -36,7 +36,7 @@ if [ "$CONFIG_I2C_PROC" = "m" -o "$CONFIG_I2C_PROC" = "y" ] ; then
dep_tristate ' National Semiconductor LM75 and compatibles' CONFIG_SENSORS_LM75 $CONFIG_I2C $CONFIG_I2C_PROC
dep_tristate ' National Semiconductor LM78' CONFIG_SENSORS_LM78 $CONFIG_I2C $CONFIG_I2C_PROC
dep_tristate ' National Semiconductor LM80' CONFIG_SENSORS_LM80 $CONFIG_I2C $CONFIG_I2C_PROC
- dep_tristate ' National Semiconductor LM83' CONFIG_SENSORS_LM83 $CONFIG_I2C $CONFIG_I2C_PROC
+ dep_tristate ' National Semiconductor LM83 and compatibles' CONFIG_SENSORS_LM83 $CONFIG_I2C $CONFIG_I2C_PROC
dep_tristate ' National Semiconductor LM85, Analog Devices ADM1027' CONFIG_SENSORS_LM85 $CONFIG_I2C $CONFIG_I2C_PROC
dep_tristate ' National Semiconductor LM87' CONFIG_SENSORS_LM87 $CONFIG_I2C $CONFIG_I2C_PROC
dep_tristate ' National Semiconductor LM90 and compatibles' CONFIG_SENSORS_LM90 $CONFIG_I2C $CONFIG_I2C_PROC
diff --git a/mkpatch/mkpatch.pl b/mkpatch/mkpatch.pl
index 9049d211..5104ae18 100755
--- a/mkpatch/mkpatch.pl
+++ b/mkpatch/mkpatch.pl
@@ -538,10 +538,10 @@ CONFIG_SENSORS_LM80
in the lm_sensors package, which you can download at
http://www.lm-sensors.nu/
-National Semiconductor LM83
+National Semiconductor LM83 and compatibles
CONFIG_SENSORS_LM83
If you say yes here you get support for the National Semiconductor
- LM83 sensor chip. This can also be built as a module.
+ LM82 and LM83 sensor chips. This can also be built as a module.
You will also need the latest user-space utilities: you can find
them in the lm_sensors package, which you can download at