aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-14 11:22:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-14 11:22:57 -0500
commitb739db79a434aec89027a109d85de305e6bdeb93 (patch)
treee67bdf2272e9a3deedef7d65dfde03ccafb85074 /drivers
parent18539966bc1d663eb232877bb3e9e7dca67e89e6 (diff)
parent41d9c98fe76298cebc5907bcebfb2db28017a277 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/it87.c3
-rw-r--r--drivers/hwmon/vt8231.c8
-rw-r--r--drivers/hwmon/w83781d.c43
-rw-r--r--drivers/i2c/busses/i2c-isa.c12
4 files changed, 31 insertions, 35 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index e87d52c59940..d7a9401600bb 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1186,7 +1186,8 @@ static int __init sm_it87_init(void)
1186 1186
1187static void __exit sm_it87_exit(void) 1187static void __exit sm_it87_exit(void)
1188{ 1188{
1189 i2c_isa_del_driver(&it87_isa_driver); 1189 if (isa_address)
1190 i2c_isa_del_driver(&it87_isa_driver);
1190 i2c_del_driver(&it87_driver); 1191 i2c_del_driver(&it87_driver);
1191} 1192}
1192 1193
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
index 3eb08f004c0f..271e9cb9532c 100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@ -437,12 +437,12 @@ static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
437 show_temp, NULL, offset - 1); \ 437 show_temp, NULL, offset - 1); \
438static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ 438static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
439 show_temp_max, set_temp_max, offset - 1); \ 439 show_temp_max, set_temp_max, offset - 1); \
440static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ 440static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
441 show_temp_min, set_temp_min, offset - 1) 441 show_temp_min, set_temp_min, offset - 1)
442 442
443static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL); 443static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL);
444static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max); 444static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max);
445static DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min); 445static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
446 446
447define_temperature_sysfs(2); 447define_temperature_sysfs(2);
448define_temperature_sysfs(3); 448define_temperature_sysfs(3);
@@ -451,7 +451,7 @@ define_temperature_sysfs(5);
451define_temperature_sysfs(6); 451define_temperature_sysfs(6);
452 452
453#define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \ 453#define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \
454 &sensor_dev_attr_temp##id##_min.dev_attr, \ 454 &sensor_dev_attr_temp##id##_max_hyst.dev_attr, \
455 &sensor_dev_attr_temp##id##_max.dev_attr } 455 &sensor_dev_attr_temp##id##_max.dev_attr }
456#define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \ 456#define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \
457 &sensor_dev_attr_in##id##_min.dev_attr, \ 457 &sensor_dev_attr_in##id##_min.dev_attr, \
@@ -464,7 +464,7 @@ struct str_device_attr_table {
464}; 464};
465 465
466static struct str_device_attr_table cfg_info_temp[] = { 466static struct str_device_attr_table cfg_info_temp[] = {
467 { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max }, 467 { &dev_attr_temp1_input, &dev_attr_temp1_max_hyst, &dev_attr_temp1_max },
468 CFG_INFO_TEMP(2), 468 CFG_INFO_TEMP(2),
469 CFG_INFO_TEMP(3), 469 CFG_INFO_TEMP(3),
470 CFG_INFO_TEMP(4), 470 CFG_INFO_TEMP(4),
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 557114872f3c..64c1f8af5bb2 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -95,11 +95,16 @@ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
95 (0x39))) 95 (0x39)))
96 96
97#define W83781D_REG_CONFIG 0x40 97#define W83781D_REG_CONFIG 0x40
98
99/* Interrupt status (W83781D, AS99127F) */
98#define W83781D_REG_ALARM1 0x41 100#define W83781D_REG_ALARM1 0x41
99#define W83781D_REG_ALARM2 0x42 101#define W83781D_REG_ALARM2 0x42
100#define W83781D_REG_ALARM3 0x450 /* not on W83781D */
101 102
102#define W83781D_REG_IRQ 0x4C 103/* Real-time status (W83782D, W83783S, W83627HF) */
104#define W83782D_REG_ALARM1 0x459
105#define W83782D_REG_ALARM2 0x45A
106#define W83782D_REG_ALARM3 0x45B
107
103#define W83781D_REG_BEEP_CONFIG 0x4D 108#define W83781D_REG_BEEP_CONFIG 0x4D
104#define W83781D_REG_BEEP_INTS1 0x56 109#define W83781D_REG_BEEP_INTS1 0x56
105#define W83781D_REG_BEEP_INTS2 0x57 110#define W83781D_REG_BEEP_INTS2 0x57
@@ -1513,15 +1518,6 @@ w83781d_init_client(struct i2c_client *client)
1513 W83781D_REG_TEMP3_CONFIG, tmp & 0xfe); 1518 W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
1514 } 1519 }
1515 } 1520 }
1516
1517 if (type != w83781d) {
1518 /* enable comparator mode for temp2 and temp3 so
1519 alarm indication will work correctly */
1520 i = w83781d_read_value(client, W83781D_REG_IRQ);
1521 if (!(i & 0x40))
1522 w83781d_write_value(client, W83781D_REG_IRQ,
1523 i | 0x40);
1524 }
1525 } 1521 }
1526 1522
1527 /* Start monitoring */ 1523 /* Start monitoring */
@@ -1612,14 +1608,25 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
1612 data->fan_div[1] |= (i >> 4) & 0x04; 1608 data->fan_div[1] |= (i >> 4) & 0x04;
1613 data->fan_div[2] |= (i >> 5) & 0x04; 1609 data->fan_div[2] |= (i >> 5) & 0x04;
1614 } 1610 }
1615 data->alarms =
1616 w83781d_read_value(client,
1617 W83781D_REG_ALARM1) +
1618 (w83781d_read_value(client, W83781D_REG_ALARM2) << 8);
1619 if ((data->type == w83782d) || (data->type == w83627hf)) { 1611 if ((data->type == w83782d) || (data->type == w83627hf)) {
1620 data->alarms |= 1612 data->alarms = w83781d_read_value(client,
1621 w83781d_read_value(client, 1613 W83782D_REG_ALARM1)
1622 W83781D_REG_ALARM3) << 16; 1614 | (w83781d_read_value(client,
1615 W83782D_REG_ALARM2) << 8)
1616 | (w83781d_read_value(client,
1617 W83782D_REG_ALARM3) << 16);
1618 } else if (data->type == w83783s) {
1619 data->alarms = w83781d_read_value(client,
1620 W83782D_REG_ALARM1)
1621 | (w83781d_read_value(client,
1622 W83782D_REG_ALARM2) << 8);
1623 } else {
1624 /* No real-time status registers, fall back to
1625 interrupt status registers */
1626 data->alarms = w83781d_read_value(client,
1627 W83781D_REG_ALARM1)
1628 | (w83781d_read_value(client,
1629 W83781D_REG_ALARM2) << 8);
1623 } 1630 }
1624 i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2); 1631 i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2);
1625 data->beep_enable = i >> 7; 1632 data->beep_enable = i >> 7;
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index 9f2ffef4d812..4344ae6b1fcb 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -72,16 +72,6 @@ static ssize_t show_adapter_name(struct device *dev,
72} 72}
73static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL); 73static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
74 74
75static int i2c_isa_device_probe(struct device *dev)
76{
77 return -ENODEV;
78}
79
80static int i2c_isa_device_remove(struct device *dev)
81{
82 return 0;
83}
84
85 75
86/* We implement an interface which resembles i2c_{add,del}_driver, 76/* We implement an interface which resembles i2c_{add,del}_driver,
87 but for i2c-isa drivers. We don't have to remember and handle lists 77 but for i2c-isa drivers. We don't have to remember and handle lists
@@ -93,8 +83,6 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
93 83
94 /* Add the driver to the list of i2c drivers in the driver core */ 84 /* Add the driver to the list of i2c drivers in the driver core */
95 driver->driver.bus = &i2c_bus_type; 85 driver->driver.bus = &i2c_bus_type;
96 driver->driver.probe = i2c_isa_device_probe;
97 driver->driver.remove = i2c_isa_device_remove;
98 res = driver_register(&driver->driver); 86 res = driver_register(&driver->driver);
99 if (res) 87 if (res)
100 return res; 88 return res;