added ds1780 recognition/support. untested.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@349 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker committed 1999-03-29 00:58:55 +00:00
1 parent ddfb8235ca
commit 1067bc4d69
3 files changed
+55 -24

No files matched your search

+21 -9
View File
@@ -1,3 +1,13 @@
adm9240 driver
--------------
Supports the Analog Devices ADM9240 and the Dallas Semiconductor DS1780.
These chips are apparently identical except for the manufacturer ID
register.
The proc directory will be adm9240-i2c-x-xx for the adm9240 and
ds1780-i2c-x-xx for the ds1780.
-----------------------------------------------------------------------
This file documents the adm9240 directories for the Analog Devices
ADM9240 hardware health monitoring chip found on some Intel mainboards
(and others?).
@@ -51,7 +61,7 @@ Within each ADM9240 directory, you can find the following files:
third not.
If accessed through sysctl, this is a list of longs.
* 2.5V, Vccp1, 3.3V, 5V, 12V, and Vccp2 (ADM9240_SYSCTL_IN[0-5] in the
order shown)
order shown)
A list of three numbers. The first is the minimum limit, the second is the
maximum limit, and the third is the current value. Note that
minimum means 'closest to zero'; so if the normal value equals -10, a
@@ -64,18 +74,18 @@ order shown)
times 100.
* temp
A list of three numbers. The first number is the Overtemperature Shutdown
value; the second is the Hysteris value and the third number is the
value; the second is the Hysteresis value and the third number is the
current value. The first two values can be modified. All values are in
degrees Celcius. An alarm is issued when the temperature first gets above
degrees Celsius. An alarm is issued when the temperature first gets above
the Overtemperature Shutdown value; no more alarms are issued until the
temperature gets below the Hysteris value, at which moment another alarm
temperature gets below the Hysteresis value, at which moment another alarm
is issued, and the state is reset. A more useful behaviour can be found
by setting the Hysteris value to +127 degrees Celcius; in this case,
by setting the Hysteresis value to +127 degrees Celsius; in this case,
alarms are issued during all the time when the actual temperature is
above the Overtemperature Shutdown value.
The first two numbers can be changed, the third not.
If accessed through sysctl, this is a list of longs, each being the
temperature in degrees Celcius times 10.
temperature in degrees Celsius times 10.
* vid
The core voltage value (the voltage level your processor should work with),
in volts. This is the value IN0 and IN1 are initialized to. If unconnected,
@@ -86,11 +96,11 @@ order shown)
This is feature is specific to the ADM9240. It is a DAC voltage
control register for the Analog-Out pin. Valid values are from 255
to 0 (with 255 being the highest voltage, and 0 the lowest). From
the docs: "TheADM9240 has a single analog output from an unsigned
the docs: "The ADM9240 has a single analog output from an unsigned
8-bit DAC which produces 0 V - 1.25 V."
The data for each ADM9240 is updated each 1.5 seconds, but only if it is actually
read.
The data for each ADM9240 is updated each 1.5 seconds,
but only if it is actually read.
Note: Much of this documentation is copied from the LM78 documenation
(the device from which most featuers of the ADM9240 is modelled from).
@@ -98,3 +108,5 @@ The maintainer of the ADM9240 is Philip Edelbrock
<phil@netroedge.com>; please forward corrections, suggestions, etc.
to him. For further technical information on this chip, I suggest
getting the Acrobat PDF documentation from www.analog.com.
Dallas documentation is at http://www.dalsemi.com.
+18 -9
View File
@@ -20,7 +20,7 @@
*/
/*
A couple notes about the ADM2940:
A couple notes about the ADM9240:
* It claims to be 'LM7x' register compatible. This must be in reference
to only the LM78, because it is missing stuff to emulate LM75's as well.
@@ -79,7 +79,7 @@
#define ADM9240_REG_TEMP 0x27
#define ADM9240_REG_FAN1 0x28
#define ADM9240_REG_FAN2 0x29
#define ADM9240_REG_COMPANY_ID 0x3E /* Should always read 0x23 */
#define ADM9240_REG_COMPANY_ID 0x3E /* 0x23 for ADM9240; 0xDA for DS1780 */
#define ADM9240_REG_DIE_REV 0x3F
/* These are read/write */
#define ADM9240_REG_2_5V_HIGH 0x2B
@@ -319,13 +319,13 @@ int adm9240_attach_adapter(struct i2c_adapter *adapter)
{
int address,err,temp;
struct i2c_client *new_client;
const char *type_name,*client_name;
char *type_name,*client_name;
err = 0;
/* Make sure we aren't probing the ISA bus!! */
if (i2c_is_isa_adapter(adapter)) return 0;
/* The address of the ADM2940 must at least start somewhere in
/* The address of the ADM9240 must at least start somewhere in
0x2C to 0x2F, but can be changed to be anyelse after that.
(But, why??) */
for (address = 0x2C; (! err) && (address <= 0x2f); address ++) {
@@ -333,13 +333,22 @@ int adm9240_attach_adapter(struct i2c_adapter *adapter)
/* Later on, we will keep a list of registered addresses for each
adapter, and check whether they are used here */
if (smbus_read_byte_data(adapter,address,ADM9240_REG_COMPANY_ID) != 0x23)
temp = smbus_read_byte_data(adapter,address,ADM9240_REG_COMPANY_ID);
if (temp == 0x23) {
type_name = "adm9240";
client_name = "ADM9240 chip";
} else if (temp == 0xDA)
type_name = "ds1780";
client_name = "DS1780 chip";
}
if (temp == 0x23 || temp == 0xDA) {
temp=smbus_read_byte_data(adapter,address,ADM9240_REG_DIE_REV);
printk("adm9240.o: %s detected with die rev.: 0x%X\n",
client_name, temp);
}
else
continue;
temp=smbus_read_byte_data(adapter,address,ADM9240_REG_DIE_REV);
printk("adm9240.o: ADM9240 detected with die rev.: 0x%X\n",temp);
type_name = "adm9240";
client_name = "ADM9240 chip";
/* Allocate space for a new client structure. To counter memory
+16 -6
View File
@@ -199,7 +199,13 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
name => "Analog Devices ADM9240",
driver => "adm9240",
i2c_addrs => [0x2c..0x2f],
i2c_detect => sub { adm9240_detect @_ }
i2c_detect => sub { adm9240_detect 0, @_ }
},
{
name => "Dallas Semiconductor DS1780",
driver => "adm9240",
i2c_addrs => [0x2c..0x2f],
i2c_detect => sub { adm9240_detect 1, @_ }
},
{
name => "Analog Devices ADM1021",
@@ -1275,10 +1281,11 @@ sub gl520sm_detect
return (5);
}
# $_[0]: A reference to the file descriptor to access this chip.
# $_[0]: Chip to detect (0 = ADM9240, 1 = DS1780)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.
# $_[1]: Address
# Returns: undef if not detected, (5) if detected.
# $_[2]: Address
# Returns: undef if not detected, (8) if detected.
# Registers used:
# 0x3e: Company ID
# 0x40: Configuration
@@ -1286,8 +1293,11 @@ sub gl520sm_detect
# Note: Detection overrules a previous LM78 detection
sub adm9240_detect
{
my ($file,$addr) = @_;
return unless i2c_smbus_read_byte_data($file,0x3e) == 0x23;
my $reg;
my ($chip, $file,$addr) = @_;
$reg = i2c_smbus_read_byte_data($file,0x3e);
return unless ($chip == 0 and $reg == 0x23) or
($chip == 1 and $reg == 0xda);
return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00;
return unless i2c_smbus_read_byte_data($file,0x48) == $addr;