diff --git a/doc/chips/adm1025 b/doc/chips/adm1025 index cbcdb4fd..308ab721 100644 --- a/doc/chips/adm1025 +++ b/doc/chips/adm1025 @@ -9,15 +9,14 @@ Supported chips: Addresses scanned: I2C 0x2c - 0x2e (inclusive) Datasheet: Publicly available at the Analog Devices website * Philips NE1619 - Prefix `adm1025' - Addresses scanned: I2C 0x2c - 0x2e (inclusive) + Prefix `ne1619' + Addresses scanned: I2C 0x2c - 0x2d (inclusive) Datasheet: Publicly available at the Philips website The NE1619 presents some differences with the original ADM1025: - * Only two possible addresses (0x2c - 0x2d), although we don't care. + * Only two possible addresses (0x2c - 0x2d). * No temperature offset register, but we don't use it anyway. * No INT mode for pin 16. We don't play with it anyway. -No separate prefix was added for the NE1619, it just wasn't worth it. Author: Chen-Yuan Wu and Jean Delvare @@ -32,6 +31,9 @@ Module Parameters * force_adm1025: short array (min = 1, max = 48) List of adapter,address pairs which are unquestionably assumed to contain a `adm1025' chip +* force_ne1619: short array (min = 1, max = 48) + List of adapter,address pairs which are unquestionably assumed to contain + a `ne1619' chip * probe: short array (min = 1, max = 48) List of adapter,address pairs to scan additionally * probe_range: short array (min = 1, max = 48) @@ -72,7 +74,7 @@ a module parameter to force modes. Chip Features ------------- -Chip 'adm1025' +Chips 'adm1025' and 'ne1619' LABEL LABEL CLASS COMPUTE CLASS MODE MAGN in0 - - R- 2 diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index d41ba7a9..b206f053 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -1131,7 +1131,7 @@ chip "mtp008-*" # set temp2_hyst 47 # ignore temp3 -chip "adm1025-*" +chip "adm1025-*" "ne1619-*" # The ADM1025 has integrated scaling resistors, rather # than external resistors common to most sensor devices. diff --git a/kernel/chips/adm1025.c b/kernel/chips/adm1025.c index 0f11db71..4811990f 100644 --- a/kernel/chips/adm1025.c +++ b/kernel/chips/adm1025.c @@ -2,7 +2,7 @@ adm1025.c - Part of lm_sensors, Linux kernel modules for hardware monitoring Copyright (c) 2000 Chen-Yuan Wu - Copyright (c) 2003 Jean Delvare + Copyright (c) 2003-2004 Jean Delvare Based on the adm9240 driver. @@ -47,7 +47,7 @@ static unsigned int normal_isa[] = { SENSORS_ISA_END }; static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; /* Insmod parameters */ -SENSORS_INSMOD_1(adm1025); +SENSORS_INSMOD_2(adm1025, ne1619); /* Many ADM1025 constants specified below */ @@ -291,24 +291,34 @@ static int adm1025_detect(struct i2c_adapter *adapter, int address, /* Determine the chip type. */ if (kind <= 0) { - i = i2c_smbus_read_byte_data(new_client, ADM1025_REG_COMPANY_ID); - if (((i2c_smbus_read_byte_data(new_client, ADM1025_REG_DIE_REV) & 0xf0) == 0x20) - && ((i == 0x41) /* ADM1025 */ - || (i == 0xA1))) /* NE1619 */ - kind = adm1025; - else { - if (kind == 0) - printk - ("adm1025.o: Ignoring 'force' parameter for unknown chip at " - "adapter %d, address 0x%02x\n", - i2c_adapter_id(adapter), address); - goto ERROR1; + u8 man_id, chip_id; + + man_id = i2c_smbus_read_byte_data(new_client, + ADM1025_REG_COMPANY_ID); + chip_id = i2c_smbus_read_byte_data(new_client, + ADM1025_REG_DIE_REV); + + if (man_id == 0x41) { /* Analog Devices */ + if ((chip_id & 0xF0) == 0x20) /* ADM1025 */ + kind = adm1025; + } else if (man_id == 0xA1) { /* Philips */ + if (address != 0x2E + && (chip_id & 0xF0) == 0x20) /* NE1619 */ + kind = ne1619; } } + if (kind <= 0) { /* Identification failed */ + printk("adm1025.o: Unsupported chip.\n"); + goto ERROR1; + } + if (kind == adm1025) { type_name = "adm1025"; client_name = "ADM1025 chip"; + } else if (kind == ne1619) { + type_name = "ne1619"; + client_name = "NE1619 chip"; } else { #ifdef DEBUG printk("adm1025.o: Internal error: unknown kind (%d)?!?", diff --git a/lib/chips.c b/lib/chips.c index 1586b07b..f0bd68be 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -4812,6 +4812,7 @@ sensors_chip_features sensors_chip_features_list[] = /* Cheat on ADM1022 for now - no separate #defines */ { SENSORS_ADM1022_PREFIX, thmc50_features }, { SENSORS_ADM1025_PREFIX, adm1025_features }, + { SENSORS_NE1619_PREFIX, adm1025_features }, { SENSORS_ADM1026_PREFIX, adm1026_features }, { SENSORS_VIA686A_PREFIX, via686a_features }, { SENSORS_DDCMON_PREFIX, ddcmon_features }, diff --git a/lib/chips.h b/lib/chips.h index 6a63e0a1..2eb214ef 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -966,6 +966,7 @@ /* ADM1025 chip */ #define SENSORS_ADM1025_PREFIX "adm1025" +#define SENSORS_NE1619_PREFIX "ne1619" #define SENSORS_ADM1025_IN0 1 /* R */ #define SENSORS_ADM1025_IN1 2 /* R */ diff --git a/prog/sensors/main.c b/prog/sensors/main.c index 8712993a..db9f4f57 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -361,6 +361,7 @@ struct match matches[] = { { "lm87", print_lm87 }, { "gl518sm", print_gl518 }, { "adm1025", print_adm1025 }, + { "ne1619", print_adm1025 }, { "adm1024", print_adm1024 }, { "w83781d", print_w83781d }, { "w83782d", print_w83781d },