36 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
38 #include <linux/module.h>
40 #include <linux/slab.h>
42 #include <linux/i2c.h>
59 static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
65 static unsigned short force_subclients[4];
68 "{bus, clientaddr, subclientaddr1, subclientaddr2}");
81 #define W83781D_EXTENT 8
84 #define W83781D_ADDR_REG_OFFSET 5
85 #define W83781D_DATA_REG_OFFSET 6
89 #define W83781D_REG_IN_MAX(nr) ((nr < 7) ? (0x2b + (nr) * 2) : \
90 (0x554 + (((nr) - 7) * 2)))
91 #define W83781D_REG_IN_MIN(nr) ((nr < 7) ? (0x2c + (nr) * 2) : \
92 (0x555 + (((nr) - 7) * 2)))
93 #define W83781D_REG_IN(nr) ((nr < 7) ? (0x20 + (nr)) : \
97 #define W83781D_REG_FAN_MIN(nr) (0x3b + (nr))
98 #define W83781D_REG_FAN(nr) (0x28 + (nr))
100 #define W83781D_REG_BANK 0x4E
101 #define W83781D_REG_TEMP2_CONFIG 0x152
102 #define W83781D_REG_TEMP3_CONFIG 0x252
104 #define W83781D_REG_TEMP(nr) ((nr == 3) ? (0x0250) : \
105 ((nr == 2) ? (0x0150) : \
107 #define W83781D_REG_TEMP_HYST(nr) ((nr == 3) ? (0x253) : \
108 ((nr == 2) ? (0x153) : \
110 #define W83781D_REG_TEMP_OVER(nr) ((nr == 3) ? (0x255) : \
111 ((nr == 2) ? (0x155) : \
114 #define W83781D_REG_CONFIG 0x40
117 #define W83781D_REG_ALARM1 0x41
118 #define W83781D_REG_ALARM2 0x42
121 #define W83782D_REG_ALARM1 0x459
122 #define W83782D_REG_ALARM2 0x45A
123 #define W83782D_REG_ALARM3 0x45B
125 #define W83781D_REG_BEEP_CONFIG 0x4D
126 #define W83781D_REG_BEEP_INTS1 0x56
127 #define W83781D_REG_BEEP_INTS2 0x57
128 #define W83781D_REG_BEEP_INTS3 0x453
130 #define W83781D_REG_VID_FANDIV 0x47
132 #define W83781D_REG_CHIPID 0x49
133 #define W83781D_REG_WCHIPID 0x58
134 #define W83781D_REG_CHIPMAN 0x4F
135 #define W83781D_REG_PIN 0x4B
138 #define W83781D_REG_VBAT 0x5D
141 static const u8 W83781D_REG_PWM[] = { 0x5B, 0x5A, 0x5E, 0x5F };
142 #define W83781D_REG_PWMCLK12 0x5C
143 #define W83781D_REG_PWMCLK34 0x45C
145 #define W83781D_REG_I2C_ADDR 0x48
146 #define W83781D_REG_I2C_SUBADDR 0x4A
153 #define W83781D_REG_SCFG1 0x5D
154 static const u8 BIT_SCFG1[] = { 0x02, 0x04, 0x08 };
156 #define W83781D_REG_SCFG2 0x59
157 static const u8 BIT_SCFG2[] = { 0x10, 0x20, 0x40 };
159 #define W83781D_DEFAULT_BETA 3435
162 #define IN_TO_REG(val) SENSORS_LIMIT(((val) + 8) / 16, 0, 255)
163 #define IN_FROM_REG(val) ((val) * 16)
170 rpm = SENSORS_LIMIT(rpm, 1, 1000000);
171 return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254);
181 return 1350000 / (val *
div);
184 #define TEMP_TO_REG(val) SENSORS_LIMIT((val) / 1000, -127, 128)
185 #define TEMP_FROM_REG(val) ((val) * 1000)
187 #define BEEP_MASK_FROM_REG(val, type) ((type) == as99127f ? \
188 (~(val)) & 0x7fff : (val) & 0xff7fff)
189 #define BEEP_MASK_TO_REG(val, type) ((type) == as99127f ? \
190 (~(val)) & 0x7fff : (val) & 0xff7fff)
192 #define DIV_FROM_REG(val) (1 << (val))
198 val = SENSORS_LIMIT(val, 1,
200 || type ==
as99127f) ? 8 : 128)) >> 1;
201 for (i = 0; i < 7; i++) {
257 static void w83781d_init_device(
struct device *
dev);
260 #define show_in_reg(reg) \
261 static ssize_t show_##reg(struct device *dev, struct device_attribute *da, \
264 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
265 struct w83781d_data *data = w83781d_update_device(dev); \
266 return sprintf(buf, "%ld\n", \
267 (long)IN_FROM_REG(data->reg[attr->index])); \
273 #define store_in_reg(REG, reg) \
274 static ssize_t store_in_##reg(struct device *dev, struct device_attribute \
275 *da, const char *buf, size_t count) \
277 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
278 struct w83781d_data *data = dev_get_drvdata(dev); \
279 int nr = attr->index; \
281 int err = kstrtoul(buf, 10, &val); \
284 mutex_lock(&data->update_lock); \
285 data->in_##reg[nr] = IN_TO_REG(val); \
286 w83781d_write_value(data, W83781D_REG_IN_##REG(nr), \
287 data->in_##reg[nr]); \
289 mutex_unlock(&data->update_lock); \
295 #define sysfs_in_offsets(offset) \
296 static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \
297 show_in, NULL, offset); \
298 static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
299 show_in_min, store_in_min, offset); \
300 static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
301 show_in_max, store_in_max, offset)
313 #define show_fan_reg(reg) \
314 static ssize_t show_##reg(struct device *dev, struct device_attribute *da, \
317 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
318 struct w83781d_data *data = w83781d_update_device(dev); \
319 return sprintf(buf, "%ld\n", \
320 FAN_FROM_REG(data->reg[attr->index], \
321 DIV_FROM_REG(data->fan_div[attr->index]))); \
336 err = kstrtoul(buf, 10, &val);
352 show_fan_min, store_fan_min, 0);
355 show_fan_min, store_fan_min, 1);
358 show_fan_min, store_fan_min, 2);
360 #define show_temp_reg(reg) \
361 static ssize_t show_##reg(struct device *dev, struct device_attribute *da, \
364 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
365 struct w83781d_data *data = w83781d_update_device(dev); \
366 int nr = attr->index; \
368 return sprintf(buf, "%d\n", \
369 LM75_TEMP_FROM_REG(data->reg##_add[nr-2])); \
371 return sprintf(buf, "%ld\n", (long)TEMP_FROM_REG(data->reg)); \
378 #define store_temp_reg(REG, reg) \
379 static ssize_t store_temp_##reg(struct device *dev, \
380 struct device_attribute *da, const char *buf, size_t count) \
382 struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
383 struct w83781d_data *data = dev_get_drvdata(dev); \
384 int nr = attr->index; \
386 int err = kstrtol(buf, 10, &val); \
389 mutex_lock(&data->update_lock); \
392 data->temp_##reg##_add[nr-2] = LM75_TEMP_TO_REG(val); \
393 w83781d_write_value(data, W83781D_REG_TEMP_##REG(nr), \
394 data->temp_##reg##_add[nr-2]); \
396 data->temp_##reg = TEMP_TO_REG(val); \
397 w83781d_write_value(data, W83781D_REG_TEMP_##REG(nr), \
401 mutex_unlock(&data->update_lock); \
407 #define sysfs_temp_offsets(offset) \
408 static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
409 show_temp, NULL, offset); \
410 static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
411 show_temp_max, store_temp_max, offset); \
412 static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
413 show_temp_max_hyst, store_temp_max_hyst, offset);
432 return sprintf(buf,
"%ld\n", (
long) data->
vrm);
437 const char *buf,
size_t count)
443 err = kstrtoul(buf, 10, &val);
446 data->
vrm = SENSORS_LIMIT(val, 0, 255);
505 const char *buf,
size_t count)
511 err = kstrtoul(buf, 10, &val);
532 show_beep_mask, store_beep_mask);
544 const char *buf,
size_t count)
552 err = kstrtoul(buf, 10, &bit);
570 reg &= ~(1 << bitnr);
572 }
else if (bitnr < 16) {
575 reg |= (1 << (bitnr - 8));
577 reg &= ~(1 << (bitnr - 8));
582 reg |= (1 << (bitnr - 16));
584 reg &= ~(1 << (bitnr - 16));
602 show_beep, store_beep, 0);
604 show_beep, store_beep, 1);
606 show_beep, store_beep, 2);
608 show_beep, store_beep, 3);
610 show_beep, store_beep, 8);
612 show_beep, store_beep, 9);
614 show_beep, store_beep, 10);
616 show_beep, store_beep, 16);
618 show_beep, store_beep, 17);
620 show_beep, store_beep, 6);
622 show_beep, store_beep, 7);
624 show_beep, store_beep, 11);
626 show_beep, store_beep, 4);
628 show_beep, store_beep, 5);
630 show_temp3_beep, store_beep, 13);
632 show_beep, store_beep, 15);
651 const char *buf,
size_t count)
656 int nr = attr->
index;
661 err = kstrtoul(buf, 10, &val);
673 reg = (w83781d_read_value(data, nr == 2 ?
675 & (nr == 0 ? 0xcf : 0x3f))
676 | ((data->
fan_div[
nr] & 0x03) << (nr == 0 ? 4 : 6));
677 w83781d_write_value(data, nr == 2 ?
684 | ((data->
fan_div[nr] & 0x04) << (3 +
nr));
697 show_fan_div, store_fan_div, 0);
699 show_fan_div, store_fan_div, 1);
701 show_fan_div, store_fan_div, 2);
724 int nr = attr->
index;
728 err = kstrtoul(buf, 10, &val);
733 data->
pwm[
nr] = SENSORS_LIMIT(val, 0, 255);
734 w83781d_write_value(data, W83781D_REG_PWM[nr], data->
pwm[nr]);
741 const char *buf,
size_t count)
748 err = kstrtoul(buf, 10, &val);
759 (reg & 0xf7) | (val << 3));
763 (reg & 0xef) | (!val << 4));
783 show_pwm2_enable, store_pwm2_enable);
795 const char *buf,
size_t count)
799 int nr = attr->
index;
804 err = kstrtoul(buf, 10, &val);
814 tmp | BIT_SCFG1[nr]);
817 tmp | BIT_SCFG2[nr]);
823 tmp | BIT_SCFG1[nr]);
826 tmp & ~BIT_SCFG2[nr]);
830 dev_warn(dev,
"Sensor type %d is deprecated, please use 4 "
836 tmp & ~BIT_SCFG1[nr]);
840 dev_err(dev,
"Invalid sensor type %ld; must be 1, 2, or 4\n",
850 show_sensor, store_sensor, 0);
852 show_sensor, store_sensor, 1);
854 show_sensor, store_sensor, 2);
861 w83781d_detect_subclients(
struct i2c_client *new_client)
866 unsigned short sc_addr[2];
868 struct w83781d_data *data = i2c_get_clientdata(new_client);
872 id = i2c_adapter_id(adapter);
874 if (force_subclients[0] ==
id && force_subclients[1] == address) {
875 for (i = 2; i <= 3; i++) {
876 if (force_subclients[i] < 0x48 ||
877 force_subclients[i] > 0x4f) {
878 dev_err(&new_client->
dev,
"Invalid subclient "
879 "address %d; must be 0x48-0x4f\n",
880 force_subclients[i]);
886 (force_subclients[2] & 0x07) |
887 ((force_subclients[3] & 0x07) << 4));
888 sc_addr[0] = force_subclients[2];
891 sc_addr[0] = 0x48 + (val1 & 0x07);
896 if (force_subclients[0] ==
id &&
897 force_subclients[1] == address) {
898 sc_addr[1] = force_subclients[3];
900 sc_addr[1] = 0x48 + ((val1 >> 4) & 0x07);
902 if (sc_addr[0] == sc_addr[1]) {
904 "Duplicate addresses 0x%x for subclients.\n",
911 for (i = 0; i < num_sc; i++) {
913 if (!data->
lm75[i]) {
915 "registration at address 0x%x "
916 "failed.\n", i, sc_addr[i]);
934 #define IN_UNIT_ATTRS(X) \
935 &sensor_dev_attr_in##X##_input.dev_attr.attr, \
936 &sensor_dev_attr_in##X##_min.dev_attr.attr, \
937 &sensor_dev_attr_in##X##_max.dev_attr.attr, \
938 &sensor_dev_attr_in##X##_alarm.dev_attr.attr, \
939 &sensor_dev_attr_in##X##_beep.dev_attr.attr
941 #define FAN_UNIT_ATTRS(X) \
942 &sensor_dev_attr_fan##X##_input.dev_attr.attr, \
943 &sensor_dev_attr_fan##X##_min.dev_attr.attr, \
944 &sensor_dev_attr_fan##X##_div.dev_attr.attr, \
945 &sensor_dev_attr_fan##X##_alarm.dev_attr.attr, \
946 &sensor_dev_attr_fan##X##_beep.dev_attr.attr
948 #define TEMP_UNIT_ATTRS(X) \
949 &sensor_dev_attr_temp##X##_input.dev_attr.attr, \
950 &sensor_dev_attr_temp##X##_max.dev_attr.attr, \
951 &sensor_dev_attr_temp##X##_max_hyst.dev_attr.attr, \
952 &sensor_dev_attr_temp##X##_alarm.dev_attr.attr, \
953 &sensor_dev_attr_temp##X##_beep.dev_attr.attr
955 static struct attribute *w83781d_attributes[] = {
967 &dev_attr_cpu0_vid.attr,
969 &dev_attr_alarms.attr,
970 &dev_attr_beep_mask.attr,
971 &sensor_dev_attr_beep_enable.dev_attr.attr,
975 .attrs = w83781d_attributes,
978 static struct attribute *w83781d_attributes_in1[] = {
983 .attrs = w83781d_attributes_in1,
986 static struct attribute *w83781d_attributes_in78[] = {
992 .attrs = w83781d_attributes_in78,
995 static struct attribute *w83781d_attributes_temp3[] = {
1000 .attrs = w83781d_attributes_temp3,
1003 static struct attribute *w83781d_attributes_pwm12[] = {
1004 &sensor_dev_attr_pwm1.dev_attr.attr,
1005 &sensor_dev_attr_pwm2.dev_attr.attr,
1006 &dev_attr_pwm2_enable.attr,
1010 .attrs = w83781d_attributes_pwm12,
1013 static struct attribute *w83781d_attributes_pwm34[] = {
1014 &sensor_dev_attr_pwm3.dev_attr.attr,
1015 &sensor_dev_attr_pwm4.dev_attr.attr,
1019 .attrs = w83781d_attributes_pwm34,
1022 static struct attribute *w83781d_attributes_other[] = {
1023 &sensor_dev_attr_temp1_type.dev_attr.attr,
1024 &sensor_dev_attr_temp2_type.dev_attr.attr,
1025 &sensor_dev_attr_temp3_type.dev_attr.attr,
1029 .attrs = w83781d_attributes_other,
1034 w83781d_create_files(
struct device *dev,
int kind,
int is_isa)
1059 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
1071 if (kind ==
w83782d && !is_isa) {
1079 &sensor_dev_attr_temp1_type.dev_attr);
1083 &sensor_dev_attr_temp2_type.dev_attr);
1088 &sensor_dev_attr_temp3_type.dev_attr);
1104 int address = client->
addr;
1105 const char *client_name;
1121 "Detection of w83781d chip failed at step 3\n");
1128 if (!(val1 & 0x07) &&
1129 ((!(val1 & 0x80) && val2 != 0xa3 && val2 != 0xc3) ||
1130 ((val1 & 0x80) && val2 != 0x5c && val2 != 0x12))) {
1132 "Detection of w83781d chip failed at step 4\n");
1139 if ((!(val1 & 0x80) && val2 == 0xa3) ||
1140 ((val1 & 0x80) && val2 == 0x5c)) {
1144 "Detection of w83781d chip failed at step 5\n");
1158 else if (val2 == 0x12)
1162 "w83781d chip vendor is neither Winbond nor Asus\n");
1168 if ((val1 == 0x10 || val1 == 0x11) &&
vendid == winbond)
1169 client_name =
"w83781d";
1170 else if (val1 == 0x30 &&
vendid == winbond)
1171 client_name =
"w83782d";
1172 else if (val1 == 0x40 &&
vendid == winbond && address == 0x2d)
1173 client_name =
"w83783s";
1174 else if (val1 == 0x31)
1175 client_name =
"as99127f";
1179 if (val1 <= 0x30 && w83781d_alias_detect(client, val1)) {
1180 dev_dbg(&adapter->
dev,
"Device at 0x%02x appears to "
1181 "be the same as ISA device\n", address);
1198 static void w83781d_remove_files(
struct device *dev)
1220 i2c_set_clientdata(client, data);
1224 data->
type =
id->driver_data;
1228 err = w83781d_detect_subclients(client);
1233 w83781d_init_device(dev);
1236 err = w83781d_create_files(dev, data->
type, 0);
1238 goto exit_remove_files;
1243 goto exit_remove_files;
1249 w83781d_remove_files(dev);
1260 struct w83781d_data *data = i2c_get_clientdata(client);
1264 w83781d_remove_files(dev);
1281 bank = (reg >> 8) & 0x0f;
1286 if (bank == 0 || bank > 2) {
1290 cl = data->
lm75[bank - 1];
1292 switch (reg & 0xff) {
1294 res = i2c_smbus_read_word_swapped(cl, 0);
1300 res = i2c_smbus_read_word_swapped(cl, 2);
1304 res = i2c_smbus_read_word_swapped(cl, 3);
1321 bank = (reg >> 8) & 0x0f;
1326 if (bank == 0 || bank > 2) {
1331 cl = data->
lm75[bank - 1];
1333 switch (reg & 0xff) {
1338 i2c_smbus_write_word_swapped(cl, 2, value);
1341 i2c_smbus_write_word_swapped(cl, 3, value);
1352 w83781d_init_device(
struct device *dev)
1371 dev_info(dev,
"If reset=1 solved a problem you were "
1372 "having, please report!\n");
1409 for (i = 1; i <= 3; i++) {
1410 if (!(tmp & BIT_SCFG1[i - 1])) {
1411 data->
sens[i - 1] = 4;
1413 if (w83781d_read_value
1416 data->
sens[i - 1] = 1;
1418 data->
sens[i - 1] = 2;
1420 if (type ==
w83783s && i == 2)
1429 dev_warn(dev,
"Enabling temp2, readings "
1430 "might not make sense\n");
1437 tmp = w83781d_read_value(data,
1441 "readings might not make sense\n");
1442 w83781d_write_value(data,
1450 (w83781d_read_value(data,
1455 for (i = 0; i < 3; i++) {
1456 data->
fan_min[
i] = w83781d_read_value(data,
1473 dev_dbg(dev,
"Starting device update\n");
1475 for (i = 0; i <= 8; i++) {
1487 for (i = 0; i < 3; i++) {
1494 for (i = 0; i < 4; i++) {
1496 w83781d_read_value(data,
1497 W83781D_REG_PWM[i]);
1523 w83781d_read_value(data,
1526 w83781d_read_value(data,
1530 data->
vid = i & 0x0f;
1531 data->
vid |= (w83781d_read_value(data,
1533 data->
fan_div[0] = (i >> 4) & 0x03;
1534 data->
fan_div[1] = (i >> 6) & 0x03;
1535 data->
fan_div[2] = (w83781d_read_value(data,
1539 data->
fan_div[0] |= (i >> 3) & 0x04;
1540 data->
fan_div[1] |= (i >> 4) & 0x04;
1541 data->
fan_div[2] |= (i >> 5) & 0x04;
1544 data->
alarms = w83781d_read_value(data,
1546 | (w83781d_read_value(data,
1548 | (w83781d_read_value(data,
1551 data->
alarms = w83781d_read_value(data,
1553 | (w83781d_read_value(data,
1560 data->
alarms = w83781d_read_value(data,
1562 | (w83781d_read_value(data,
1570 w83781d_read_value(data,
1596 .probe = w83781d_probe,
1597 .remove = w83781d_remove,
1598 .id_table = w83781d_ids,
1599 .detect = w83781d_detect,
1600 .address_list = normal_i2c,
1611 static unsigned short isa_address = 0x290;
1627 return pdev ? platform_get_drvdata(pdev) :
NULL;
1639 isa = platform_get_drvdata(pdev);
1650 for (i = 0x2b; i <= 0x3d; i++) {
1651 if (w83781d_read_value(isa, i) !=
1658 for (i = 0x43; i <= 0x46; i++) {
1659 if (w83781d_read_value(isa, i) !=
1670 int word_sized,
res;
1672 word_sized = (((reg & 0xff00) == 0x100)
1673 || ((reg & 0xff00) == 0x200))
1674 && (((reg & 0x00ff) == 0x50)
1675 || ((reg & 0x00ff) == 0x53)
1676 || ((reg & 0x00ff) == 0x55));
1705 word_sized = (((reg & 0xff00) == 0x100)
1706 || ((reg & 0xff00) == 0x200))
1707 && (((reg & 0x00ff) == 0x53)
1708 || ((reg & 0x00ff) == 0x55));
1746 res = w83781d_read_value_i2c(data, reg);
1748 res = w83781d_read_value_isa(data, reg);
1760 w83781d_write_value_i2c(data, reg, value);
1762 w83781d_write_value_isa(data, reg, value);
1788 platform_set_drvdata(pdev, data);
1794 data->
name =
"w83782d";
1798 data->
name =
"w83781d";
1802 w83781d_init_device(&pdev->
dev);
1805 err = w83781d_create_files(&pdev->
dev, data->
type, 1);
1807 goto exit_remove_files;
1811 goto exit_remove_files;
1816 goto exit_remove_files;
1822 w83781d_remove_files(&pdev->
dev);
1830 struct w83781d_data *data = platform_get_drvdata(pdev);
1833 w83781d_remove_files(&pdev->
dev);
1844 .probe = w83781d_isa_probe,
1850 w83781d_isa_found(
unsigned short address)
1852 int val, save, found = 0;
1862 pr_debug(
"Failed to request port 0x%x\n", port);
1867 #define REALLY_SLOW_IO
1872 val =
inb_p(address + 1);
1873 if (
inb_p(address + 2) != val
1874 ||
inb_p(address + 3) != val
1875 ||
inb_p(address + 7) != val) {
1876 pr_debug(
"Detection failed at step %d\n", 1);
1879 #undef REALLY_SLOW_IO
1887 pr_debug(
"Detection failed at step %d\n", 2);
1894 pr_debug(
"Detection failed at step %d\n", 3);
1902 pr_debug(
"Detection failed at step %d\n", 4);
1909 if ((!(save & 0x80) && (val != 0xa3))
1910 || ((save & 0x80) && (val != 0x5c))) {
1911 pr_debug(
"Detection failed at step %d\n", 5);
1916 if (val < 0x03 || val > 0x77) {
1917 pr_debug(
"Detection failed at step %d\n", 6);
1923 pr_debug(
"Detection failed at step %d\n", 7);
1933 if ((val & 0xfe) == 0x10
1938 pr_info(
"Found a %s chip at %#x\n",
1939 val == 0x30 ?
"W83782D" :
"W83781D", (
int)address);
1942 for (port--; port >=
address; port--)
1948 w83781d_isa_device_add(
unsigned short address)
1952 .end = address + W83781D_EXTENT - 1,
1961 pr_err(
"Device allocation failed\n");
1967 pr_err(
"Device resource addition failed (%d)\n", err);
1968 goto exit_device_put;
1973 pr_err(
"Device addition failed (%d)\n", err);
1974 goto exit_device_put;
1987 w83781d_isa_register(
void)
1991 if (w83781d_isa_found(isa_address)) {
1997 res = w83781d_isa_device_add(isa_address);
1999 goto exit_unreg_isa_driver;
2004 exit_unreg_isa_driver:
2011 w83781d_isa_unregister(
void)
2026 w83781d_alias_detect(
struct i2c_client *client,
u8 chipid)
2037 res = w83781d_read_value_i2c(data, reg);
2047 w83781d_write_value_i2c(data, reg, value);
2054 w83781d_isa_register(
void)
2060 w83781d_isa_unregister(
void)
2066 sensors_w83781d_init(
void)
2074 res = w83781d_isa_register();
2078 res = i2c_add_driver(&w83781d_driver);
2080 goto exit_unreg_isa;
2085 w83781d_isa_unregister();
2091 sensors_w83781d_exit(
void)
2093 w83781d_isa_unregister();