diff options
author | Guenter Roeck <linux@roeck-us.net> | 2018-12-06 13:41:54 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-12-16 18:13:25 -0500 |
commit | 4aabaf30976eac011b70aa7c0e1fb385331e22f2 (patch) | |
tree | 5d03349373689869bf54f7a52e28fd067b0aaffe | |
parent | 33721d90c0444133219f9773cb6d88f380699fa4 (diff) |
hwmon: (nct7802) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO}
Auto-conversion was done done using the coccinelle script at
https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/nct7802.c | 408 |
1 files changed, 157 insertions, 251 deletions
diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c index 2876c18ed841..6aa44492ae30 100644 --- a/drivers/hwmon/nct7802.c +++ b/drivers/hwmon/nct7802.c | |||
@@ -69,8 +69,8 @@ struct nct7802_data { | |||
69 | struct mutex access_lock; /* for multi-byte read and write operations */ | 69 | struct mutex access_lock; /* for multi-byte read and write operations */ |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr, | 72 | static ssize_t temp_type_show(struct device *dev, |
73 | char *buf) | 73 | struct device_attribute *attr, char *buf) |
74 | { | 74 | { |
75 | struct nct7802_data *data = dev_get_drvdata(dev); | 75 | struct nct7802_data *data = dev_get_drvdata(dev); |
76 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); | 76 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); |
@@ -84,9 +84,9 @@ static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr, | |||
84 | return sprintf(buf, "%u\n", (mode >> (2 * sattr->index) & 3) + 2); | 84 | return sprintf(buf, "%u\n", (mode >> (2 * sattr->index) & 3) + 2); |
85 | } | 85 | } |
86 | 86 | ||
87 | static ssize_t store_temp_type(struct device *dev, | 87 | static ssize_t temp_type_store(struct device *dev, |
88 | struct device_attribute *attr, | 88 | struct device_attribute *attr, const char *buf, |
89 | const char *buf, size_t count) | 89 | size_t count) |
90 | { | 90 | { |
91 | struct nct7802_data *data = dev_get_drvdata(dev); | 91 | struct nct7802_data *data = dev_get_drvdata(dev); |
92 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); | 92 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); |
@@ -105,8 +105,8 @@ static ssize_t store_temp_type(struct device *dev, | |||
105 | return err ? : count; | 105 | return err ? : count; |
106 | } | 106 | } |
107 | 107 | ||
108 | static ssize_t show_pwm_mode(struct device *dev, struct device_attribute *attr, | 108 | static ssize_t pwm_mode_show(struct device *dev, |
109 | char *buf) | 109 | struct device_attribute *attr, char *buf) |
110 | { | 110 | { |
111 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); | 111 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); |
112 | struct nct7802_data *data = dev_get_drvdata(dev); | 112 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -123,7 +123,7 @@ static ssize_t show_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
123 | return sprintf(buf, "%u\n", !(regval & (1 << sattr->index))); | 123 | return sprintf(buf, "%u\n", !(regval & (1 << sattr->index))); |
124 | } | 124 | } |
125 | 125 | ||
126 | static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, | 126 | static ssize_t pwm_show(struct device *dev, struct device_attribute *devattr, |
127 | char *buf) | 127 | char *buf) |
128 | { | 128 | { |
129 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 129 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
@@ -141,7 +141,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, | |||
141 | return sprintf(buf, "%d\n", val); | 141 | return sprintf(buf, "%d\n", val); |
142 | } | 142 | } |
143 | 143 | ||
144 | static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, | 144 | static ssize_t pwm_store(struct device *dev, struct device_attribute *devattr, |
145 | const char *buf, size_t count) | 145 | const char *buf, size_t count) |
146 | { | 146 | { |
147 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 147 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
@@ -157,7 +157,7 @@ static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, | |||
157 | return err ? : count; | 157 | return err ? : count; |
158 | } | 158 | } |
159 | 159 | ||
160 | static ssize_t show_pwm_enable(struct device *dev, | 160 | static ssize_t pwm_enable_show(struct device *dev, |
161 | struct device_attribute *attr, char *buf) | 161 | struct device_attribute *attr, char *buf) |
162 | { | 162 | { |
163 | struct nct7802_data *data = dev_get_drvdata(dev); | 163 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -172,7 +172,7 @@ static ssize_t show_pwm_enable(struct device *dev, | |||
172 | return sprintf(buf, "%u\n", enabled + 1); | 172 | return sprintf(buf, "%u\n", enabled + 1); |
173 | } | 173 | } |
174 | 174 | ||
175 | static ssize_t store_pwm_enable(struct device *dev, | 175 | static ssize_t pwm_enable_store(struct device *dev, |
176 | struct device_attribute *attr, | 176 | struct device_attribute *attr, |
177 | const char *buf, size_t count) | 177 | const char *buf, size_t count) |
178 | { | 178 | { |
@@ -345,7 +345,7 @@ abort: | |||
345 | return err; | 345 | return err; |
346 | } | 346 | } |
347 | 347 | ||
348 | static ssize_t show_in(struct device *dev, struct device_attribute *attr, | 348 | static ssize_t in_show(struct device *dev, struct device_attribute *attr, |
349 | char *buf) | 349 | char *buf) |
350 | { | 350 | { |
351 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 351 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
@@ -359,7 +359,7 @@ static ssize_t show_in(struct device *dev, struct device_attribute *attr, | |||
359 | return sprintf(buf, "%d\n", voltage); | 359 | return sprintf(buf, "%d\n", voltage); |
360 | } | 360 | } |
361 | 361 | ||
362 | static ssize_t store_in(struct device *dev, struct device_attribute *attr, | 362 | static ssize_t in_store(struct device *dev, struct device_attribute *attr, |
363 | const char *buf, size_t count) | 363 | const char *buf, size_t count) |
364 | { | 364 | { |
365 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 365 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
@@ -377,7 +377,7 @@ static ssize_t store_in(struct device *dev, struct device_attribute *attr, | |||
377 | return err ? : count; | 377 | return err ? : count; |
378 | } | 378 | } |
379 | 379 | ||
380 | static ssize_t show_temp(struct device *dev, struct device_attribute *attr, | 380 | static ssize_t temp_show(struct device *dev, struct device_attribute *attr, |
381 | char *buf) | 381 | char *buf) |
382 | { | 382 | { |
383 | struct nct7802_data *data = dev_get_drvdata(dev); | 383 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -391,7 +391,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr, | |||
391 | return sprintf(buf, "%d\n", temp); | 391 | return sprintf(buf, "%d\n", temp); |
392 | } | 392 | } |
393 | 393 | ||
394 | static ssize_t store_temp(struct device *dev, struct device_attribute *attr, | 394 | static ssize_t temp_store(struct device *dev, struct device_attribute *attr, |
395 | const char *buf, size_t count) | 395 | const char *buf, size_t count) |
396 | { | 396 | { |
397 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 397 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
@@ -410,7 +410,7 @@ static ssize_t store_temp(struct device *dev, struct device_attribute *attr, | |||
410 | return err ? : count; | 410 | return err ? : count; |
411 | } | 411 | } |
412 | 412 | ||
413 | static ssize_t show_fan(struct device *dev, struct device_attribute *attr, | 413 | static ssize_t fan_show(struct device *dev, struct device_attribute *attr, |
414 | char *buf) | 414 | char *buf) |
415 | { | 415 | { |
416 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); | 416 | struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); |
@@ -424,7 +424,7 @@ static ssize_t show_fan(struct device *dev, struct device_attribute *attr, | |||
424 | return sprintf(buf, "%d\n", speed); | 424 | return sprintf(buf, "%d\n", speed); |
425 | } | 425 | } |
426 | 426 | ||
427 | static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr, | 427 | static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr, |
428 | char *buf) | 428 | char *buf) |
429 | { | 429 | { |
430 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 430 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
@@ -438,8 +438,9 @@ static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr, | |||
438 | return sprintf(buf, "%d\n", speed); | 438 | return sprintf(buf, "%d\n", speed); |
439 | } | 439 | } |
440 | 440 | ||
441 | static ssize_t store_fan_min(struct device *dev, struct device_attribute *attr, | 441 | static ssize_t fan_min_store(struct device *dev, |
442 | const char *buf, size_t count) | 442 | struct device_attribute *attr, const char *buf, |
443 | size_t count) | ||
443 | { | 444 | { |
444 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 445 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
445 | struct nct7802_data *data = dev_get_drvdata(dev); | 446 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -454,7 +455,7 @@ static ssize_t store_fan_min(struct device *dev, struct device_attribute *attr, | |||
454 | return err ? : count; | 455 | return err ? : count; |
455 | } | 456 | } |
456 | 457 | ||
457 | static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, | 458 | static ssize_t alarm_show(struct device *dev, struct device_attribute *attr, |
458 | char *buf) | 459 | char *buf) |
459 | { | 460 | { |
460 | struct nct7802_data *data = dev_get_drvdata(dev); | 461 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -471,7 +472,7 @@ static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, | |||
471 | } | 472 | } |
472 | 473 | ||
473 | static ssize_t | 474 | static ssize_t |
474 | show_beep(struct device *dev, struct device_attribute *attr, char *buf) | 475 | beep_show(struct device *dev, struct device_attribute *attr, char *buf) |
475 | { | 476 | { |
476 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 477 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
477 | struct nct7802_data *data = dev_get_drvdata(dev); | 478 | struct nct7802_data *data = dev_get_drvdata(dev); |
@@ -486,7 +487,7 @@ show_beep(struct device *dev, struct device_attribute *attr, char *buf) | |||
486 | } | 487 | } |
487 | 488 | ||
488 | static ssize_t | 489 | static ssize_t |
489 | store_beep(struct device *dev, struct device_attribute *attr, const char *buf, | 490 | beep_store(struct device *dev, struct device_attribute *attr, const char *buf, |
490 | size_t count) | 491 | size_t count) |
491 | { | 492 | { |
492 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); | 493 | struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); |
@@ -505,108 +506,64 @@ store_beep(struct device *dev, struct device_attribute *attr, const char *buf, | |||
505 | return err ? : count; | 506 | return err ? : count; |
506 | } | 507 | } |
507 | 508 | ||
508 | static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, | 509 | static SENSOR_DEVICE_ATTR_RW(temp1_type, temp_type, 0); |
509 | show_temp_type, store_temp_type, 0); | 510 | static SENSOR_DEVICE_ATTR_2_RO(temp1_input, temp, 0x01, REG_TEMP_LSB); |
510 | static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, 0x01, | 511 | static SENSOR_DEVICE_ATTR_2_RW(temp1_min, temp, 0x31, 0); |
511 | REG_TEMP_LSB); | 512 | static SENSOR_DEVICE_ATTR_2_RW(temp1_max, temp, 0x30, 0); |
512 | static SENSOR_DEVICE_ATTR_2(temp1_min, S_IRUGO | S_IWUSR, show_temp, | 513 | static SENSOR_DEVICE_ATTR_2_RW(temp1_crit, temp, 0x3a, 0); |
513 | store_temp, 0x31, 0); | 514 | |
514 | static SENSOR_DEVICE_ATTR_2(temp1_max, S_IRUGO | S_IWUSR, show_temp, | 515 | static SENSOR_DEVICE_ATTR_RW(temp2_type, temp_type, 1); |
515 | store_temp, 0x30, 0); | 516 | static SENSOR_DEVICE_ATTR_2_RO(temp2_input, temp, 0x02, REG_TEMP_LSB); |
516 | static SENSOR_DEVICE_ATTR_2(temp1_crit, S_IRUGO | S_IWUSR, show_temp, | 517 | static SENSOR_DEVICE_ATTR_2_RW(temp2_min, temp, 0x33, 0); |
517 | store_temp, 0x3a, 0); | 518 | static SENSOR_DEVICE_ATTR_2_RW(temp2_max, temp, 0x32, 0); |
518 | 519 | static SENSOR_DEVICE_ATTR_2_RW(temp2_crit, temp, 0x3b, 0); | |
519 | static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, | 520 | |
520 | show_temp_type, store_temp_type, 1); | 521 | static SENSOR_DEVICE_ATTR_RW(temp3_type, temp_type, 2); |
521 | static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, 0x02, | 522 | static SENSOR_DEVICE_ATTR_2_RO(temp3_input, temp, 0x03, REG_TEMP_LSB); |
522 | REG_TEMP_LSB); | 523 | static SENSOR_DEVICE_ATTR_2_RW(temp3_min, temp, 0x35, 0); |
523 | static SENSOR_DEVICE_ATTR_2(temp2_min, S_IRUGO | S_IWUSR, show_temp, | 524 | static SENSOR_DEVICE_ATTR_2_RW(temp3_max, temp, 0x34, 0); |
524 | store_temp, 0x33, 0); | 525 | static SENSOR_DEVICE_ATTR_2_RW(temp3_crit, temp, 0x3c, 0); |
525 | static SENSOR_DEVICE_ATTR_2(temp2_max, S_IRUGO | S_IWUSR, show_temp, | 526 | |
526 | store_temp, 0x32, 0); | 527 | static SENSOR_DEVICE_ATTR_2_RO(temp4_input, temp, 0x04, 0); |
527 | static SENSOR_DEVICE_ATTR_2(temp2_crit, S_IRUGO | S_IWUSR, show_temp, | 528 | static SENSOR_DEVICE_ATTR_2_RW(temp4_min, temp, 0x37, 0); |
528 | store_temp, 0x3b, 0); | 529 | static SENSOR_DEVICE_ATTR_2_RW(temp4_max, temp, 0x36, 0); |
529 | 530 | static SENSOR_DEVICE_ATTR_2_RW(temp4_crit, temp, 0x3d, 0); | |
530 | static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, | 531 | |
531 | show_temp_type, store_temp_type, 2); | 532 | static SENSOR_DEVICE_ATTR_2_RO(temp5_input, temp, 0x06, REG_TEMP_PECI_LSB); |
532 | static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 0x03, | 533 | static SENSOR_DEVICE_ATTR_2_RW(temp5_min, temp, 0x39, 0); |
533 | REG_TEMP_LSB); | 534 | static SENSOR_DEVICE_ATTR_2_RW(temp5_max, temp, 0x38, 0); |
534 | static SENSOR_DEVICE_ATTR_2(temp3_min, S_IRUGO | S_IWUSR, show_temp, | 535 | static SENSOR_DEVICE_ATTR_2_RW(temp5_crit, temp, 0x3e, 0); |
535 | store_temp, 0x35, 0); | 536 | |
536 | static SENSOR_DEVICE_ATTR_2(temp3_max, S_IRUGO | S_IWUSR, show_temp, | 537 | static SENSOR_DEVICE_ATTR_2_RO(temp6_input, temp, 0x07, REG_TEMP_PECI_LSB); |
537 | store_temp, 0x34, 0); | 538 | |
538 | static SENSOR_DEVICE_ATTR_2(temp3_crit, S_IRUGO | S_IWUSR, show_temp, | 539 | static SENSOR_DEVICE_ATTR_2_RO(temp1_min_alarm, alarm, 0x18, 0); |
539 | store_temp, 0x3c, 0); | 540 | static SENSOR_DEVICE_ATTR_2_RO(temp2_min_alarm, alarm, 0x18, 1); |
540 | 541 | static SENSOR_DEVICE_ATTR_2_RO(temp3_min_alarm, alarm, 0x18, 2); | |
541 | static SENSOR_DEVICE_ATTR_2(temp4_input, S_IRUGO, show_temp, NULL, 0x04, 0); | 542 | static SENSOR_DEVICE_ATTR_2_RO(temp4_min_alarm, alarm, 0x18, 3); |
542 | static SENSOR_DEVICE_ATTR_2(temp4_min, S_IRUGO | S_IWUSR, show_temp, | 543 | static SENSOR_DEVICE_ATTR_2_RO(temp5_min_alarm, alarm, 0x18, 4); |
543 | store_temp, 0x37, 0); | 544 | |
544 | static SENSOR_DEVICE_ATTR_2(temp4_max, S_IRUGO | S_IWUSR, show_temp, | 545 | static SENSOR_DEVICE_ATTR_2_RO(temp1_max_alarm, alarm, 0x19, 0); |
545 | store_temp, 0x36, 0); | 546 | static SENSOR_DEVICE_ATTR_2_RO(temp2_max_alarm, alarm, 0x19, 1); |
546 | static SENSOR_DEVICE_ATTR_2(temp4_crit, S_IRUGO | S_IWUSR, show_temp, | 547 | static SENSOR_DEVICE_ATTR_2_RO(temp3_max_alarm, alarm, 0x19, 2); |
547 | store_temp, 0x3d, 0); | 548 | static SENSOR_DEVICE_ATTR_2_RO(temp4_max_alarm, alarm, 0x19, 3); |
548 | 549 | static SENSOR_DEVICE_ATTR_2_RO(temp5_max_alarm, alarm, 0x19, 4); | |
549 | static SENSOR_DEVICE_ATTR_2(temp5_input, S_IRUGO, show_temp, NULL, 0x06, | 550 | |
550 | REG_TEMP_PECI_LSB); | 551 | static SENSOR_DEVICE_ATTR_2_RO(temp1_crit_alarm, alarm, 0x1b, 0); |
551 | static SENSOR_DEVICE_ATTR_2(temp5_min, S_IRUGO | S_IWUSR, show_temp, | 552 | static SENSOR_DEVICE_ATTR_2_RO(temp2_crit_alarm, alarm, 0x1b, 1); |
552 | store_temp, 0x39, 0); | 553 | static SENSOR_DEVICE_ATTR_2_RO(temp3_crit_alarm, alarm, 0x1b, 2); |
553 | static SENSOR_DEVICE_ATTR_2(temp5_max, S_IRUGO | S_IWUSR, show_temp, | 554 | static SENSOR_DEVICE_ATTR_2_RO(temp4_crit_alarm, alarm, 0x1b, 3); |
554 | store_temp, 0x38, 0); | 555 | static SENSOR_DEVICE_ATTR_2_RO(temp5_crit_alarm, alarm, 0x1b, 4); |
555 | static SENSOR_DEVICE_ATTR_2(temp5_crit, S_IRUGO | S_IWUSR, show_temp, | 556 | |
556 | store_temp, 0x3e, 0); | 557 | static SENSOR_DEVICE_ATTR_2_RO(temp1_fault, alarm, 0x17, 0); |
557 | 558 | static SENSOR_DEVICE_ATTR_2_RO(temp2_fault, alarm, 0x17, 1); | |
558 | static SENSOR_DEVICE_ATTR_2(temp6_input, S_IRUGO, show_temp, NULL, 0x07, | 559 | static SENSOR_DEVICE_ATTR_2_RO(temp3_fault, alarm, 0x17, 2); |
559 | REG_TEMP_PECI_LSB); | 560 | |
560 | 561 | static SENSOR_DEVICE_ATTR_2_RW(temp1_beep, beep, 0x5c, 0); | |
561 | static SENSOR_DEVICE_ATTR_2(temp1_min_alarm, S_IRUGO, show_alarm, NULL, | 562 | static SENSOR_DEVICE_ATTR_2_RW(temp2_beep, beep, 0x5c, 1); |
562 | 0x18, 0); | 563 | static SENSOR_DEVICE_ATTR_2_RW(temp3_beep, beep, 0x5c, 2); |
563 | static SENSOR_DEVICE_ATTR_2(temp2_min_alarm, S_IRUGO, show_alarm, NULL, | 564 | static SENSOR_DEVICE_ATTR_2_RW(temp4_beep, beep, 0x5c, 3); |
564 | 0x18, 1); | 565 | static SENSOR_DEVICE_ATTR_2_RW(temp5_beep, beep, 0x5c, 4); |
565 | static SENSOR_DEVICE_ATTR_2(temp3_min_alarm, S_IRUGO, show_alarm, NULL, | 566 | static SENSOR_DEVICE_ATTR_2_RW(temp6_beep, beep, 0x5c, 5); |
566 | 0x18, 2); | ||
567 | static SENSOR_DEVICE_ATTR_2(temp4_min_alarm, S_IRUGO, show_alarm, NULL, | ||
568 | 0x18, 3); | ||
569 | static SENSOR_DEVICE_ATTR_2(temp5_min_alarm, S_IRUGO, show_alarm, NULL, | ||
570 | 0x18, 4); | ||
571 | |||
572 | static SENSOR_DEVICE_ATTR_2(temp1_max_alarm, S_IRUGO, show_alarm, NULL, | ||
573 | 0x19, 0); | ||
574 | static SENSOR_DEVICE_ATTR_2(temp2_max_alarm, S_IRUGO, show_alarm, NULL, | ||
575 | 0x19, 1); | ||
576 | static SENSOR_DEVICE_ATTR_2(temp3_max_alarm, S_IRUGO, show_alarm, NULL, | ||
577 | 0x19, 2); | ||
578 | static SENSOR_DEVICE_ATTR_2(temp4_max_alarm, S_IRUGO, show_alarm, NULL, | ||
579 | 0x19, 3); | ||
580 | static SENSOR_DEVICE_ATTR_2(temp5_max_alarm, S_IRUGO, show_alarm, NULL, | ||
581 | 0x19, 4); | ||
582 | |||
583 | static SENSOR_DEVICE_ATTR_2(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, | ||
584 | 0x1b, 0); | ||
585 | static SENSOR_DEVICE_ATTR_2(temp2_crit_alarm, S_IRUGO, show_alarm, NULL, | ||
586 | 0x1b, 1); | ||
587 | static SENSOR_DEVICE_ATTR_2(temp3_crit_alarm, S_IRUGO, show_alarm, NULL, | ||
588 | 0x1b, 2); | ||
589 | static SENSOR_DEVICE_ATTR_2(temp4_crit_alarm, S_IRUGO, show_alarm, NULL, | ||
590 | 0x1b, 3); | ||
591 | static SENSOR_DEVICE_ATTR_2(temp5_crit_alarm, S_IRUGO, show_alarm, NULL, | ||
592 | 0x1b, 4); | ||
593 | |||
594 | static SENSOR_DEVICE_ATTR_2(temp1_fault, S_IRUGO, show_alarm, NULL, 0x17, 0); | ||
595 | static SENSOR_DEVICE_ATTR_2(temp2_fault, S_IRUGO, show_alarm, NULL, 0x17, 1); | ||
596 | static SENSOR_DEVICE_ATTR_2(temp3_fault, S_IRUGO, show_alarm, NULL, 0x17, 2); | ||
597 | |||
598 | static SENSOR_DEVICE_ATTR_2(temp1_beep, S_IRUGO | S_IWUSR, show_beep, | ||
599 | store_beep, 0x5c, 0); | ||
600 | static SENSOR_DEVICE_ATTR_2(temp2_beep, S_IRUGO | S_IWUSR, show_beep, | ||
601 | store_beep, 0x5c, 1); | ||
602 | static SENSOR_DEVICE_ATTR_2(temp3_beep, S_IRUGO | S_IWUSR, show_beep, | ||
603 | store_beep, 0x5c, 2); | ||
604 | static SENSOR_DEVICE_ATTR_2(temp4_beep, S_IRUGO | S_IWUSR, show_beep, | ||
605 | store_beep, 0x5c, 3); | ||
606 | static SENSOR_DEVICE_ATTR_2(temp5_beep, S_IRUGO | S_IWUSR, show_beep, | ||
607 | store_beep, 0x5c, 4); | ||
608 | static SENSOR_DEVICE_ATTR_2(temp6_beep, S_IRUGO | S_IWUSR, show_beep, | ||
609 | store_beep, 0x5c, 5); | ||
610 | 567 | ||
611 | static struct attribute *nct7802_temp_attrs[] = { | 568 | static struct attribute *nct7802_temp_attrs[] = { |
612 | &sensor_dev_attr_temp1_type.dev_attr.attr, | 569 | &sensor_dev_attr_temp1_type.dev_attr.attr, |
@@ -709,43 +666,31 @@ static const struct attribute_group nct7802_temp_group = { | |||
709 | .is_visible = nct7802_temp_is_visible, | 666 | .is_visible = nct7802_temp_is_visible, |
710 | }; | 667 | }; |
711 | 668 | ||
712 | static SENSOR_DEVICE_ATTR_2(in0_input, S_IRUGO, show_in, NULL, 0, 0); | 669 | static SENSOR_DEVICE_ATTR_2_RO(in0_input, in, 0, 0); |
713 | static SENSOR_DEVICE_ATTR_2(in0_min, S_IRUGO | S_IWUSR, show_in, store_in, | 670 | static SENSOR_DEVICE_ATTR_2_RW(in0_min, in, 0, 1); |
714 | 0, 1); | 671 | static SENSOR_DEVICE_ATTR_2_RW(in0_max, in, 0, 2); |
715 | static SENSOR_DEVICE_ATTR_2(in0_max, S_IRUGO | S_IWUSR, show_in, store_in, | 672 | static SENSOR_DEVICE_ATTR_2_RO(in0_alarm, alarm, 0x1e, 3); |
716 | 0, 2); | 673 | static SENSOR_DEVICE_ATTR_2_RW(in0_beep, beep, 0x5a, 3); |
717 | static SENSOR_DEVICE_ATTR_2(in0_alarm, S_IRUGO, show_alarm, NULL, 0x1e, 3); | 674 | |
718 | static SENSOR_DEVICE_ATTR_2(in0_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | 675 | static SENSOR_DEVICE_ATTR_2_RO(in1_input, in, 1, 0); |
719 | 0x5a, 3); | 676 | |
720 | 677 | static SENSOR_DEVICE_ATTR_2_RO(in2_input, in, 2, 0); | |
721 | static SENSOR_DEVICE_ATTR_2(in1_input, S_IRUGO, show_in, NULL, 1, 0); | 678 | static SENSOR_DEVICE_ATTR_2_RW(in2_min, in, 2, 1); |
722 | 679 | static SENSOR_DEVICE_ATTR_2_RW(in2_max, in, 2, 2); | |
723 | static SENSOR_DEVICE_ATTR_2(in2_input, S_IRUGO, show_in, NULL, 2, 0); | 680 | static SENSOR_DEVICE_ATTR_2_RO(in2_alarm, alarm, 0x1e, 0); |
724 | static SENSOR_DEVICE_ATTR_2(in2_min, S_IRUGO | S_IWUSR, show_in, store_in, | 681 | static SENSOR_DEVICE_ATTR_2_RW(in2_beep, beep, 0x5a, 0); |
725 | 2, 1); | 682 | |
726 | static SENSOR_DEVICE_ATTR_2(in2_max, S_IRUGO | S_IWUSR, show_in, store_in, | 683 | static SENSOR_DEVICE_ATTR_2_RO(in3_input, in, 3, 0); |
727 | 2, 2); | 684 | static SENSOR_DEVICE_ATTR_2_RW(in3_min, in, 3, 1); |
728 | static SENSOR_DEVICE_ATTR_2(in2_alarm, S_IRUGO, show_alarm, NULL, 0x1e, 0); | 685 | static SENSOR_DEVICE_ATTR_2_RW(in3_max, in, 3, 2); |
729 | static SENSOR_DEVICE_ATTR_2(in2_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | 686 | static SENSOR_DEVICE_ATTR_2_RO(in3_alarm, alarm, 0x1e, 1); |
730 | 0x5a, 0); | 687 | static SENSOR_DEVICE_ATTR_2_RW(in3_beep, beep, 0x5a, 1); |
731 | 688 | ||
732 | static SENSOR_DEVICE_ATTR_2(in3_input, S_IRUGO, show_in, NULL, 3, 0); | 689 | static SENSOR_DEVICE_ATTR_2_RO(in4_input, in, 4, 0); |
733 | static SENSOR_DEVICE_ATTR_2(in3_min, S_IRUGO | S_IWUSR, show_in, store_in, | 690 | static SENSOR_DEVICE_ATTR_2_RW(in4_min, in, 4, 1); |
734 | 3, 1); | 691 | static SENSOR_DEVICE_ATTR_2_RW(in4_max, in, 4, 2); |
735 | static SENSOR_DEVICE_ATTR_2(in3_max, S_IRUGO | S_IWUSR, show_in, store_in, | 692 | static SENSOR_DEVICE_ATTR_2_RO(in4_alarm, alarm, 0x1e, 2); |
736 | 3, 2); | 693 | static SENSOR_DEVICE_ATTR_2_RW(in4_beep, beep, 0x5a, 2); |
737 | static SENSOR_DEVICE_ATTR_2(in3_alarm, S_IRUGO, show_alarm, NULL, 0x1e, 1); | ||
738 | static SENSOR_DEVICE_ATTR_2(in3_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | ||
739 | 0x5a, 1); | ||
740 | |||
741 | static SENSOR_DEVICE_ATTR_2(in4_input, S_IRUGO, show_in, NULL, 4, 0); | ||
742 | static SENSOR_DEVICE_ATTR_2(in4_min, S_IRUGO | S_IWUSR, show_in, store_in, | ||
743 | 4, 1); | ||
744 | static SENSOR_DEVICE_ATTR_2(in4_max, S_IRUGO | S_IWUSR, show_in, store_in, | ||
745 | 4, 2); | ||
746 | static SENSOR_DEVICE_ATTR_2(in4_alarm, S_IRUGO, show_alarm, NULL, 0x1e, 2); | ||
747 | static SENSOR_DEVICE_ATTR_2(in4_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | ||
748 | 0x5a, 2); | ||
749 | 694 | ||
750 | static struct attribute *nct7802_in_attrs[] = { | 695 | static struct attribute *nct7802_in_attrs[] = { |
751 | &sensor_dev_attr_in0_input.dev_attr.attr, | 696 | &sensor_dev_attr_in0_input.dev_attr.attr, |
@@ -807,45 +752,33 @@ static const struct attribute_group nct7802_in_group = { | |||
807 | .is_visible = nct7802_in_is_visible, | 752 | .is_visible = nct7802_in_is_visible, |
808 | }; | 753 | }; |
809 | 754 | ||
810 | static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0x10); | 755 | static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0x10); |
811 | static SENSOR_DEVICE_ATTR_2(fan1_min, S_IRUGO | S_IWUSR, show_fan_min, | 756 | static SENSOR_DEVICE_ATTR_2_RW(fan1_min, fan_min, 0x49, 0x4c); |
812 | store_fan_min, 0x49, 0x4c); | 757 | static SENSOR_DEVICE_ATTR_2_RO(fan1_alarm, alarm, 0x1a, 0); |
813 | static SENSOR_DEVICE_ATTR_2(fan1_alarm, S_IRUGO, show_alarm, NULL, 0x1a, 0); | 758 | static SENSOR_DEVICE_ATTR_2_RW(fan1_beep, beep, 0x5b, 0); |
814 | static SENSOR_DEVICE_ATTR_2(fan1_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | 759 | static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 0x11); |
815 | 0x5b, 0); | 760 | static SENSOR_DEVICE_ATTR_2_RW(fan2_min, fan_min, 0x4a, 0x4d); |
816 | static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 0x11); | 761 | static SENSOR_DEVICE_ATTR_2_RO(fan2_alarm, alarm, 0x1a, 1); |
817 | static SENSOR_DEVICE_ATTR_2(fan2_min, S_IRUGO | S_IWUSR, show_fan_min, | 762 | static SENSOR_DEVICE_ATTR_2_RW(fan2_beep, beep, 0x5b, 1); |
818 | store_fan_min, 0x4a, 0x4d); | 763 | static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 0x12); |
819 | static SENSOR_DEVICE_ATTR_2(fan2_alarm, S_IRUGO, show_alarm, NULL, 0x1a, 1); | 764 | static SENSOR_DEVICE_ATTR_2_RW(fan3_min, fan_min, 0x4b, 0x4e); |
820 | static SENSOR_DEVICE_ATTR_2(fan2_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | 765 | static SENSOR_DEVICE_ATTR_2_RO(fan3_alarm, alarm, 0x1a, 2); |
821 | 0x5b, 1); | 766 | static SENSOR_DEVICE_ATTR_2_RW(fan3_beep, beep, 0x5b, 2); |
822 | static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, show_fan, NULL, 0x12); | ||
823 | static SENSOR_DEVICE_ATTR_2(fan3_min, S_IRUGO | S_IWUSR, show_fan_min, | ||
824 | store_fan_min, 0x4b, 0x4e); | ||
825 | static SENSOR_DEVICE_ATTR_2(fan3_alarm, S_IRUGO, show_alarm, NULL, 0x1a, 2); | ||
826 | static SENSOR_DEVICE_ATTR_2(fan3_beep, S_IRUGO | S_IWUSR, show_beep, store_beep, | ||
827 | 0x5b, 2); | ||
828 | 767 | ||
829 | /* 7.2.89 Fan Control Output Type */ | 768 | /* 7.2.89 Fan Control Output Type */ |
830 | static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO, show_pwm_mode, NULL, 0); | 769 | static SENSOR_DEVICE_ATTR_RO(pwm1_mode, pwm_mode, 0); |
831 | static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO, show_pwm_mode, NULL, 1); | 770 | static SENSOR_DEVICE_ATTR_RO(pwm2_mode, pwm_mode, 1); |
832 | static SENSOR_DEVICE_ATTR(pwm3_mode, S_IRUGO, show_pwm_mode, NULL, 2); | 771 | static SENSOR_DEVICE_ATTR_RO(pwm3_mode, pwm_mode, 2); |
833 | 772 | ||
834 | /* 7.2.91... Fan Control Output Value */ | 773 | /* 7.2.91... Fan Control Output Value */ |
835 | static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, store_pwm, | 774 | static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, REG_PWM(0)); |
836 | REG_PWM(0)); | 775 | static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, REG_PWM(1)); |
837 | static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, store_pwm, | 776 | static SENSOR_DEVICE_ATTR_RW(pwm3, pwm, REG_PWM(2)); |
838 | REG_PWM(1)); | ||
839 | static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, show_pwm, store_pwm, | ||
840 | REG_PWM(2)); | ||
841 | 777 | ||
842 | /* 7.2.95... Temperature to Fan mapping Relationships Register */ | 778 | /* 7.2.95... Temperature to Fan mapping Relationships Register */ |
843 | static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable, | 779 | static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_enable, 0); |
844 | store_pwm_enable, 0); | 780 | static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_enable, 1); |
845 | static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO | S_IWUSR, show_pwm_enable, | 781 | static SENSOR_DEVICE_ATTR_RW(pwm3_enable, pwm_enable, 2); |
846 | store_pwm_enable, 1); | ||
847 | static SENSOR_DEVICE_ATTR(pwm3_enable, S_IRUGO | S_IWUSR, show_pwm_enable, | ||
848 | store_pwm_enable, 2); | ||
849 | 782 | ||
850 | static struct attribute *nct7802_fan_attrs[] = { | 783 | static struct attribute *nct7802_fan_attrs[] = { |
851 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 784 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
@@ -903,73 +836,46 @@ static const struct attribute_group nct7802_pwm_group = { | |||
903 | }; | 836 | }; |
904 | 837 | ||
905 | /* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */ | 838 | /* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */ |
906 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR, | 839 | static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point1_temp, temp, 0x80, 0); |
907 | show_temp, store_temp, 0x80, 0); | 840 | static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point2_temp, temp, 0x81, 0); |
908 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR, | 841 | static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point3_temp, temp, 0x82, 0); |
909 | show_temp, store_temp, 0x81, 0); | 842 | static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point4_temp, temp, 0x83, 0); |
910 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR, | 843 | static SENSOR_DEVICE_ATTR_2_RW(pwm1_auto_point5_temp, temp, 0x84, 0); |
911 | show_temp, store_temp, 0x82, 0); | ||
912 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_temp, S_IRUGO | S_IWUSR, | ||
913 | show_temp, store_temp, 0x83, 0); | ||
914 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point5_temp, S_IRUGO | S_IWUSR, | ||
915 | show_temp, store_temp, 0x84, 0); | ||
916 | 844 | ||
917 | /* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */ | 845 | /* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */ |
918 | static SENSOR_DEVICE_ATTR(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, | 846 | static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point1_pwm, pwm, 0x85); |
919 | show_pwm, store_pwm, 0x85); | 847 | static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point2_pwm, pwm, 0x86); |
920 | static SENSOR_DEVICE_ATTR(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR, | 848 | static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point3_pwm, pwm, 0x87); |
921 | show_pwm, store_pwm, 0x86); | 849 | static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point4_pwm, pwm, 0x88); |
922 | static SENSOR_DEVICE_ATTR(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR, | 850 | static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point5_pwm, pwm, 0); |
923 | show_pwm, store_pwm, 0x87); | ||
924 | static SENSOR_DEVICE_ATTR(pwm1_auto_point4_pwm, S_IRUGO | S_IWUSR, | ||
925 | show_pwm, store_pwm, 0x88); | ||
926 | static SENSOR_DEVICE_ATTR(pwm1_auto_point5_pwm, S_IRUGO, show_pwm, NULL, 0); | ||
927 | 851 | ||
928 | /* 7.2.124 Table 2 X-axis Transition Point 1 Register */ | 852 | /* 7.2.124 Table 2 X-axis Transition Point 1 Register */ |
929 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR, | 853 | static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point1_temp, temp, 0x90, 0); |
930 | show_temp, store_temp, 0x90, 0); | 854 | static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point2_temp, temp, 0x91, 0); |
931 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR, | 855 | static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point3_temp, temp, 0x92, 0); |
932 | show_temp, store_temp, 0x91, 0); | 856 | static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point4_temp, temp, 0x93, 0); |
933 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR, | 857 | static SENSOR_DEVICE_ATTR_2_RW(pwm2_auto_point5_temp, temp, 0x94, 0); |
934 | show_temp, store_temp, 0x92, 0); | ||
935 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR, | ||
936 | show_temp, store_temp, 0x93, 0); | ||
937 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point5_temp, S_IRUGO | S_IWUSR, | ||
938 | show_temp, store_temp, 0x94, 0); | ||
939 | 858 | ||
940 | /* 7.2.129 Table 2 Y-axis Transition Point 1 Register */ | 859 | /* 7.2.129 Table 2 Y-axis Transition Point 1 Register */ |
941 | static SENSOR_DEVICE_ATTR(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, | 860 | static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point1_pwm, pwm, 0x95); |
942 | show_pwm, store_pwm, 0x95); | 861 | static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point2_pwm, pwm, 0x96); |
943 | static SENSOR_DEVICE_ATTR(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR, | 862 | static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point3_pwm, pwm, 0x97); |
944 | show_pwm, store_pwm, 0x96); | 863 | static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point4_pwm, pwm, 0x98); |
945 | static SENSOR_DEVICE_ATTR(pwm2_auto_point3_pwm, S_IRUGO | S_IWUSR, | 864 | static SENSOR_DEVICE_ATTR_RO(pwm2_auto_point5_pwm, pwm, 0); |
946 | show_pwm, store_pwm, 0x97); | ||
947 | static SENSOR_DEVICE_ATTR(pwm2_auto_point4_pwm, S_IRUGO | S_IWUSR, | ||
948 | show_pwm, store_pwm, 0x98); | ||
949 | static SENSOR_DEVICE_ATTR(pwm2_auto_point5_pwm, S_IRUGO, show_pwm, NULL, 0); | ||
950 | 865 | ||
951 | /* 7.2.133 Table 3 X-axis Transition Point 1 Register */ | 866 | /* 7.2.133 Table 3 X-axis Transition Point 1 Register */ |
952 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR, | 867 | static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point1_temp, temp, 0xA0, 0); |
953 | show_temp, store_temp, 0xA0, 0); | 868 | static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point2_temp, temp, 0xA1, 0); |
954 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR, | 869 | static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point3_temp, temp, 0xA2, 0); |
955 | show_temp, store_temp, 0xA1, 0); | 870 | static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point4_temp, temp, 0xA3, 0); |
956 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR, | 871 | static SENSOR_DEVICE_ATTR_2_RW(pwm3_auto_point5_temp, temp, 0xA4, 0); |
957 | show_temp, store_temp, 0xA2, 0); | ||
958 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_temp, S_IRUGO | S_IWUSR, | ||
959 | show_temp, store_temp, 0xA3, 0); | ||
960 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point5_temp, S_IRUGO | S_IWUSR, | ||
961 | show_temp, store_temp, 0xA4, 0); | ||
962 | 872 | ||
963 | /* 7.2.138 Table 3 Y-axis Transition Point 1 Register */ | 873 | /* 7.2.138 Table 3 Y-axis Transition Point 1 Register */ |
964 | static SENSOR_DEVICE_ATTR(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, | 874 | static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point1_pwm, pwm, 0xA5); |
965 | show_pwm, store_pwm, 0xA5); | 875 | static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point2_pwm, pwm, 0xA6); |
966 | static SENSOR_DEVICE_ATTR(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR, | 876 | static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point3_pwm, pwm, 0xA7); |
967 | show_pwm, store_pwm, 0xA6); | 877 | static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point4_pwm, pwm, 0xA8); |
968 | static SENSOR_DEVICE_ATTR(pwm3_auto_point3_pwm, S_IRUGO | S_IWUSR, | 878 | static SENSOR_DEVICE_ATTR_RO(pwm3_auto_point5_pwm, pwm, 0); |
969 | show_pwm, store_pwm, 0xA7); | ||
970 | static SENSOR_DEVICE_ATTR(pwm3_auto_point4_pwm, S_IRUGO | S_IWUSR, | ||
971 | show_pwm, store_pwm, 0xA8); | ||
972 | static SENSOR_DEVICE_ATTR(pwm3_auto_point5_pwm, S_IRUGO, show_pwm, NULL, 0); | ||
973 | 879 | ||
974 | static struct attribute *nct7802_auto_point_attrs[] = { | 880 | static struct attribute *nct7802_auto_point_attrs[] = { |
975 | &sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr, | 881 | &sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr, |