aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/amiserial.c6
-rw-r--r--drivers/hwmon/abituguru3.c30
-rw-r--r--drivers/hwmon/adt7473.c29
-rw-r--r--drivers/hwmon/hwmon-vid.c1
-rw-r--r--drivers/hwmon/lm90.c52
-rw-r--r--drivers/hwmon/w83781d.c4
-rw-r--r--drivers/ide/icside.c4
-rw-r--r--drivers/ide/rapide.c4
-rw-r--r--drivers/net/r8169.c88
9 files changed, 80 insertions, 138 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 98821f97583c..b97aebd7aeb8 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -2071,12 +2071,13 @@ module_init(rs_init)
2071module_exit(rs_exit) 2071module_exit(rs_exit)
2072 2072
2073 2073
2074#if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE)
2075
2074/* 2076/*
2075 * ------------------------------------------------------------ 2077 * ------------------------------------------------------------
2076 * Serial console driver 2078 * Serial console driver
2077 * ------------------------------------------------------------ 2079 * ------------------------------------------------------------
2078 */ 2080 */
2079#ifdef CONFIG_SERIAL_CONSOLE
2080 2081
2081static void amiga_serial_putc(char c) 2082static void amiga_serial_putc(char c)
2082{ 2083{
@@ -2130,6 +2131,7 @@ static int __init amiserial_console_init(void)
2130 return 0; 2131 return 0;
2131} 2132}
2132console_initcall(amiserial_console_init); 2133console_initcall(amiserial_console_init);
2133#endif 2134
2135#endif /* CONFIG_SERIAL_CONSOLE && !MODULE */
2134 2136
2135MODULE_LICENSE("GPL"); 2137MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index d9e7a49d6cbf..70bb854086df 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -178,7 +178,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
178 { "+3.3V", 10, 0, 20, 1, 0 }, 178 { "+3.3V", 10, 0, 20, 1, 0 },
179 { "5VSB", 11, 0, 30, 1, 0 }, 179 { "5VSB", 11, 0, 30, 1, 0 },
180 { "CPU", 24, 1, 1, 1, 0 }, 180 { "CPU", 24, 1, 1, 1, 0 },
181 { "System ", 25, 1, 1, 1, 0 }, 181 { "System", 25, 1, 1, 1, 0 },
182 { "PWM", 26, 1, 1, 1, 0 }, 182 { "PWM", 26, 1, 1, 1, 0 },
183 { "CPU Fan", 32, 2, 60, 1, 0 }, 183 { "CPU Fan", 32, 2, 60, 1, 0 },
184 { "NB Fan", 33, 2, 60, 1, 0 }, 184 { "NB Fan", 33, 2, 60, 1, 0 },
@@ -200,7 +200,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
200 { "+3.3V", 10, 0, 20, 1, 0 }, 200 { "+3.3V", 10, 0, 20, 1, 0 },
201 { "5VSB", 11, 0, 30, 1, 0 }, 201 { "5VSB", 11, 0, 30, 1, 0 },
202 { "CPU", 24, 1, 1, 1, 0 }, 202 { "CPU", 24, 1, 1, 1, 0 },
203 { "System ", 25, 1, 1, 1, 0 }, 203 { "System", 25, 1, 1, 1, 0 },
204 { "PWM1", 26, 1, 1, 1, 0 }, 204 { "PWM1", 26, 1, 1, 1, 0 },
205 { "PWM2", 27, 1, 1, 1, 0 }, 205 { "PWM2", 27, 1, 1, 1, 0 },
206 { "PWM3", 28, 1, 1, 1, 0 }, 206 { "PWM3", 28, 1, 1, 1, 0 },
@@ -229,7 +229,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
229 { "+3.3V", 10, 0, 20, 1, 0 }, 229 { "+3.3V", 10, 0, 20, 1, 0 },
230 { "5VSB", 11, 0, 30, 1, 0 }, 230 { "5VSB", 11, 0, 30, 1, 0 },
231 { "CPU", 24, 1, 1, 1, 0 }, 231 { "CPU", 24, 1, 1, 1, 0 },
232 { "System ", 25, 1, 1, 1, 0 }, 232 { "System", 25, 1, 1, 1, 0 },
233 { "PWM", 26, 1, 1, 1, 0 }, 233 { "PWM", 26, 1, 1, 1, 0 },
234 { "CPU Fan", 32, 2, 60, 1, 0 }, 234 { "CPU Fan", 32, 2, 60, 1, 0 },
235 { "NB Fan", 33, 2, 60, 1, 0 }, 235 { "NB Fan", 33, 2, 60, 1, 0 },
@@ -250,7 +250,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
250 { "+3.3V", 10, 0, 20, 1, 0 }, 250 { "+3.3V", 10, 0, 20, 1, 0 },
251 { "5VSB", 11, 0, 30, 1, 0 }, 251 { "5VSB", 11, 0, 30, 1, 0 },
252 { "CPU", 24, 1, 1, 1, 0 }, 252 { "CPU", 24, 1, 1, 1, 0 },
253 { "System ", 25, 1, 1, 1, 0 }, 253 { "System", 25, 1, 1, 1, 0 },
254 { "PWM", 26, 1, 1, 1, 0 }, 254 { "PWM", 26, 1, 1, 1, 0 },
255 { "CPU Fan", 32, 2, 60, 1, 0 }, 255 { "CPU Fan", 32, 2, 60, 1, 0 },
256 { "NB Fan", 33, 2, 60, 1, 0 }, 256 { "NB Fan", 33, 2, 60, 1, 0 },
@@ -342,7 +342,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
342 { "+3.3V", 10, 0, 20, 1, 0 }, 342 { "+3.3V", 10, 0, 20, 1, 0 },
343 { "5VSB", 11, 0, 30, 1, 0 }, 343 { "5VSB", 11, 0, 30, 1, 0 },
344 { "CPU", 24, 1, 1, 1, 0 }, 344 { "CPU", 24, 1, 1, 1, 0 },
345 { "System ", 25, 1, 1, 1, 0 }, 345 { "System", 25, 1, 1, 1, 0 },
346 { "PWM1", 26, 1, 1, 1, 0 }, 346 { "PWM1", 26, 1, 1, 1, 0 },
347 { "PWM2", 27, 1, 1, 1, 0 }, 347 { "PWM2", 27, 1, 1, 1, 0 },
348 { "PWM3", 28, 1, 1, 1, 0 }, 348 { "PWM3", 28, 1, 1, 1, 0 },
@@ -371,7 +371,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
371 { "+3.3V", 10, 0, 20, 1, 0 }, 371 { "+3.3V", 10, 0, 20, 1, 0 },
372 { "5VSB", 11, 0, 30, 1, 0 }, 372 { "5VSB", 11, 0, 30, 1, 0 },
373 { "CPU", 24, 1, 1, 1, 0 }, 373 { "CPU", 24, 1, 1, 1, 0 },
374 { "System ", 25, 1, 1, 1, 0 }, 374 { "System", 25, 1, 1, 1, 0 },
375 { "PWM", 26, 1, 1, 1, 0 }, 375 { "PWM", 26, 1, 1, 1, 0 },
376 { "CPU Fan", 32, 2, 60, 1, 0 }, 376 { "CPU Fan", 32, 2, 60, 1, 0 },
377 { "NB Fan", 33, 2, 60, 1, 0 }, 377 { "NB Fan", 33, 2, 60, 1, 0 },
@@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
402 { "AUX3 Fan", 36, 2, 60, 1, 0 }, 402 { "AUX3 Fan", 36, 2, 60, 1, 0 },
403 { NULL, 0, 0, 0, 0, 0 } } 403 { NULL, 0, 0, 0, 0, 0 } }
404 }, 404 },
405 { 0x0016, NULL /* AW9D-MAX, need DMI string */, { 405 { 0x0016, "AW9D-MAX (Intel i975-ICH7)", {
406 { "CPU Core", 0, 0, 10, 1, 0 }, 406 { "CPU Core", 0, 0, 10, 1, 0 },
407 { "DDR2", 1, 0, 20, 1, 0 }, 407 { "DDR2", 1, 0, 20, 1, 0 },
408 { "DDR2 VTT", 2, 0, 10, 1, 0 }, 408 { "DDR2 VTT", 2, 0, 10, 1, 0 },
@@ -416,7 +416,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
416 { "+3.3V", 10, 0, 20, 1, 0 }, 416 { "+3.3V", 10, 0, 20, 1, 0 },
417 { "5VSB", 11, 0, 30, 1, 0 }, 417 { "5VSB", 11, 0, 30, 1, 0 },
418 { "CPU", 24, 1, 1, 1, 0 }, 418 { "CPU", 24, 1, 1, 1, 0 },
419 { "System ", 25, 1, 1, 1, 0 }, 419 { "System", 25, 1, 1, 1, 0 },
420 { "PWM1", 26, 1, 1, 1, 0 }, 420 { "PWM1", 26, 1, 1, 1, 0 },
421 { "PWM2", 27, 1, 1, 1, 0 }, 421 { "PWM2", 27, 1, 1, 1, 0 },
422 { "PWM3", 28, 1, 1, 1, 0 }, 422 { "PWM3", 28, 1, 1, 1, 0 },
@@ -446,7 +446,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
446 { "ATX +3.3V", 10, 0, 20, 1, 0 }, 446 { "ATX +3.3V", 10, 0, 20, 1, 0 },
447 { "ATX 5VSB", 11, 0, 30, 1, 0 }, 447 { "ATX 5VSB", 11, 0, 30, 1, 0 },
448 { "CPU", 24, 1, 1, 1, 0 }, 448 { "CPU", 24, 1, 1, 1, 0 },
449 { "System ", 26, 1, 1, 1, 0 }, 449 { "System", 26, 1, 1, 1, 0 },
450 { "PWM", 27, 1, 1, 1, 0 }, 450 { "PWM", 27, 1, 1, 1, 0 },
451 { "CPU FAN", 32, 2, 60, 1, 0 }, 451 { "CPU FAN", 32, 2, 60, 1, 0 },
452 { "SYS FAN", 34, 2, 60, 1, 0 }, 452 { "SYS FAN", 34, 2, 60, 1, 0 },
@@ -469,7 +469,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
469 { "+3.3V", 10, 0, 20, 1, 0 }, 469 { "+3.3V", 10, 0, 20, 1, 0 },
470 { "5VSB", 11, 0, 30, 1, 0 }, 470 { "5VSB", 11, 0, 30, 1, 0 },
471 { "CPU", 24, 1, 1, 1, 0 }, 471 { "CPU", 24, 1, 1, 1, 0 },
472 { "System ", 25, 1, 1, 1, 0 }, 472 { "System", 25, 1, 1, 1, 0 },
473 { "PWM Phase1", 26, 1, 1, 1, 0 }, 473 { "PWM Phase1", 26, 1, 1, 1, 0 },
474 { "PWM Phase2", 27, 1, 1, 1, 0 }, 474 { "PWM Phase2", 27, 1, 1, 1, 0 },
475 { "PWM Phase3", 28, 1, 1, 1, 0 }, 475 { "PWM Phase3", 28, 1, 1, 1, 0 },
@@ -487,7 +487,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
487 { "DDR2", 13, 0, 20, 1, 0 }, 487 { "DDR2", 13, 0, 20, 1, 0 },
488 { "DDR2 VTT", 14, 0, 10, 1, 0 }, 488 { "DDR2 VTT", 14, 0, 10, 1, 0 },
489 { "CPU VTT", 3, 0, 20, 1, 0 }, 489 { "CPU VTT", 3, 0, 20, 1, 0 },
490 { "NB 1.2V ", 4, 0, 10, 1, 0 }, 490 { "NB 1.2V", 4, 0, 10, 1, 0 },
491 { "SB 1.5V", 6, 0, 10, 1, 0 }, 491 { "SB 1.5V", 6, 0, 10, 1, 0 },
492 { "HyperTransport", 5, 0, 10, 1, 0 }, 492 { "HyperTransport", 5, 0, 10, 1, 0 },
493 { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, 493 { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 },
@@ -496,7 +496,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
496 { "ATX +3.3V", 10, 0, 20, 1, 0 }, 496 { "ATX +3.3V", 10, 0, 20, 1, 0 },
497 { "ATX 5VSB", 11, 0, 30, 1, 0 }, 497 { "ATX 5VSB", 11, 0, 30, 1, 0 },
498 { "CPU", 24, 1, 1, 1, 0 }, 498 { "CPU", 24, 1, 1, 1, 0 },
499 { "System ", 25, 1, 1, 1, 0 }, 499 { "System", 25, 1, 1, 1, 0 },
500 { "PWM Phase1", 26, 1, 1, 1, 0 }, 500 { "PWM Phase1", 26, 1, 1, 1, 0 },
501 { "PWM Phase2", 27, 1, 1, 1, 0 }, 501 { "PWM Phase2", 27, 1, 1, 1, 0 },
502 { "PWM Phase3", 28, 1, 1, 1, 0 }, 502 { "PWM Phase3", 28, 1, 1, 1, 0 },
@@ -523,8 +523,8 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
523 { "+3.3V", 10, 0, 20, 1, 0 }, 523 { "+3.3V", 10, 0, 20, 1, 0 },
524 { "5VSB", 11, 0, 30, 1, 0 }, 524 { "5VSB", 11, 0, 30, 1, 0 },
525 { "CPU", 24, 1, 1, 1, 0 }, 525 { "CPU", 24, 1, 1, 1, 0 },
526 { "System ", 25, 1, 1, 1, 0 }, 526 { "System", 25, 1, 1, 1, 0 },
527 { "PWM ", 26, 1, 1, 1, 0 }, 527 { "PWM", 26, 1, 1, 1, 0 },
528 { "PWM Phase2", 27, 1, 1, 1, 0 }, 528 { "PWM Phase2", 27, 1, 1, 1, 0 },
529 { "PWM Phase3", 28, 1, 1, 1, 0 }, 529 { "PWM Phase3", 28, 1, 1, 1, 0 },
530 { "PWM Phase4", 29, 1, 1, 1, 0 }, 530 { "PWM Phase4", 29, 1, 1, 1, 0 },
@@ -947,7 +947,7 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
947 if (!abituguru3_motherboards[i].dmi_name) { 947 if (!abituguru3_motherboards[i].dmi_name) {
948 printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " 948 printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was "
949 "not detected using DMI. Please send the output of " 949 "not detected using DMI. Please send the output of "
950 "\"dmidecode\" to the abituguru3 maintainer" 950 "\"dmidecode\" to the abituguru3 maintainer "
951 "(see MAINTAINERS)\n"); 951 "(see MAINTAINERS)\n");
952 } 952 }
953#endif 953#endif
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
index 3a0b63136479..b9a8ea30c99c 100644
--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -319,35 +319,24 @@ out:
319} 319}
320 320
321/* 321/*
322 * On this chip, voltages are given as a count of steps between a minimum 322 * Conversions
323 * and maximum voltage, not a direct voltage.
324 */ 323 */
325static const int volt_convert_table[][2] = { 324
326 {2997, 3}, 325/* IN are scaled acording to built-in resistors */
327 {4395, 4}, 326static const int adt7473_scaling[] = { /* .001 Volts */
327 2250, 3300
328}; 328};
329#define SCALE(val, from, to) (((val) * (to) + ((from) / 2)) / (from))
329 330
330static int decode_volt(int volt_index, u8 raw) 331static int decode_volt(int volt_index, u8 raw)
331{ 332{
332 int cmax = volt_convert_table[volt_index][0]; 333 return SCALE(raw, 192, adt7473_scaling[volt_index]);
333 int cmin = volt_convert_table[volt_index][1];
334 return ((raw * (cmax - cmin)) / 255) + cmin;
335} 334}
336 335
337static u8 encode_volt(int volt_index, int cooked) 336static u8 encode_volt(int volt_index, int cooked)
338{ 337{
339 int cmax = volt_convert_table[volt_index][0]; 338 int raw = SCALE(cooked, adt7473_scaling[volt_index], 192);
340 int cmin = volt_convert_table[volt_index][1]; 339 return SENSORS_LIMIT(raw, 0, 255);
341 u8 x;
342
343 if (cooked > cmax)
344 cooked = cmax;
345 else if (cooked < cmin)
346 cooked = cmin;
347
348 x = ((cooked - cmin) * 255) / (cmax - cmin);
349
350 return x;
351} 340}
352 341
353static ssize_t show_volt_min(struct device *dev, 342static ssize_t show_volt_min(struct device *dev,
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index c54eff92be4a..bfc296145bba 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -180,6 +180,7 @@ static struct vrm_model vrm_models[] = {
180 {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ 180 {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */
181 {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ 181 {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */
182 {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ 182 {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */
183 {X86_VENDOR_AMD, 0x10, ANY, ANY, 25}, /* NPT family 10h */
183 {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ 184 {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */
184 {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ 185 {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */
185 {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ 186 {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 3edeebc0b835..96a701866726 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -12,9 +12,9 @@
12 * made by National Semiconductor. Both have an increased remote 12 * made by National Semiconductor. Both have an increased remote
13 * temperature measurement accuracy (1 degree), and the LM99 13 * temperature measurement accuracy (1 degree), and the LM99
14 * additionally shifts remote temperatures (measured and limits) by 16 14 * additionally shifts remote temperatures (measured and limits) by 16
15 * degrees, which allows for higher temperatures measurement. The 15 * degrees, which allows for higher temperatures measurement.
16 * driver doesn't handle it since it can be done easily in user-space.
17 * Note that there is no way to differentiate between both chips. 16 * Note that there is no way to differentiate between both chips.
17 * When device is auto-detected, the driver will assume an LM99.
18 * 18 *
19 * This driver also supports the LM86, another sensor chip made by 19 * This driver also supports the LM86, another sensor chip made by
20 * National Semiconductor. It is exactly similar to the LM90 except it 20 * National Semiconductor. It is exactly similar to the LM90 except it
@@ -169,8 +169,8 @@ static const struct i2c_device_id lm90_id[] = {
169 { "adt7461", adt7461 }, 169 { "adt7461", adt7461 },
170 { "lm90", lm90 }, 170 { "lm90", lm90 },
171 { "lm86", lm86 }, 171 { "lm86", lm86 },
172 { "lm89", lm99 }, 172 { "lm89", lm86 },
173 { "lm99", lm99 }, /* Missing temperature offset */ 173 { "lm99", lm99 },
174 { "max6646", max6646 }, 174 { "max6646", max6646 },
175 { "max6647", max6646 }, 175 { "max6647", max6646 },
176 { "max6649", max6646 }, 176 { "max6649", max6646 },
@@ -366,6 +366,10 @@ static ssize_t show_temp8(struct device *dev, struct device_attribute *devattr,
366 else 366 else
367 temp = temp_from_s8(data->temp8[attr->index]); 367 temp = temp_from_s8(data->temp8[attr->index]);
368 368
369 /* +16 degrees offset for temp2 for the LM99 */
370 if (data->kind == lm99 && attr->index == 3)
371 temp += 16000;
372
369 return sprintf(buf, "%d\n", temp); 373 return sprintf(buf, "%d\n", temp);
370} 374}
371 375
@@ -385,6 +389,10 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr,
385 long val = simple_strtol(buf, NULL, 10); 389 long val = simple_strtol(buf, NULL, 10);
386 int nr = attr->index; 390 int nr = attr->index;
387 391
392 /* +16 degrees offset for temp2 for the LM99 */
393 if (data->kind == lm99 && attr->index == 3)
394 val -= 16000;
395
388 mutex_lock(&data->update_lock); 396 mutex_lock(&data->update_lock);
389 if (data->kind == adt7461) 397 if (data->kind == adt7461)
390 data->temp8[nr] = temp_to_u8_adt7461(data, val); 398 data->temp8[nr] = temp_to_u8_adt7461(data, val);
@@ -411,6 +419,10 @@ static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr,
411 else 419 else
412 temp = temp_from_s16(data->temp11[attr->index]); 420 temp = temp_from_s16(data->temp11[attr->index]);
413 421
422 /* +16 degrees offset for temp2 for the LM99 */
423 if (data->kind == lm99 && attr->index <= 2)
424 temp += 16000;
425
414 return sprintf(buf, "%d\n", temp); 426 return sprintf(buf, "%d\n", temp);
415} 427}
416 428
@@ -432,6 +444,10 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr,
432 long val = simple_strtol(buf, NULL, 10); 444 long val = simple_strtol(buf, NULL, 10);
433 int nr = attr->index; 445 int nr = attr->index;
434 446
447 /* +16 degrees offset for temp2 for the LM99 */
448 if (data->kind == lm99 && attr->index <= 2)
449 val -= 16000;
450
435 mutex_lock(&data->update_lock); 451 mutex_lock(&data->update_lock);
436 if (data->kind == adt7461) 452 if (data->kind == adt7461)
437 data->temp11[nr] = temp_to_u16_adt7461(data, val); 453 data->temp11[nr] = temp_to_u16_adt7461(data, val);
@@ -461,9 +477,15 @@ static ssize_t show_temphyst(struct device *dev, struct device_attribute *devatt
461 477
462 if (data->kind == adt7461) 478 if (data->kind == adt7461)
463 temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); 479 temp = temp_from_u8_adt7461(data, data->temp8[attr->index]);
480 else if (data->kind == max6646)
481 temp = temp_from_u8(data->temp8[attr->index]);
464 else 482 else
465 temp = temp_from_s8(data->temp8[attr->index]); 483 temp = temp_from_s8(data->temp8[attr->index]);
466 484
485 /* +16 degrees offset for temp2 for the LM99 */
486 if (data->kind == lm99 && attr->index == 3)
487 temp += 16000;
488
467 return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); 489 return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst));
468} 490}
469 491
@@ -473,12 +495,19 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy,
473 struct i2c_client *client = to_i2c_client(dev); 495 struct i2c_client *client = to_i2c_client(dev);
474 struct lm90_data *data = i2c_get_clientdata(client); 496 struct lm90_data *data = i2c_get_clientdata(client);
475 long val = simple_strtol(buf, NULL, 10); 497 long val = simple_strtol(buf, NULL, 10);
476 long hyst; 498 int temp;
477 499
478 mutex_lock(&data->update_lock); 500 mutex_lock(&data->update_lock);
479 hyst = temp_from_s8(data->temp8[2]) - val; 501 if (data->kind == adt7461)
502 temp = temp_from_u8_adt7461(data, data->temp8[2]);
503 else if (data->kind == max6646)
504 temp = temp_from_u8(data->temp8[2]);
505 else
506 temp = temp_from_s8(data->temp8[2]);
507
508 data->temp_hyst = hyst_to_reg(temp - val);
480 i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, 509 i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,
481 hyst_to_reg(hyst)); 510 data->temp_hyst);
482 mutex_unlock(&data->update_lock); 511 mutex_unlock(&data->update_lock);
483 return count; 512 return count;
484} 513}
@@ -682,6 +711,15 @@ static int lm90_detect(struct i2c_client *new_client, int kind,
682 } else 711 } else
683 if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ 712 if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */
684 kind = lm99; 713 kind = lm99;
714 dev_info(&adapter->dev,
715 "Assuming LM99 chip at "
716 "0x%02x\n", address);
717 dev_info(&adapter->dev,
718 "If it is an LM89, pass "
719 "force_lm86=%d,0x%02x when "
720 "loading the lm90 driver\n",
721 i2c_adapter_id(adapter),
722 address);
685 } else 723 } else
686 if (address == 0x4C 724 if (address == 0x4C
687 && (chip_id & 0xF0) == 0x10) { /* LM86 */ 725 && (chip_id & 0xF0) == 0x10) { /* LM86 */
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index d4d1b859d4f1..fc12bd412e3a 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1968,7 +1968,7 @@ exit:
1968 return res; 1968 return res;
1969} 1969}
1970 1970
1971static void __exit 1971static void
1972w83781d_isa_unregister(void) 1972w83781d_isa_unregister(void)
1973{ 1973{
1974 if (pdev) { 1974 if (pdev) {
@@ -2017,7 +2017,7 @@ w83781d_isa_register(void)
2017 return 0; 2017 return 0;
2018} 2018}
2019 2019
2020static void __exit 2020static void
2021w83781d_isa_unregister(void) 2021w83781d_isa_unregister(void)
2022{ 2022{
2023} 2023}
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index 76bdc9a27f6f..2d848010499d 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -690,9 +690,9 @@ static int __init icside_init(void)
690 return ecard_register_driver(&icside_driver); 690 return ecard_register_driver(&icside_driver);
691} 691}
692 692
693static void __exit icside_exit(void); 693static void __exit icside_exit(void)
694{ 694{
695 ecard_unregister_driver(&icside_driver); 695 ecard_remove_driver(&icside_driver);
696} 696}
697 697
698MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 698MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
diff --git a/drivers/ide/rapide.c b/drivers/ide/rapide.c
index 78d27d9ae430..d5003ca69801 100644
--- a/drivers/ide/rapide.c
+++ b/drivers/ide/rapide.c
@@ -11,7 +11,7 @@
11 11
12#include <asm/ecard.h> 12#include <asm/ecard.h>
13 13
14static struct const ide_port_info rapide_port_info = { 14static const struct ide_port_info rapide_port_info = {
15 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, 15 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
16}; 16};
17 17
@@ -97,7 +97,7 @@ static int __init rapide_init(void)
97 97
98static void __exit rapide_exit(void) 98static void __exit rapide_exit(void)
99{ 99{
100 ecard_unregister_driver(&rapide_driver); 100 ecard_remove_driver(&rapide_driver);
101} 101}
102 102
103MODULE_LICENSE("GPL"); 103MODULE_LICENSE("GPL");
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 2b4e975770f3..4b7cb389dc49 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1915,92 +1915,6 @@ static void rtl_disable_msi(struct pci_dev *pdev, struct rtl8169_private *tp)
1915 } 1915 }
1916} 1916}
1917 1917
1918static int rtl_eeprom_read(struct pci_dev *pdev, int cap, int addr, __le32 *val)
1919{
1920 int ret, count = 100;
1921 u16 status = 0;
1922 u32 value;
1923
1924 ret = pci_write_config_word(pdev, cap + PCI_VPD_ADDR, addr);
1925 if (ret < 0)
1926 return ret;
1927
1928 do {
1929 udelay(10);
1930 ret = pci_read_config_word(pdev, cap + PCI_VPD_ADDR, &status);
1931 if (ret < 0)
1932 return ret;
1933 } while (!(status & PCI_VPD_ADDR_F) && --count);
1934
1935 if (!(status & PCI_VPD_ADDR_F))
1936 return -ETIMEDOUT;
1937
1938 ret = pci_read_config_dword(pdev, cap + PCI_VPD_DATA, &value);
1939 if (ret < 0)
1940 return ret;
1941
1942 *val = cpu_to_le32(value);
1943
1944 return 0;
1945}
1946
1947static void rtl_init_mac_address(struct rtl8169_private *tp,
1948 void __iomem *ioaddr)
1949{
1950 struct pci_dev *pdev = tp->pci_dev;
1951 int vpd_cap;
1952 __le32 sig;
1953 u8 mac[8];
1954 u8 cfg1;
1955
1956 cfg1 = RTL_R8(Config1);
1957 if (!(cfg1 & VPD)) {
1958 if (netif_msg_probe(tp))
1959 dev_info(&pdev->dev, "VPD access disabled, enabling\n");
1960 RTL_W8(Cfg9346, Cfg9346_Unlock);
1961 RTL_W8(Config1, cfg1 | VPD);
1962 RTL_W8(Cfg9346, Cfg9346_Lock);
1963 }
1964
1965 vpd_cap = pci_find_capability(pdev, PCI_CAP_ID_VPD);
1966 if (!vpd_cap)
1967 return;
1968
1969 if (rtl_eeprom_read(pdev, vpd_cap, RTL_EEPROM_SIG_ADDR, &sig) < 0)
1970 return;
1971
1972 if ((sig & RTL_EEPROM_SIG_MASK) != RTL_EEPROM_SIG) {
1973 dev_info(&pdev->dev, "Missing EEPROM signature: %08x\n", sig);
1974 return;
1975 }
1976
1977 /*
1978 * MAC address is stored in EEPROM at offset 0x0e
1979 * Realtek says: "The VPD address does not have to be a DWORD-aligned
1980 * address as defined in the PCI 2.2 Specifications, but the VPD data
1981 * is always consecutive 4-byte data starting from the VPD address
1982 * specified."
1983 */
1984 if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 ||
1985 rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) {
1986 if (netif_msg_probe(tp)) {
1987 dev_warn(&pdev->dev,
1988 "reading MAC address from EEPROM failed\n");
1989 }
1990 return;
1991 }
1992
1993 if (netif_msg_probe(tp)) {
1994 DECLARE_MAC_BUF(buf);
1995
1996 dev_info(&pdev->dev, "MAC address found in EEPROM: %s\n",
1997 print_mac(buf, mac));
1998 }
1999
2000 if (is_valid_ether_addr(mac))
2001 rtl_rar_set(tp, mac);
2002}
2003
2004static int __devinit 1918static int __devinit
2005rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 1919rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2006{ 1920{
@@ -2178,8 +2092,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2178 2092
2179 tp->mmio_addr = ioaddr; 2093 tp->mmio_addr = ioaddr;
2180 2094
2181 rtl_init_mac_address(tp, ioaddr);
2182
2183 /* Get MAC address */ 2095 /* Get MAC address */
2184 for (i = 0; i < MAC_ADDR_LEN; i++) 2096 for (i = 0; i < MAC_ADDR_LEN; i++)
2185 dev->dev_addr[i] = RTL_R8(MAC0 + i); 2097 dev->dev_addr[i] = RTL_R8(MAC0 + i);