Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (lm85) Drop dead code

Drop a lot of useless register defines, conversion macros, data structure
members and update code. All these register values were read from the
device but nothing is done out of them, so this is all dead code in
practice.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Juerg Haefliger <juergh at gmail.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Jean Delvare and committed by
Mark M. Hoffman
dd1ac538 1f44809a

+6 -87
+4 -7
Documentation/hwmon/lm85
··· 96 96 confirmed this "bug". The ADT7463 is reported to work as described in the 97 97 documentation. The current lm85 driver does not show the offset register. 98 98 99 - The ADT7463 has a THERM asserted counter. This counter has a 22.76ms 100 - resolution and a range of 5.8 seconds. The driver implements a 32-bit 101 - accumulator of the counter value to extend the range to over a year. The 102 - counter will stay at it's max value until read. 103 - 104 99 See the vendor datasheets for more information. There is application note 105 100 from National (AN-1260) with some additional information about the LM85. 106 101 The Analog Devices datasheet is very detailed and describes a procedure for ··· 201 206 202 207 The National LM85's have two vendor specific configuration 203 208 features. Tach. mode and Spinup Control. For more details on these, 204 - see the LM85 datasheet or Application Note AN-1260. 209 + see the LM85 datasheet or Application Note AN-1260. These features 210 + are not currently supported by the lm85 driver. 205 211 206 212 The Analog Devices ADM1027 has several vendor specific enhancements. 207 213 The number of pulses-per-rev of the fans can be set, Tach monitoring 208 214 can be optimized for PWM operation, and an offset can be applied to 209 215 the temperatures to compensate for systemic errors in the 210 - measurements. 216 + measurements. These features are not currently supported by the lm85 217 + driver. 211 218 212 219 In addition to the ADM1027 features, the ADT7463 also has Tmin control 213 220 and THERM asserted counts. Automatic Tmin control acts to adjust the
+2 -80
drivers/hwmon/lm85.c
··· 56 56 57 57 #define LM85_REG_PWM(nr) (0x30 + (nr)) 58 58 59 - #define ADT7463_REG_OPPOINT(nr) (0x33 + (nr)) 60 - 61 - #define ADT7463_REG_TMIN_CTL1 0x36 62 - #define ADT7463_REG_TMIN_CTL2 0x37 63 - 64 - #define LM85_REG_DEVICE 0x3d 65 59 #define LM85_REG_COMPANY 0x3e 66 60 #define LM85_REG_VERSTEP 0x3f 67 61 /* These are the recognized values for the above regs */ 68 - #define LM85_DEVICE_ADX 0x27 69 62 #define LM85_COMPANY_NATIONAL 0x01 70 63 #define LM85_COMPANY_ANALOG_DEV 0x41 71 64 #define LM85_COMPANY_SMSC 0x5c ··· 84 91 #define LM85_REG_AFAN_CONFIG(nr) (0x5c + (nr)) 85 92 #define LM85_REG_AFAN_RANGE(nr) (0x5f + (nr)) 86 93 #define LM85_REG_AFAN_SPIKE1 0x62 87 - #define LM85_REG_AFAN_SPIKE2 0x63 88 94 #define LM85_REG_AFAN_MINPWM(nr) (0x64 + (nr)) 89 95 #define LM85_REG_AFAN_LIMIT(nr) (0x67 + (nr)) 90 96 #define LM85_REG_AFAN_CRITICAL(nr) (0x6a + (nr)) 91 97 #define LM85_REG_AFAN_HYST1 0x6d 92 98 #define LM85_REG_AFAN_HYST2 0x6e 93 99 94 - #define LM85_REG_TACH_MODE 0x74 95 - #define LM85_REG_SPINUP_CTL 0x75 96 - 97 - #define ADM1027_REG_TEMP_OFFSET(nr) (0x70 + (nr)) 98 - #define ADM1027_REG_CONFIG2 0x73 99 - #define ADM1027_REG_INTMASK1 0x74 100 - #define ADM1027_REG_INTMASK2 0x75 101 100 #define ADM1027_REG_EXTEND_ADC1 0x76 102 101 #define ADM1027_REG_EXTEND_ADC2 0x77 103 - #define ADM1027_REG_CONFIG3 0x78 104 - #define ADM1027_REG_FAN_PPR 0x7b 105 - 106 - #define ADT7463_REG_THERM 0x79 107 - #define ADT7463_REG_THERM_LIMIT 0x7A 108 102 109 103 #define EMC6D100_REG_ALARM3 0x7d 110 104 /* IN5, IN6 and IN7 */ ··· 243 263 #define HYST_TO_REG(val) SENSORS_LIMIT(((val) + 500) / 1000, 0, 15) 244 264 #define HYST_FROM_REG(val) ((val) * 1000) 245 265 246 - #define OFFSET_TO_REG(val) SENSORS_LIMIT((val) / 25, -127, 127) 247 - #define OFFSET_FROM_REG(val) ((val) * 25) 248 - 249 - #define PPR_MASK(fan) (0x03 << ((fan) * 2)) 250 - #define PPR_TO_REG(val, fan) (SENSORS_LIMIT((val) - 1, 0, 3) << ((fan) * 2)) 251 - #define PPR_FROM_REG(val, fan) ((((val) >> ((fan) * 2)) & 0x03) + 1) 252 - 253 266 /* Chip sampling rates 254 267 * 255 268 * Some sensors are not updated more frequently than once per second ··· 303 330 s8 temp[3]; /* Register value */ 304 331 s8 temp_min[3]; /* Register value */ 305 332 s8 temp_max[3]; /* Register value */ 306 - s8 temp_offset[3]; /* Register value */ 307 333 u16 fan[4]; /* Register value */ 308 334 u16 fan_min[4]; /* Register value */ 309 335 u8 pwm[3]; /* Register value */ 310 - u8 spinup_ctl; /* Register encoding, combined */ 311 - u8 tach_mode; /* Register encoding, combined */ 312 336 u8 temp_ext[3]; /* Decoded values */ 313 337 u8 in_ext[8]; /* Decoded values */ 314 - u8 fan_ppr; /* Register value */ 315 - u8 smooth[3]; /* Register encoding */ 338 + u8 smooth[1]; /* Register encoding */ 316 339 u8 vid; /* Register value */ 317 340 u8 vrm; /* VRM version */ 318 341 u8 syncpwm3; /* Saved PWM3 for TACH 2,3,4 config */ 319 - u8 oppoint[3]; /* Register value */ 320 - u16 tmin_ctl; /* Register value */ 321 - unsigned long therm_total; /* Cummulative therm count */ 322 - u8 therm_limit; /* Register value */ 323 342 u32 alarms; /* Register encoding, combined */ 324 343 struct lm85_autofan autofan[3]; 325 344 struct lm85_zone zone[3]; ··· 1300 1335 res = i2c_smbus_read_byte_data(client, reg) & 0xff; 1301 1336 res |= i2c_smbus_read_byte_data(client, reg + 1) << 8; 1302 1337 break; 1303 - case ADT7463_REG_TMIN_CTL1: /* Read WORD MSB, LSB */ 1304 - res = i2c_smbus_read_byte_data(client, reg) << 8; 1305 - res |= i2c_smbus_read_byte_data(client, reg + 1) & 0xff; 1306 - break; 1307 1338 default: /* Read BYTE data */ 1308 1339 res = i2c_smbus_read_byte_data(client, reg); 1309 1340 break; ··· 1325 1364 res = i2c_smbus_write_byte_data(client, reg, value & 0xff); 1326 1365 res |= i2c_smbus_write_byte_data(client, reg + 1, 1327 1366 (value >> 8) & 0xff); 1328 - break; 1329 - case ADT7463_REG_TMIN_CTL1: /* Write WORD MSB, LSB */ 1330 - res = i2c_smbus_write_byte_data(client, reg, 1331 - (value >> 8) & 0xff); 1332 - res |= i2c_smbus_write_byte_data(client, reg + 1, value & 0xff); 1333 1367 break; 1334 1368 default: /* Write BYTE data */ 1335 1369 res = i2c_smbus_write_byte_data(client, reg, value); ··· 1439 1483 1440 1484 data->alarms = lm85_read_value(client, LM85_REG_ALARM1); 1441 1485 1442 - if (data->type == adt7463) { 1443 - if (data->therm_total < ULONG_MAX - 256) { 1444 - data->therm_total += 1445 - lm85_read_value(client, ADT7463_REG_THERM); 1446 - } 1447 - } else if (data->type == emc6d100) { 1486 + if (data->type == emc6d100) { 1448 1487 /* Three more voltage sensors */ 1449 1488 for (i = 5; i <= 7; ++i) { 1450 1489 data->in[i] = lm85_read_value(client, ··· 1536 1585 data->autofan[0].min_off = (i & 0x20) != 0; 1537 1586 data->autofan[1].min_off = (i & 0x40) != 0; 1538 1587 data->autofan[2].min_off = (i & 0x80) != 0; 1539 - i = lm85_read_value(client, LM85_REG_AFAN_SPIKE2); 1540 - data->smooth[1] = (i >> 4) & 0x0f; 1541 - data->smooth[2] = i & 0x0f; 1542 1588 1543 1589 i = lm85_read_value(client, LM85_REG_AFAN_HYST1); 1544 1590 data->zone[0].hyst = (i >> 4) & 0x0f; ··· 1543 1595 1544 1596 i = lm85_read_value(client, LM85_REG_AFAN_HYST2); 1545 1597 data->zone[2].hyst = (i >> 4) & 0x0f; 1546 - 1547 - if (data->type == lm85b || data->type == lm85c) { 1548 - data->tach_mode = lm85_read_value(client, 1549 - LM85_REG_TACH_MODE); 1550 - data->spinup_ctl = lm85_read_value(client, 1551 - LM85_REG_SPINUP_CTL); 1552 - } else if (data->type == adt7463 || data->type == adm1027) { 1553 - if (data->type == adt7463) { 1554 - for (i = 0; i <= 2; ++i) { 1555 - data->oppoint[i] = lm85_read_value(client, 1556 - ADT7463_REG_OPPOINT(i)); 1557 - } 1558 - data->tmin_ctl = lm85_read_value(client, 1559 - ADT7463_REG_TMIN_CTL1); 1560 - data->therm_limit = lm85_read_value(client, 1561 - ADT7463_REG_THERM_LIMIT); 1562 - } 1563 - for (i = 0; i <= 2; ++i) { 1564 - data->temp_offset[i] = lm85_read_value(client, 1565 - ADM1027_REG_TEMP_OFFSET(i)); 1566 - } 1567 - data->tach_mode = lm85_read_value(client, 1568 - ADM1027_REG_CONFIG3); 1569 - data->fan_ppr = lm85_read_value(client, 1570 - ADM1027_REG_FAN_PPR); 1571 - } 1572 1598 1573 1599 data->last_config = jiffies; 1574 1600 } /* last_config */