From 02081818062641c2af73efb62d9280131fe22a1b Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sun, 22 Aug 1999 22:58:52 +0000 Subject: [PATCH] (mds) add support for TI THMC10 to the adm1021 driver. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@533 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CONTRIBUTORS | 2 +- README | 1 + doc/chips/SUMMARY | 5 ++++- doc/chips/adm1021 | 30 +++++++++++++++++++++++++++++- kernel/chips/adm1021.c | 11 ++++++++--- prog/detect/sensors-detect | 9 ++++++++- prog/sensors/main.c | 2 +- 7 files changed, 52 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f3c81729..d4b153c0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -25,7 +25,7 @@ problems. * Mark D. Studebaker Author of the i2c-ali15x3 bus driver and the i2c-i810 bus driver. Added w83782d, w83783s, and w83627hf support to the w83781d driver. - Added max1617 support to the adm1021 driver. + Added max1617 and thmc10 support to the adm1021 driver. Added lm81 support to the adm9240 driver. Author of the decode-xeon.pl xeon EEPROM decoder. * Geert Uytterhoeven diff --git a/README b/README index 2a58602a..f0ace59a 100644 --- a/README +++ b/README @@ -38,6 +38,7 @@ At least the following hardware sensor chips are supported: Dallas Semiconductor DS1780 Hewlett Packard Maxilife (several revisions) Intel Xeon processor embedded sensors + TI THMC10 We also support some miscellaneous chips: Linear Technologies LTC1710 diff --git a/doc/chips/SUMMARY b/doc/chips/SUMMARY index a2166c98..92f7b71a 100644 --- a/doc/chips/SUMMARY +++ b/doc/chips/SUMMARY @@ -27,6 +27,7 @@ adm1021 adm1021 2 - - - yes no max1617 2 - - - yes no max1617a 2 - - - yes no + thmc10 2 - - - yes no xeon 1 - - - yes no adm9240 @@ -73,7 +74,7 @@ NON-SENSOR CHIPS ---------------- Driver Chips -------------- +------ ----- bt869 bt869 video modulator chip @@ -88,3 +89,5 @@ icspll ltc1710 ltc1710 two switches only +matorb + Matrox Orbital LCD displays diff --git a/doc/chips/adm1021 b/doc/chips/adm1021 index ec4caf9c..fab50821 100644 --- a/doc/chips/adm1021 +++ b/doc/chips/adm1021 @@ -1,7 +1,8 @@ Kernel driver `adm1021.o' ========================= -Status: Complete; tested for the ADM1021 and MAX1617, untested for the MAX1617A. +Status: Complete; tested for the ADM1021 and MAX1617, + untested for the MAX1617A and the THMC10. Supported chips: * Analog Devices ADM1021 @@ -16,6 +17,10 @@ Supported chips: Prefix `max1617a' Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e (inclusive) Datasheet: Publicly available at the Maxim website + * TI THMC10 + Prefix `thmc10' + Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e (inclusive) + Datasheet: Publicly available at the TI website Author: Frodo Looijaard and Philip Edelbrock @@ -52,6 +57,7 @@ Description The chips supported by this driver are very similar. The Maxim MAX1617 is the oldest; it has the problem that it is not very well detectable. The MAX1617A solves that. The ADM1021 is a straight clone of the MAX1617A. +Ditto for the THMC10. From here on, we will refer to all these chips as ADM1021-clones. ADM1021-clones implement two temperature sensors. One of them is internal, @@ -102,6 +108,28 @@ Chip `adm1021' die_code SENSORS_ADM1021_DIE_CODE die_code:1 +Chip `thmc10' + LABEL LABEL CLASS COMPUTE CLASS ACCESS MAGNITUDE + temp NONE NONE R 0 + temp_low temp temp RW 0 + temp_over temp temp RW 0 + remote_temp NONE NONE R 0 + remote_temp_low remote_temp remote_temp RW 0 + remote_temp_over remote_temp remote_temp RW 0 + alarms NONE NONE R 0 + die_code NONE NONE R 0 + + LABEL FEATURE SYMBOL SYSCTL FILE:NR + temp SENSORS_ADM1021_TEMP temp:3 + temp_low SENSORS_ADM1021_TEMP_HYST temp:2 + temp_over SENSORS_ADM1021_TEMP_OVER temp:1 + remote_temp SENSORS_ADM1021_REMOTE_TEMP remote_temp:3 + remote_temp_low SENSORS_ADM1021_REMOTE_TEMP_HYST remote_temp:2 + remote_temp_over SENSORS_ADM1021_REMOTE_TEMP_OVER remote_temp:1 + alarms SENSORS_ADM1021_ALARMS alarms:1 + die_code SENSORS_ADM1021_DIE_CODE die_code:1 + + Chip `max1617' LABEL LABEL CLASS COMPUTE CLASS ACCESS MAGNITUDE temp NONE NONE R 0 diff --git a/kernel/chips/adm1021.c b/kernel/chips/adm1021.c index cd1f2832..c5a8e28e 100644 --- a/kernel/chips/adm1021.c +++ b/kernel/chips/adm1021.c @@ -42,7 +42,7 @@ static unsigned int normal_isa[] = {SENSORS_ISA_END}; static unsigned int normal_isa_range[] = {SENSORS_ISA_END}; /* Insmod parameters */ -SENSORS_INSMOD_3(adm1021,max1617,max1617a); +SENSORS_INSMOD_4(adm1021,max1617,max1617a,thmc10); /* adm1021 constants specified below */ @@ -51,7 +51,7 @@ SENSORS_INSMOD_3(adm1021,max1617,max1617a); #define ADM1021_REG_TEMP 0x00 #define ADM1021_REG_REMOTE_TEMP 0x01 #define ADM1021_REG_STATUS 0x02 -#define ADM1021_REG_MAN_ID 0x0FE /* should always read 0x41 */ +#define ADM1021_REG_MAN_ID 0x0FE /* 0x41 = AMD, 0x49 = TI, 0x4D = Maxim */ #define ADM1021_REG_DEV_ID 0x0FF /* ADM1021 */ #define ADM1021_REG_DIE_CODE 0x0FF /* MAX1617A */ /* These use different addresses for reading/writing */ @@ -138,7 +138,7 @@ static void adm1021_update_client(struct i2c_client *client); /* This is the driver that will be inserted */ static struct i2c_driver adm1021_driver = { - /* name */ "adm1021, MAX1617 sensor driver", + /* name */ "ADM1021, MAX1617 sensor driver", /* id */ I2C_DRIVERID_ADM1021, /* flags */ I2C_DF_NOTIFY, /* attach_adapter */ &adm1021_attach_adapter, @@ -242,6 +242,8 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) i = adm1021_read_value(new_client,ADM1021_REG_MAN_ID); if (i == 0x41) kind = adm1021; + if (i == 0x49) + kind = thmc10; else if ((i== 0x4d) && (adm1021_read_value(new_client,ADM1021_REG_DEV_ID) == 0x01)) kind = max1617a; @@ -258,6 +260,9 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) } else if (kind == adm1021) { type_name = "adm1021"; client_name = "ADM1021 chip"; + } else if (kind == thmc10) { + type_name = "thmc10"; + client_name = "THMC10 chip"; } else { #ifdef DEBUG printk("adm1021.o: Internal error: unknown kind (%d)?!?",kind); diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index bf8ad1ad..533d3314 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -282,6 +282,12 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], i2c_detect => sub { adm1021_detect 2, @_ }, }, + { + name => "TI THMC10", + driver => "adm1021", + i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], + i2c_detect => sub { adm1021_detect 3, @_ }, + }, { name => "Silicon Integrated Systems SIS5595", driver => "sis5595", @@ -1376,7 +1382,7 @@ sub adm9240_detect return (8); } -# $_[0]: Chip to detect (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A) +# $_[0]: Chip to detect (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A, 3 = THMC10) # $_[1]: A reference to the file descriptor to access this chip. # We may assume an i2c_set_slave_addr was already done. # $_[2]: Address @@ -1391,6 +1397,7 @@ sub adm1021_detect my $reg; my ($chip, $file,$addr) = @_; return if $chip == 0 and i2c_smbus_read_byte_data($file,0xfe) != 0x41; + return if $chip == 3 and i2c_smbus_read_byte_data($file,0xfe) != 0x49; return if $chip == 2 and i2c_smbus_read_byte_data($file,0xfe) != 0x4d and i2c_smbus_read_byte_data($file,0xff) != 0x01; # The remaining things are flaky at best. Perhaps something can be done diff --git a/prog/sensors/main.c b/prog/sensors/main.c index f7c501f3..6fa7f414 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -250,7 +250,7 @@ void do_a_print(sensors_chip_name name) if (!strcmp(name.prefix,"lm75")) print_lm75(&name); else if (!strcmp(name.prefix,"adm1021") || !strcmp(name.prefix,"max1617") || - !strcmp(name.prefix,"max1617a")) + !strcmp(name.prefix,"max1617a") || !strcmp(name.prefix, "thmc10")) print_adm1021(&name); else if (!strcmp(name.prefix,"adm9240") || !strcmp(name.prefix,"ds1780") ||