diff --git a/CHANGES b/CHANGES index f2967242..b62c2db0 100644 --- a/CHANGES +++ b/CHANGES @@ -17,7 +17,7 @@ ask CVS about it: Module ddcmon: Fixed bus scan which could hang SMBus Module maxilife: Add support for Maxilife '99 (NBA) Module via686a: Enable sensors if not enabled by BIOS - Module w83781d: Improve w83783s support + Module w83781d: Improve w83783s support, w83627hf always has 2 pwm Program sensors-detect: Fix i801 detection 2.5.0 (20000312) diff --git a/doc/chips/SUMMARY b/doc/chips/SUMMARY index 3038d381..338be36b 100644 --- a/doc/chips/SUMMARY +++ b/doc/chips/SUMMARY @@ -96,7 +96,7 @@ w83781d w83781d 3 7 3 - yes yes w83782d 3 9 3 2-4 pwm yes yes w83783s 1-2 5-6 3 2 pwm yes no - w83627hf 3 9 3 2-4 pwm yes yes (LPC) + w83627hf 3 9 3 2 pwm yes yes (LPC) diff --git a/doc/chips/w83781d b/doc/chips/w83781d index 186794ab..30e166ca 100644 --- a/doc/chips/w83781d +++ b/doc/chips/w83781d @@ -12,7 +12,7 @@ Supported chips: * Winbond W83781D Prefix 'w83781d' Addresses scanned: I2C 0x20 - 0x2f (inclusive), ISA 0x290 (8 I/O ports) - Datasheet: Publicly available at the Winbond website + Datasheet: Publicly available at the Winbond website (www.winbond.com.tw) * Winbond W83782D Prefix 'w83782d' Addresses scanned: I2C 0x20 - 0x2f (inclusive), ISA 0x290 (8 I/O ports) @@ -24,7 +24,7 @@ Supported chips: * Winbond W83627HF Prefix 'w83627hf' Addresses scanned: I2C 0x20 - 0x2f (inclusive), ISA 0x290 (8 I/O ports) - Datasheet: Unavailable from Winbond + Datasheet: Publicly available at the Winbond website * Asus AS99127F Prefix 'as99127f' Addresses scanned: I2C 0x20 - 0x2f (inclusive) @@ -68,8 +68,8 @@ We will refer to them collectively as W8378* chips. There is quite some difference between these chips, but they are similar enough that it was sensible to put them together in one driver. -The W83627HF chip is assumed to be identical to the W83782D. -The AS99127F chip is assumed to be identical to an I2C-only W83782D. +The W83627HF chip is assumed to be identical to the ISA W83782D. +The AS99127F chip is similar to an I2C-only W83782D. Detection of these chips can sometimes be foiled because they can be in an internal state that allows no clean access. If you know the address @@ -99,7 +99,7 @@ sensor(s) of 0.5 degree. FAN rotation speeds are reported in RPM (rotations per minute). An alarm is triggered if the rotation speed has dropped below a programmable limit. FAN readings can be divided by a programmable divider (1, 2, 4 or 8 for the -W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the W83782D and W83783S) to give +W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give the readings more range or accuracy. This is important because some FANs report only one 'tick' each rotation, while others report two - making all readings twice as high. Not all RPM values can accurately be represented, @@ -127,7 +127,7 @@ rt interface, but this is not very useful, because these tables are under NDA. In addition to the alarms described above, there is a CHAS alarm on the -W83781D and W83782D which triggers if your computer case is open. +chips which triggers if your computer case is open. When an alarm goes off, you can be warned by a beeping signal through your computer speaker. It is possible to enable all beeping globally, @@ -457,27 +457,10 @@ Chip `w83783s' -Old documentation ------------------ +Miscellaneous documentation +=========================== -Winbond 83781D driver ---------------------- -Supports the following Winbond chips: - -Chip #vin #fanin #pwm #temp wchipid i2c ISA ------------------------------------------------------------- -w83781d 7 3 0 3 0x10 yes yes -w83782d 9 3 2-4 3 0x30 yes yes -w83783s 5-6 3 2 1-2 0x40 yes no - - -Stability ---------- -w83781d: tested, stable -w83782d: beta tested, some minor bugs and things to do. -w83783s: untested - /PROC ENTRIES ------------- @@ -510,15 +493,10 @@ Additional entries not in the lm78: Only set at initialization; not updated every 1.5 seconds. -The driver only updates its values each 1.5 seconds; reading it more often -will do no harm, but will return 'old' values. - TO DO: ----- 782d programmable pins - 783s temp2 (labeled as temp1 in data sheet) at different location - than 781d/782d, not implemented yet. NOTES: diff --git a/kernel/chips/w83781d.c b/kernel/chips/w83781d.c index d6a83ed5..ce1b0dda 100644 --- a/kernel/chips/w83781d.c +++ b/kernel/chips/w83781d.c @@ -868,14 +868,13 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, /* Register a new directory entry with module sensors */ if ((i = sensors_register_entry(new_client, type_name, - kind == - w83781d ? - w83781d_dir_table_template : kind - == - w83783s ? - w83783s_dir_table_template : is_isa - ? w83782d_isa_dir_table_template : - w83782d_i2c_dir_table_template, + kind == w83781d ? + w83781d_dir_table_template : + kind == w83783s ? + w83783s_dir_table_template : + (is_isa || kind == w83627hf) ? + w83782d_isa_dir_table_template : + w83782d_i2c_dir_table_template, THIS_MODULE)) < 0) { err = i; goto ERROR7; @@ -1026,20 +1025,20 @@ int w83781d_read_value(struct i2c_client *client, u16 reg) lm75[bank - 1]); /* convert from ISA to LM75 I2C addresses */ switch (reg & 0xff) { - case 0x50: + case 0x50: /* TEMP */ res = swap_bytes(i2c_smbus_read_word_data (cl, 0)); break; - case 0x52: + case 0x52: /* CONFIG */ res = i2c_smbus_read_byte_data(cl, 1); break; - case 0x53: + case 0x53: /* HYST */ res = swap_bytes(i2c_smbus_read_word_data (cl, 2)); break; - case 0x55: + case 0x55: /* OVER */ default: res = swap_bytes(i2c_smbus_read_word_data @@ -1103,24 +1102,21 @@ int w83781d_write_value(struct i2c_client *client, u16 reg, u16 value) value & 0xff); } else { /* switch to subclient */ - cl = - &(((struct w83781d_data *) (client->data))-> + cl = &(((struct w83781d_data *) (client->data))-> lm75[bank - 1]); /* convert from ISA to LM75 I2C addresses */ switch (reg & 0xff) { - case 0x52: + case 0x52: /* CONFIG */ i2c_smbus_write_byte_data(cl, 1, value & 0xff); break; - case 0x53: + case 0x53: /* HYST */ i2c_smbus_write_word_data(cl, 2, - swap_bytes - (value)); + swap_bytes(value)); break; - case 0x55: + case 0x55: /* OVER */ i2c_smbus_write_word_data(cl, 3, - swap_bytes - (value)); + swap_bytes(value)); break; } } @@ -1361,14 +1357,11 @@ void w83781d_update_client(struct i2c_client *client) data->pwm[i - 1] = w83781d_read_value(client, W83781D_REG_PWM(i)); - if ( - ((data->type == w83783s) - || - (((data-> - type == w83782d) - || (data->type == w83627hf) - || data->type == as99127f) - && i2c_is_isa_client(client))) + if (((data->type == w83783s) + || (data->type == w83627hf) + || (((data->type == w83782d) + || (data->type == as99127f)) + && i2c_is_isa_client(client))) && i == 2) break; } @@ -1759,15 +1752,13 @@ void w83781d_sens(struct i2c_client *client, int operation, int ctl_name, if (*nrels_mag >= 1) { switch (results[0]) { case 1: /* PII/Celeron diode */ - tmp = - w83781d_read_value(client, + tmp = w83781d_read_value(client, W83781D_REG_SCFG1); w83781d_write_value(client, W83781D_REG_SCFG1, tmp | BIT_SCFG1[nr - 1]); - tmp = - w83781d_read_value(client, + tmp = w83781d_read_value(client, W83781D_REG_SCFG2); w83781d_write_value(client, W83781D_REG_SCFG2, @@ -1776,15 +1767,13 @@ void w83781d_sens(struct i2c_client *client, int operation, int ctl_name, data->sens[nr - 1] = results[0]; break; case 2: /* 3904 */ - tmp = - w83781d_read_value(client, + tmp = w83781d_read_value(client, W83781D_REG_SCFG1); w83781d_write_value(client, W83781D_REG_SCFG1, tmp | BIT_SCFG1[nr - 1]); - tmp = - w83781d_read_value(client, + tmp = w83781d_read_value(client, W83781D_REG_SCFG2); w83781d_write_value(client, W83781D_REG_SCFG2, @@ -1793,8 +1782,7 @@ void w83781d_sens(struct i2c_client *client, int operation, int ctl_name, data->sens[nr - 1] = results[0]; break; case W83781D_DEFAULT_BETA: /* thermistor */ - tmp = - w83781d_read_value(client, + tmp = w83781d_read_value(client, W83781D_REG_SCFG1); w83781d_write_value(client, W83781D_REG_SCFG1, @@ -1878,7 +1866,7 @@ EXPORT_NO_SYMBOLS; #ifdef MODULE MODULE_AUTHOR("Frodo Looijaard , " - "Philip Edelbrock , " + "Philip Edelbrock , " "and Mark Studebaker "); MODULE_DESCRIPTION("W83781D driver");