aspeed-pwm-tacho.c (4d58e7329fdd87d37f04b319d6a5165aaff5d75c) aspeed-pwm-tacho.c (5f348fa35a28b19cf7ee1eaa420757341a724c86)
1/*
2 * Copyright (c) 2016 Google, Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 or later as
6 * published by the Free Software Foundation.
7 */
8

--- 583 unchanged lines hidden (view full) ---

592 struct device *dev = container_of(kobj, struct device, kobj);
593 struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
594
595 if (!priv->fan_tach_present[index])
596 return 0;
597 return a->mode;
598}
599
1/*
2 * Copyright (c) 2016 Google, Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 or later as
6 * published by the Free Software Foundation.
7 */
8

--- 583 unchanged lines hidden (view full) ---

592 struct device *dev = container_of(kobj, struct device, kobj);
593 struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
594
595 if (!priv->fan_tach_present[index])
596 return 0;
597 return a->mode;
598}
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);
616static struct attribute *pwm_dev_attrs[] = {
615 show_pwm, set_pwm, 7);
616static struct attribute *pwm_dev_attrs[] = {
617 &sensor_dev_attr_pwm0.dev_attr.attr,
618 &sensor_dev_attr_pwm1.dev_attr.attr,
619 &sensor_dev_attr_pwm2.dev_attr.attr,
620 &sensor_dev_attr_pwm3.dev_attr.attr,
621 &sensor_dev_attr_pwm4.dev_attr.attr,
622 &sensor_dev_attr_pwm5.dev_attr.attr,
623 &sensor_dev_attr_pwm6.dev_attr.attr,
624 &sensor_dev_attr_pwm7.dev_attr.attr,
617 &sensor_dev_attr_pwm1.dev_attr.attr,
618 &sensor_dev_attr_pwm2.dev_attr.attr,
619 &sensor_dev_attr_pwm3.dev_attr.attr,
620 &sensor_dev_attr_pwm4.dev_attr.attr,
621 &sensor_dev_attr_pwm5.dev_attr.attr,
622 &sensor_dev_attr_pwm6.dev_attr.attr,
623 &sensor_dev_attr_pwm7.dev_attr.attr,
624 &sensor_dev_attr_pwm8.dev_attr.attr,
625 NULL,
626};
627
628static const struct attribute_group pwm_dev_group = {
629 .attrs = pwm_dev_attrs,
630 .is_visible = pwm_is_visible,
631};
632
625 NULL,
626};
627
628static const struct attribute_group pwm_dev_group = {
629 .attrs = pwm_dev_attrs,
630 .is_visible = pwm_is_visible,
631};
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);
665static struct attribute *fan_dev_attrs[] = {
664 show_rpm, NULL, 15);
665static struct attribute *fan_dev_attrs[] = {
666 &sensor_dev_attr_fan0_input.dev_attr.attr,
667 &sensor_dev_attr_fan1_input.dev_attr.attr,
668 &sensor_dev_attr_fan2_input.dev_attr.attr,
669 &sensor_dev_attr_fan3_input.dev_attr.attr,
670 &sensor_dev_attr_fan4_input.dev_attr.attr,
671 &sensor_dev_attr_fan5_input.dev_attr.attr,
672 &sensor_dev_attr_fan6_input.dev_attr.attr,
673 &sensor_dev_attr_fan7_input.dev_attr.attr,
674 &sensor_dev_attr_fan8_input.dev_attr.attr,
675 &sensor_dev_attr_fan9_input.dev_attr.attr,
676 &sensor_dev_attr_fan10_input.dev_attr.attr,
677 &sensor_dev_attr_fan11_input.dev_attr.attr,
678 &sensor_dev_attr_fan12_input.dev_attr.attr,
679 &sensor_dev_attr_fan13_input.dev_attr.attr,
680 &sensor_dev_attr_fan14_input.dev_attr.attr,
681 &sensor_dev_attr_fan15_input.dev_attr.attr,
666 &sensor_dev_attr_fan1_input.dev_attr.attr,
667 &sensor_dev_attr_fan2_input.dev_attr.attr,
668 &sensor_dev_attr_fan3_input.dev_attr.attr,
669 &sensor_dev_attr_fan4_input.dev_attr.attr,
670 &sensor_dev_attr_fan5_input.dev_attr.attr,
671 &sensor_dev_attr_fan6_input.dev_attr.attr,
672 &sensor_dev_attr_fan7_input.dev_attr.attr,
673 &sensor_dev_attr_fan8_input.dev_attr.attr,
674 &sensor_dev_attr_fan9_input.dev_attr.attr,
675 &sensor_dev_attr_fan10_input.dev_attr.attr,
676 &sensor_dev_attr_fan11_input.dev_attr.attr,
677 &sensor_dev_attr_fan12_input.dev_attr.attr,
678 &sensor_dev_attr_fan13_input.dev_attr.attr,
679 &sensor_dev_attr_fan14_input.dev_attr.attr,
680 &sensor_dev_attr_fan15_input.dev_attr.attr,
681 &sensor_dev_attr_fan16_input.dev_attr.attr,
682 NULL
683};
684
685static const struct attribute_group fan_dev_group = {
686 .attrs = fan_dev_attrs,
687 .is_visible = fan_dev_is_visible,
688};
689

--- 151 unchanged lines hidden ---
682 NULL
683};
684
685static const struct attribute_group fan_dev_group = {
686 .attrs = fan_dev_attrs,
687 .is_visible = fan_dev_is_visible,
688};
689

--- 151 unchanged lines hidden ---