42 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
44 #include <linux/module.h>
46 #include <linux/slab.h>
61 #define DRVNAME "w83627hf"
69 static u8 force_i2c = 0x1f;
72 "Initialize the i2c address of the sensors");
78 static unsigned short force_id;
86 #define W83627HF_LD_FDC 0x00
87 #define W83627HF_LD_PRT 0x01
88 #define W83627HF_LD_UART1 0x02
89 #define W83627HF_LD_UART2 0x03
90 #define W83627HF_LD_KBC 0x05
91 #define W83627HF_LD_CIR 0x06
92 #define W83627HF_LD_GAME 0x07
93 #define W83627HF_LD_MIDI 0x07
94 #define W83627HF_LD_GPIO1 0x07
95 #define W83627HF_LD_GPIO5 0x07
96 #define W83627HF_LD_GPIO2 0x08
97 #define W83627HF_LD_GPIO3 0x09
98 #define W83627HF_LD_GPIO4 0x09
99 #define W83627HF_LD_ACPI 0x0a
100 #define W83627HF_LD_HWM 0x0b
104 #define W83627THF_GPIO5_EN 0x30
105 #define W83627THF_GPIO5_IOSR 0xf3
106 #define W83627THF_GPIO5_DR 0xf4
108 #define W83687THF_VID_EN 0x29
109 #define W83687THF_VID_CFG 0xF0
110 #define W83687THF_VID_DATA 0xF1
146 #define W627_DEVID 0x52
147 #define W627THF_DEVID 0x82
148 #define W697_DEVID 0x60
149 #define W637_DEVID 0x70
150 #define W687THF_DEVID 0x85
151 #define WINB_ACT_REG 0x30
152 #define WINB_BASE_REG 0x60
156 #define WINB_ALIGNMENT ~7
159 #define WINB_REGION_OFFSET 5
160 #define WINB_REGION_SIZE 2
163 #define W83781D_ADDR_REG_OFFSET 0
164 #define W83781D_DATA_REG_OFFSET 1
168 #define W83781D_REG_IN_MAX(nr) ((nr < 7) ? (0x2b + (nr) * 2) : \
169 (0x554 + (((nr) - 7) * 2)))
170 #define W83781D_REG_IN_MIN(nr) ((nr < 7) ? (0x2c + (nr) * 2) : \
171 (0x555 + (((nr) - 7) * 2)))
172 #define W83781D_REG_IN(nr) ((nr < 7) ? (0x20 + (nr)) : \
176 #define W83627HF_REG_FAN_MIN(nr) (0x3b + (nr))
177 #define W83627HF_REG_FAN(nr) (0x28 + (nr))
179 #define W83627HF_REG_TEMP2_CONFIG 0x152
180 #define W83627HF_REG_TEMP3_CONFIG 0x252
182 static const u16 w83627hf_reg_temp[] = { 0x27, 0x150, 0x250 };
183 static const u16 w83627hf_reg_temp_hyst[] = { 0x3A, 0x153, 0x253 };
184 static const u16 w83627hf_reg_temp_over[] = { 0x39, 0x155, 0x255 };
186 #define W83781D_REG_BANK 0x4E
188 #define W83781D_REG_CONFIG 0x40
189 #define W83781D_REG_ALARM1 0x459
190 #define W83781D_REG_ALARM2 0x45A
191 #define W83781D_REG_ALARM3 0x45B
193 #define W83781D_REG_BEEP_CONFIG 0x4D
194 #define W83781D_REG_BEEP_INTS1 0x56
195 #define W83781D_REG_BEEP_INTS2 0x57
196 #define W83781D_REG_BEEP_INTS3 0x453
198 #define W83781D_REG_VID_FANDIV 0x47
200 #define W83781D_REG_CHIPID 0x49
201 #define W83781D_REG_WCHIPID 0x58
202 #define W83781D_REG_CHIPMAN 0x4F
203 #define W83781D_REG_PIN 0x4B
205 #define W83781D_REG_VBAT 0x5D
207 #define W83627HF_REG_PWM1 0x5A
208 #define W83627HF_REG_PWM2 0x5B
210 static const u8 W83627THF_REG_PWM_ENABLE[] = {
215 static const u8 W83627THF_PWM_ENABLE_SHIFT[] = { 2, 4, 1 };
217 #define W83627THF_REG_PWM1 0x01
218 #define W83627THF_REG_PWM2 0x03
219 #define W83627THF_REG_PWM3 0x11
221 #define W83627THF_REG_VRM_OVT_CFG 0x18
226 #define W836X7HF_REG_PWM(type, nr) (((type) == w83627hf) ? \
227 regpwm_627hf[nr] : regpwm[nr])
229 #define W83627HF_REG_PWM_FREQ 0x5C
231 #define W83637HF_REG_PWM_FREQ1 0x00
232 #define W83637HF_REG_PWM_FREQ2 0x02
233 #define W83637HF_REG_PWM_FREQ3 0x10
239 #define W83627HF_BASE_PWM_FREQ 46870
241 #define W83781D_REG_I2C_ADDR 0x48
242 #define W83781D_REG_I2C_SUBADDR 0x4A
245 #define W83781D_REG_SCFG1 0x5D
246 static const u8 BIT_SCFG1[] = { 0x02, 0x04, 0x08 };
247 #define W83781D_REG_SCFG2 0x59
248 static const u8 BIT_SCFG2[] = { 0x10, 0x20, 0x40 };
249 #define W83781D_DEFAULT_BETA 3435
257 #define IN_TO_REG(val) (SENSORS_LIMIT((((val) + 8)/16),0,255))
258 #define IN_FROM_REG(val) ((val) * 16)
264 rpm = SENSORS_LIMIT(rpm, 1, 1000000);
265 return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1,
269 #define TEMP_MIN (-128000)
270 #define TEMP_MAX ( 127000)
279 ntemp += (ntemp<0 ? -500 : 500);
280 return (
u8)(ntemp / 1000);
285 return (
s8)reg * 1000;
288 #define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div)))
290 #define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255))
292 static inline unsigned long pwm_freq_from_reg_627hf(
u8 reg)
298 static inline u8 pwm_freq_to_reg_627hf(
unsigned long val)
305 for (i = 0; i < 4; i++) {
313 static inline unsigned long pwm_freq_from_reg(
u8 reg)
316 unsigned long clock = (reg & 0x80) ? 180000
UL : 24000000
UL;
322 return clock / (reg << 8);
324 static inline u8 pwm_freq_to_reg(
unsigned long val)
330 return 24000000
UL / (val << 8);
334 return 0x80 | (180000
UL / (val << 8));
337 #define BEEP_MASK_FROM_REG(val) ((val) & 0xff7fff)
338 #define BEEP_MASK_TO_REG(val) ((val) & 0xff7fff)
340 #define DIV_FROM_REG(val) (1 << (val))
345 val = SENSORS_LIMIT(val, 1, 128) >> 1;
346 for (i = 0; i < 7; i++) {
409 .probe = w83627hf_probe,
436 const char *buf,
size_t count)
443 err = kstrtol(buf, 10, &val);
455 const char *buf,
size_t count)
462 err = kstrtol(buf, 10, &val);
472 #define sysfs_vin_decl(offset) \
473 static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \
474 show_in_input, NULL, offset); \
475 static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO|S_IWUSR, \
476 show_in_min, store_in_min, offset); \
477 static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO|S_IWUSR, \
478 show_in_max, store_in_max, offset);
499 in0 = (
long)((reg * 488 + 70000 + 50) / 100);
504 return sprintf(buf,
"%ld\n", in0);
510 return show_in_0(data, buf, data->
in[0]);
516 return show_in_0(data, buf, data->
in_min[0]);
522 return show_in_0(data, buf, data->
in_max[0]);
526 const char *buf,
size_t count)
532 err = kstrtoul(buf, 10, &val);
544 SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
556 const char *buf,
size_t count)
562 err = kstrtoul(buf, 10, &val);
574 SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
587 show_regs_in_min0, store_regs_in_min0);
589 show_regs_in_max0, store_regs_in_max0);
609 const char *buf,
size_t count)
616 err = kstrtoul(buf, 10, &val);
628 #define sysfs_fan_decl(offset) \
629 static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
630 show_fan_input, NULL, offset - 1); \
631 static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
632 show_fan_min, store_fan_min, offset - 1);
645 return sprintf(buf,
"%ld\n", (nr) ? (
long) LM75_TEMP_FROM_REG(tmp)
657 return sprintf(buf,
"%ld\n", (nr) ? (
long) LM75_TEMP_FROM_REG(tmp)
669 return sprintf(buf,
"%ld\n", (nr) ? (
long) LM75_TEMP_FROM_REG(tmp)
675 const char *buf,
size_t count)
683 err = kstrtol(buf, 10, &val);
690 w83627hf_write_value(data, w83627hf_reg_temp_over[nr], tmp);
697 const char *buf,
size_t count)
705 err = kstrtol(buf, 10, &val);
712 w83627hf_write_value(data, w83627hf_reg_temp_hyst[nr], tmp);
717 #define sysfs_temp_decl(offset) \
718 static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
719 show_temp, NULL, offset - 1); \
720 static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO|S_IWUSR, \
721 show_temp_max, store_temp_max, offset - 1); \
722 static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO|S_IWUSR, \
723 show_temp_max_hyst, store_temp_max_hyst, offset - 1);
741 return sprintf(buf,
"%ld\n", (
long) data->
vrm);
750 err = kstrtoul(buf, 10, &val);
800 const char *buf,
size_t count)
806 err = kstrtoul(buf, 10, &val);
827 show_beep_mask, store_beep_mask);
839 const char *buf,
size_t count)
847 err = kstrtoul(buf, 10, &bit);
865 reg &= ~(1 << bitnr);
867 }
else if (bitnr < 16) {
870 reg |= (1 << (bitnr - 8));
872 reg &= ~(1 << (bitnr - 8));
877 reg |= (1 << (bitnr - 16));
879 reg &= ~(1 << (bitnr - 16));
888 show_beep, store_beep, 0);
890 show_beep, store_beep, 1);
892 show_beep, store_beep, 2);
894 show_beep, store_beep, 3);
896 show_beep, store_beep, 8);
898 show_beep, store_beep, 9);
900 show_beep, store_beep, 10);
902 show_beep, store_beep, 16);
904 show_beep, store_beep, 17);
906 show_beep, store_beep, 6);
908 show_beep, store_beep, 7);
910 show_beep, store_beep, 11);
912 show_beep, store_beep, 4);
914 show_beep, store_beep, 5);
916 show_beep, store_beep, 13);
918 show_beep, store_beep, 15);
936 const char *buf,
size_t count)
945 err = kstrtoul(buf, 10, &val);
958 & (nr==0 ? 0xcf : 0x3f))
959 | ((data->
fan_div[
nr] & 0x03) << (nr==0 ? 4 : 6));
964 | ((data->
fan_div[nr] & 0x04) << (3 +
nr));
976 show_fan_div, store_fan_div, 0);
978 show_fan_div, store_fan_div, 1);
980 show_fan_div, store_fan_div, 2);
987 return sprintf(buf,
"%ld\n", (
long) data->
pwm[nr]);
992 const char *buf,
size_t count)
999 err = kstrtoul(buf, 10, &val);
1008 w83627hf_write_value(data,
1011 (w83627hf_read_value(data,
1015 w83627hf_write_value(data,
1038 const char *buf,
size_t count)
1046 err = kstrtoul(buf, 10, &val);
1050 if (!val || val > 3)
1054 reg = w83627hf_read_value(data, W83627THF_REG_PWM_ENABLE[nr]);
1055 reg &= ~(0x03 << W83627THF_PWM_ENABLE_SHIFT[
nr]);
1056 reg |= (val - 1) << W83627THF_PWM_ENABLE_SHIFT[nr];
1057 w83627hf_write_value(data, W83627THF_REG_PWM_ENABLE[nr], reg);
1063 store_pwm_enable, 0);
1065 store_pwm_enable, 1);
1067 store_pwm_enable, 2);
1076 pwm_freq_from_reg_627hf(data->
pwm_freq[nr]));
1079 pwm_freq_from_reg(data->
pwm_freq[nr]));
1084 const char *buf,
size_t count)
1088 static const u8 mask[]={0xF8, 0x8F};
1092 err = kstrtoul(buf, 10, &val);
1099 data->
pwm_freq[
nr] = pwm_freq_to_reg_627hf(val);
1102 (w83627hf_read_value(data,
1106 w83627hf_write_value(data, W83637HF_REG_PWM_FREQ[nr],
1115 show_pwm_freq, store_pwm_freq, 0);
1117 show_pwm_freq, store_pwm_freq, 1);
1119 show_pwm_freq, store_pwm_freq, 2);
1127 return sprintf(buf,
"%ld\n", (
long) data->
sens[nr]);
1132 const char *buf,
size_t count)
1140 err = kstrtoul(buf, 10, &val);
1150 tmp | BIT_SCFG1[nr]);
1153 tmp | BIT_SCFG2[nr]);
1159 tmp | BIT_SCFG1[nr]);
1162 tmp & ~BIT_SCFG2[nr]);
1166 dev_warn(dev,
"Sensor type %d is deprecated, please use 4 "
1172 tmp & ~BIT_SCFG1[nr]);
1177 "Invalid sensor type %ld; must be 1, 2, or 4\n",
1186 #define sysfs_temp_type(offset) \
1187 static SENSOR_DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \
1188 show_temp_type, store_temp_type, offset - 1);
1203 static int __init w83627hf_find(
int sioaddr,
unsigned short *
addr,
1218 superio_enter(sio_data);
1219 val = force_id ? force_id : superio_inb(sio_data,
DEVID);
1248 pr_warn(
"Base address not set, skipping\n");
1253 if (!(val & 0x01)) {
1254 pr_warn(
"Enabling HWM logical device\n");
1260 names[sio_data->
type], *addr);
1263 superio_exit(sio_data);
1267 #define VIN_UNIT_ATTRS(_X_) \
1268 &sensor_dev_attr_in##_X_##_input.dev_attr.attr, \
1269 &sensor_dev_attr_in##_X_##_min.dev_attr.attr, \
1270 &sensor_dev_attr_in##_X_##_max.dev_attr.attr, \
1271 &sensor_dev_attr_in##_X_##_alarm.dev_attr.attr, \
1272 &sensor_dev_attr_in##_X_##_beep.dev_attr.attr
1274 #define FAN_UNIT_ATTRS(_X_) \
1275 &sensor_dev_attr_fan##_X_##_input.dev_attr.attr, \
1276 &sensor_dev_attr_fan##_X_##_min.dev_attr.attr, \
1277 &sensor_dev_attr_fan##_X_##_div.dev_attr.attr, \
1278 &sensor_dev_attr_fan##_X_##_alarm.dev_attr.attr, \
1279 &sensor_dev_attr_fan##_X_##_beep.dev_attr.attr
1281 #define TEMP_UNIT_ATTRS(_X_) \
1282 &sensor_dev_attr_temp##_X_##_input.dev_attr.attr, \
1283 &sensor_dev_attr_temp##_X_##_max.dev_attr.attr, \
1284 &sensor_dev_attr_temp##_X_##_max_hyst.dev_attr.attr, \
1285 &sensor_dev_attr_temp##_X_##_type.dev_attr.attr, \
1286 &sensor_dev_attr_temp##_X_##_alarm.dev_attr.attr, \
1287 &sensor_dev_attr_temp##_X_##_beep.dev_attr.attr
1289 static struct attribute *w83627hf_attributes[] = {
1290 &dev_attr_in0_input.attr,
1291 &dev_attr_in0_min.attr,
1292 &dev_attr_in0_max.attr,
1293 &sensor_dev_attr_in0_alarm.dev_attr.attr,
1294 &sensor_dev_attr_in0_beep.dev_attr.attr,
1307 &dev_attr_alarms.attr,
1308 &sensor_dev_attr_beep_enable.dev_attr.attr,
1309 &dev_attr_beep_mask.attr,
1311 &sensor_dev_attr_pwm1.dev_attr.attr,
1312 &sensor_dev_attr_pwm2.dev_attr.attr,
1313 &dev_attr_name.attr,
1318 .attrs = w83627hf_attributes,
1321 static struct attribute *w83627hf_attributes_opt[] = {
1328 &sensor_dev_attr_pwm3.dev_attr.attr,
1330 &sensor_dev_attr_pwm1_freq.dev_attr.attr,
1331 &sensor_dev_attr_pwm2_freq.dev_attr.attr,
1332 &sensor_dev_attr_pwm3_freq.dev_attr.attr,
1334 &sensor_dev_attr_pwm1_enable.dev_attr.attr,
1335 &sensor_dev_attr_pwm2_enable.dev_attr.attr,
1336 &sensor_dev_attr_pwm3_enable.dev_attr.attr,
1342 .attrs = w83627hf_attributes_opt,
1353 static const char *names[] = {
1363 dev_err(dev,
"Failed to request region 0x%lx-0x%lx\n",
1364 (
unsigned long)res->
start,
1375 data->
name = names[sio_data->
type];
1378 platform_set_drvdata(pdev, data);
1381 w83627hf_init_device(pdev);
1384 for (i = 0; i <= 2; i++)
1385 data->
fan_min[i] = w83627hf_read_value(
1387 w83627hf_update_fan_div(data);
1397 &sensor_dev_attr_in5_input.dev_attr))
1399 &sensor_dev_attr_in5_min.dev_attr))
1401 &sensor_dev_attr_in5_max.dev_attr))
1403 &sensor_dev_attr_in5_alarm.dev_attr))
1405 &sensor_dev_attr_in5_beep.dev_attr))
1407 &sensor_dev_attr_in6_input.dev_attr))
1409 &sensor_dev_attr_in6_min.dev_attr))
1411 &sensor_dev_attr_in6_max.dev_attr))
1413 &sensor_dev_attr_in6_alarm.dev_attr))
1415 &sensor_dev_attr_in6_beep.dev_attr))
1417 &sensor_dev_attr_pwm1_freq.dev_attr))
1419 &sensor_dev_attr_pwm2_freq.dev_attr)))
1424 &sensor_dev_attr_in1_input.dev_attr))
1426 &sensor_dev_attr_in1_min.dev_attr))
1428 &sensor_dev_attr_in1_max.dev_attr))
1430 &sensor_dev_attr_in1_alarm.dev_attr))
1432 &sensor_dev_attr_in1_beep.dev_attr))
1434 &sensor_dev_attr_fan3_input.dev_attr))
1436 &sensor_dev_attr_fan3_min.dev_attr))
1438 &sensor_dev_attr_fan3_div.dev_attr))
1440 &sensor_dev_attr_fan3_alarm.dev_attr))
1442 &sensor_dev_attr_fan3_beep.dev_attr))
1444 &sensor_dev_attr_temp3_input.dev_attr))
1446 &sensor_dev_attr_temp3_max.dev_attr))
1448 &sensor_dev_attr_temp3_max_hyst.dev_attr))
1450 &sensor_dev_attr_temp3_alarm.dev_attr))
1452 &sensor_dev_attr_temp3_beep.dev_attr))
1454 &sensor_dev_attr_temp3_type.dev_attr)))
1475 &sensor_dev_attr_pwm1_freq.dev_attr))
1477 &sensor_dev_attr_pwm2_freq.dev_attr))
1479 &sensor_dev_attr_pwm3_freq.dev_attr)))
1484 &sensor_dev_attr_pwm1_enable.dev_attr))
1486 &sensor_dev_attr_pwm2_enable.dev_attr)))
1492 &sensor_dev_attr_pwm3_enable.dev_attr);
1527 if ((reg & 0x00f0) == 0x50) {
1534 static inline void w83627hf_reset_bank(
struct w83627hf_data *data,
u16 reg)
1544 int res, word_sized;
1547 word_sized = (((reg & 0xff00) == 0x100)
1548 || ((reg & 0xff00) == 0x200))
1549 && (((reg & 0x00ff) == 0x50)
1550 || ((reg & 0x00ff) == 0x53)
1551 || ((reg & 0x00ff) == 0x55));
1552 w83627hf_set_bank(data, reg);
1562 w83627hf_reset_bank(data, reg);
1570 int res = 0xff,
sel;
1572 superio_enter(sio_data);
1577 dev_dbg(&pdev->
dev,
"GPIO5 disabled, no VID function\n");
1586 if ((
sel & 0x1f) != 0x1f) {
1587 dev_dbg(&pdev->
dev,
"GPIO5 not configured for VID "
1596 superio_exit(sio_data);
1605 superio_enter(sio_data);
1610 dev_dbg(&pdev->
dev,
"VID disabled, no VID function\n");
1616 dev_dbg(&pdev->
dev,
"VID configured as output, "
1617 "no VID function\n");
1624 superio_exit(sio_data);
1633 word_sized = (((reg & 0xff00) == 0x100)
1634 || ((reg & 0xff00) == 0x200))
1635 && (((reg & 0x00ff) == 0x53)
1636 || ((reg & 0x00ff) == 0x55));
1637 w83627hf_set_bank(data, reg);
1647 w83627hf_reset_bank(data, reg);
1669 data->
vid = (lo & 0x0f) | ((hi & 0x01) << 4);
1671 data->
vid = w83627thf_read_gpio5(pdev);
1673 data->
vid = w83687thf_read_vid(pdev);
1683 for (i = 1; i <= 3; i++) {
1684 if (!(tmp & BIT_SCFG1[i - 1])) {
1685 data->
sens[i - 1] = 4;
1687 if (w83627hf_read_value
1690 data->
sens[i - 1] = 1;
1692 data->
sens[i - 1] = 2;
1694 if ((type ==
w83697hf) && (i == 2))
1703 "might not make sense\n");
1710 tmp = w83627hf_read_value(data,
1714 "readings might not make sense\n");
1715 w83627hf_write_value(data,
1723 (w83627hf_read_value(data,
1733 static void w83627hf_update_fan_div(
struct w83627hf_data *data)
1738 data->
fan_div[0] = (reg >> 4) & 0x03;
1739 data->
fan_div[1] = (reg >> 6) & 0x03;
1741 data->
fan_div[2] = (w83627hf_read_value(data,
1745 data->
fan_div[0] |= (reg >> 3) & 0x04;
1746 data->
fan_div[1] |= (reg >> 4) & 0x04;
1748 data->
fan_div[2] |= (reg >> 5) & 0x04;
1761 for (i = 0; i <= 8; i++) {
1765 && (i == 5 || i == 6)))
1770 w83627hf_read_value(data,
1773 w83627hf_read_value(data,
1776 for (i = 0; i <= 2; i++) {
1780 w83627hf_read_value(data,
1783 for (i = 0; i <= 2; i++) {
1784 u8 tmp = w83627hf_read_value(data,
1795 u8 tmp = w83627hf_read_value(data,
1798 data->
pwm_freq[1] = (tmp >> 4) & 0x07;
1800 for (i = 1; i <= 3; i++) {
1802 w83627hf_read_value(data,
1803 W83637HF_REG_PWM_FREQ[i - 1]);
1809 for (i = 0; i < num_pwms; i++) {
1810 u8 tmp = w83627hf_read_value(data,
1811 W83627THF_REG_PWM_ENABLE[i]);
1813 ((tmp >> W83627THF_PWM_ENABLE_SHIFT[
i])
1817 for (i = 0; i < num_temps; i++) {
1818 data->
temp[
i] = w83627hf_read_value(
1819 data, w83627hf_reg_temp[i]);
1820 data->
temp_max[
i] = w83627hf_read_value(
1821 data, w83627hf_reg_temp_over[i]);
1823 data, w83627hf_reg_temp_hyst[i]);
1826 w83627hf_update_fan_div(data);
1845 static int __init w83627hf_device_add(
unsigned short address,
1863 pr_err(
"Device allocation failed\n");
1869 pr_err(
"Device resource addition failed (%d)\n", err);
1870 goto exit_device_put;
1876 pr_err(
"Platform data allocation failed\n");
1877 goto exit_device_put;
1882 pr_err(
"Device addition failed (%d)\n", err);
1883 goto exit_device_put;
1894 static int __init sensors_w83627hf_init(
void)
1900 if (w83627hf_find(0x2e, &address, &sio_data)
1901 && w83627hf_find(0x4e, &address, &sio_data))
1909 err = w83627hf_device_add(address, &sio_data);
1921 static void __exit sensors_w83627hf_exit(
void)