aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/aspeed-pwm-tacho.c
diff options
context:
space:
mode:
authorStefan Schaeckeler <sschaeck@cisco.com>2017-06-02 15:43:28 -0400
committerGuenter Roeck <linux@roeck-us.net>2017-06-03 06:55:43 -0400
commit5f348fa35a28b19cf7ee1eaa420757341a724c86 (patch)
treefe6ca06b24c75ce9425db46cd425ed19e8a9201c /drivers/hwmon/aspeed-pwm-tacho.c
parent4d58e7329fdd87d37f04b319d6a5165aaff5d75c (diff)
hwmon: (aspeed-pwm-tacho) make fan/pwm names start with index 1
Make fan and pwm names in sysfs start with index 1 in accordance to Documentation/hwmon/sysfs-interface conventions. Current implementation starts with index 0, making tools such as sensors(1) skip the first fan. Signed-off-by: Stefan Schaeckeler <sschaeck@cisco.com> Fixes: 2d7a548a3eff ("drivers: hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/aspeed-pwm-tacho.c')
-rw-r--r--drivers/hwmon/aspeed-pwm-tacho.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index cc15bedb3415..9de13d626c68 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -597,24 +597,23 @@ static umode_t fan_dev_is_visible(struct kobject *kobj,
597 return a->mode; 597 return a->mode;
598} 598}
599 599
600static SENSOR_DEVICE_ATTR(pwm0, 0644,
601 show_pwm, set_pwm, 0);
602static SENSOR_DEVICE_ATTR(pwm1, 0644, 600static SENSOR_DEVICE_ATTR(pwm1, 0644,
603 show_pwm, set_pwm, 1); 601 show_pwm, set_pwm, 0);
604static SENSOR_DEVICE_ATTR(pwm2, 0644, 602static SENSOR_DEVICE_ATTR(pwm2, 0644,
605 show_pwm, set_pwm, 2); 603 show_pwm, set_pwm, 1);
606static SENSOR_DEVICE_ATTR(pwm3, 0644, 604static SENSOR_DEVICE_ATTR(pwm3, 0644,
607 show_pwm, set_pwm, 3); 605 show_pwm, set_pwm, 2);
608static SENSOR_DEVICE_ATTR(pwm4, 0644, 606static SENSOR_DEVICE_ATTR(pwm4, 0644,
609 show_pwm, set_pwm, 4); 607 show_pwm, set_pwm, 3);
610static SENSOR_DEVICE_ATTR(pwm5, 0644, 608static SENSOR_DEVICE_ATTR(pwm5, 0644,
611 show_pwm, set_pwm, 5); 609 show_pwm, set_pwm, 4);
612static SENSOR_DEVICE_ATTR(pwm6, 0644, 610static SENSOR_DEVICE_ATTR(pwm6, 0644,
613 show_pwm, set_pwm, 6); 611 show_pwm, set_pwm, 5);
614static SENSOR_DEVICE_ATTR(pwm7, 0644, 612static SENSOR_DEVICE_ATTR(pwm7, 0644,
613 show_pwm, set_pwm, 6);
614static SENSOR_DEVICE_ATTR(pwm8, 0644,
615 show_pwm, set_pwm, 7); 615 show_pwm, set_pwm, 7);
616static struct attribute *pwm_dev_attrs[] = { 616static struct attribute *pwm_dev_attrs[] = {
617 &sensor_dev_attr_pwm0.dev_attr.attr,
618 &sensor_dev_attr_pwm1.dev_attr.attr, 617 &sensor_dev_attr_pwm1.dev_attr.attr,
619 &sensor_dev_attr_pwm2.dev_attr.attr, 618 &sensor_dev_attr_pwm2.dev_attr.attr,
620 &sensor_dev_attr_pwm3.dev_attr.attr, 619 &sensor_dev_attr_pwm3.dev_attr.attr,
@@ -622,6 +621,7 @@ static struct attribute *pwm_dev_attrs[] = {
622 &sensor_dev_attr_pwm5.dev_attr.attr, 621 &sensor_dev_attr_pwm5.dev_attr.attr,
623 &sensor_dev_attr_pwm6.dev_attr.attr, 622 &sensor_dev_attr_pwm6.dev_attr.attr,
624 &sensor_dev_attr_pwm7.dev_attr.attr, 623 &sensor_dev_attr_pwm7.dev_attr.attr,
624 &sensor_dev_attr_pwm8.dev_attr.attr,
625 NULL, 625 NULL,
626}; 626};
627 627
@@ -630,40 +630,39 @@ static const struct attribute_group pwm_dev_group = {
630 .is_visible = pwm_is_visible, 630 .is_visible = pwm_is_visible,
631}; 631};
632 632
633static SENSOR_DEVICE_ATTR(fan0_input, 0444,
634 show_rpm, NULL, 0);
635static SENSOR_DEVICE_ATTR(fan1_input, 0444, 633static SENSOR_DEVICE_ATTR(fan1_input, 0444,
636 show_rpm, NULL, 1); 634 show_rpm, NULL, 0);
637static SENSOR_DEVICE_ATTR(fan2_input, 0444, 635static SENSOR_DEVICE_ATTR(fan2_input, 0444,
638 show_rpm, NULL, 2); 636 show_rpm, NULL, 1);
639static SENSOR_DEVICE_ATTR(fan3_input, 0444, 637static SENSOR_DEVICE_ATTR(fan3_input, 0444,
640 show_rpm, NULL, 3); 638 show_rpm, NULL, 2);
641static SENSOR_DEVICE_ATTR(fan4_input, 0444, 639static SENSOR_DEVICE_ATTR(fan4_input, 0444,
642 show_rpm, NULL, 4); 640 show_rpm, NULL, 3);
643static SENSOR_DEVICE_ATTR(fan5_input, 0444, 641static SENSOR_DEVICE_ATTR(fan5_input, 0444,
644 show_rpm, NULL, 5); 642 show_rpm, NULL, 4);
645static SENSOR_DEVICE_ATTR(fan6_input, 0444, 643static SENSOR_DEVICE_ATTR(fan6_input, 0444,
646 show_rpm, NULL, 6); 644 show_rpm, NULL, 5);
647static SENSOR_DEVICE_ATTR(fan7_input, 0444, 645static SENSOR_DEVICE_ATTR(fan7_input, 0444,
648 show_rpm, NULL, 7); 646 show_rpm, NULL, 6);
649static SENSOR_DEVICE_ATTR(fan8_input, 0444, 647static SENSOR_DEVICE_ATTR(fan8_input, 0444,
650 show_rpm, NULL, 8); 648 show_rpm, NULL, 7);
651static SENSOR_DEVICE_ATTR(fan9_input, 0444, 649static SENSOR_DEVICE_ATTR(fan9_input, 0444,
652 show_rpm, NULL, 9); 650 show_rpm, NULL, 8);
653static SENSOR_DEVICE_ATTR(fan10_input, 0444, 651static SENSOR_DEVICE_ATTR(fan10_input, 0444,
654 show_rpm, NULL, 10); 652 show_rpm, NULL, 9);
655static SENSOR_DEVICE_ATTR(fan11_input, 0444, 653static SENSOR_DEVICE_ATTR(fan11_input, 0444,
656 show_rpm, NULL, 11); 654 show_rpm, NULL, 10);
657static SENSOR_DEVICE_ATTR(fan12_input, 0444, 655static SENSOR_DEVICE_ATTR(fan12_input, 0444,
658 show_rpm, NULL, 12); 656 show_rpm, NULL, 11);
659static SENSOR_DEVICE_ATTR(fan13_input, 0444, 657static SENSOR_DEVICE_ATTR(fan13_input, 0444,
660 show_rpm, NULL, 13); 658 show_rpm, NULL, 12);
661static SENSOR_DEVICE_ATTR(fan14_input, 0444, 659static SENSOR_DEVICE_ATTR(fan14_input, 0444,
662 show_rpm, NULL, 14); 660 show_rpm, NULL, 13);
663static SENSOR_DEVICE_ATTR(fan15_input, 0444, 661static SENSOR_DEVICE_ATTR(fan15_input, 0444,
662 show_rpm, NULL, 14);
663static SENSOR_DEVICE_ATTR(fan16_input, 0444,
664 show_rpm, NULL, 15); 664 show_rpm, NULL, 15);
665static struct attribute *fan_dev_attrs[] = { 665static struct attribute *fan_dev_attrs[] = {
666 &sensor_dev_attr_fan0_input.dev_attr.attr,
667 &sensor_dev_attr_fan1_input.dev_attr.attr, 666 &sensor_dev_attr_fan1_input.dev_attr.attr,
668 &sensor_dev_attr_fan2_input.dev_attr.attr, 667 &sensor_dev_attr_fan2_input.dev_attr.attr,
669 &sensor_dev_attr_fan3_input.dev_attr.attr, 668 &sensor_dev_attr_fan3_input.dev_attr.attr,
@@ -679,6 +678,7 @@ static struct attribute *fan_dev_attrs[] = {
679 &sensor_dev_attr_fan13_input.dev_attr.attr, 678 &sensor_dev_attr_fan13_input.dev_attr.attr,
680 &sensor_dev_attr_fan14_input.dev_attr.attr, 679 &sensor_dev_attr_fan14_input.dev_attr.attr,
681 &sensor_dev_attr_fan15_input.dev_attr.attr, 680 &sensor_dev_attr_fan15_input.dev_attr.attr,
681 &sensor_dev_attr_fan16_input.dev_attr.attr,
682 NULL 682 NULL
683}; 683};
684 684