diff options
author | Juerg Haefliger <juergh@gmail.com> | 2008-03-26 00:49:02 -0400 |
---|---|---|
committer | Mark M. Hoffman <mhoffman@lightlink.com> | 2008-07-31 23:44:01 -0400 |
commit | 9b257714a3f6f5c3ea133c44d3442e2340734b65 (patch) | |
tree | 7cef33b052850bf8c9c90387658438fbe9793f67 /drivers/hwmon/dme1737.c | |
parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) |
hwmon: (dme1737) demacrofy for readability
This patch gets rid of a couple of macros previously used for sysfs attribute
generation and manipulation. This makes the source a little bigger but a lot
more readable and maintainable. It also fixes an issue with pwm5 & pwm6
attributes not being created read-only initially.
Signed-Off-By: Juerg Haefliger <juergh at gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon/dme1737.c')
-rw-r--r-- | drivers/hwmon/dme1737.c | 255 |
1 files changed, 154 insertions, 101 deletions
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c index 7673f65877e1..c24b5b370daa 100644 --- a/drivers/hwmon/dme1737.c +++ b/drivers/hwmon/dme1737.c | |||
@@ -1501,9 +1501,9 @@ SENSOR_DEVICE_ATTR_PWM_1TO3(3); | |||
1501 | /* PWMs 5-6 */ | 1501 | /* PWMs 5-6 */ |
1502 | 1502 | ||
1503 | #define SENSOR_DEVICE_ATTR_PWM_5TO6(ix) \ | 1503 | #define SENSOR_DEVICE_ATTR_PWM_5TO6(ix) \ |
1504 | static SENSOR_DEVICE_ATTR_2(pwm##ix, S_IRUGO | S_IWUSR, \ | 1504 | static SENSOR_DEVICE_ATTR_2(pwm##ix, S_IRUGO, \ |
1505 | show_pwm, set_pwm, SYS_PWM, ix-1); \ | 1505 | show_pwm, set_pwm, SYS_PWM, ix-1); \ |
1506 | static SENSOR_DEVICE_ATTR_2(pwm##ix##_freq, S_IRUGO | S_IWUSR, \ | 1506 | static SENSOR_DEVICE_ATTR_2(pwm##ix##_freq, S_IRUGO, \ |
1507 | show_pwm, set_pwm, SYS_PWM_FREQ, ix-1); \ | 1507 | show_pwm, set_pwm, SYS_PWM_FREQ, ix-1); \ |
1508 | static SENSOR_DEVICE_ATTR_2(pwm##ix##_enable, S_IRUGO, \ | 1508 | static SENSOR_DEVICE_ATTR_2(pwm##ix##_enable, S_IRUGO, \ |
1509 | show_pwm, NULL, SYS_PWM_ENABLE, ix-1) | 1509 | show_pwm, NULL, SYS_PWM_ENABLE, ix-1) |
@@ -1517,91 +1517,75 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); | |||
1517 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | 1517 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); |
1518 | static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); /* for ISA devices */ | 1518 | static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); /* for ISA devices */ |
1519 | 1519 | ||
1520 | #define SENSOR_DEV_ATTR_IN(ix) \ | ||
1521 | &sensor_dev_attr_in##ix##_input.dev_attr.attr, \ | ||
1522 | &sensor_dev_attr_in##ix##_min.dev_attr.attr, \ | ||
1523 | &sensor_dev_attr_in##ix##_max.dev_attr.attr, \ | ||
1524 | &sensor_dev_attr_in##ix##_alarm.dev_attr.attr | ||
1525 | |||
1526 | /* These attributes are read-writeable only if the chip is *not* locked */ | ||
1527 | #define SENSOR_DEV_ATTR_TEMP_LOCK(ix) \ | ||
1528 | &sensor_dev_attr_temp##ix##_offset.dev_attr.attr | ||
1529 | |||
1530 | #define SENSOR_DEV_ATTR_TEMP(ix) \ | ||
1531 | SENSOR_DEV_ATTR_TEMP_LOCK(ix), \ | ||
1532 | &sensor_dev_attr_temp##ix##_input.dev_attr.attr, \ | ||
1533 | &sensor_dev_attr_temp##ix##_min.dev_attr.attr, \ | ||
1534 | &sensor_dev_attr_temp##ix##_max.dev_attr.attr, \ | ||
1535 | &sensor_dev_attr_temp##ix##_alarm.dev_attr.attr, \ | ||
1536 | &sensor_dev_attr_temp##ix##_fault.dev_attr.attr | ||
1537 | |||
1538 | /* These attributes are read-writeable only if the chip is *not* locked */ | ||
1539 | #define SENSOR_DEV_ATTR_ZONE_LOCK(ix) \ | ||
1540 | &sensor_dev_attr_zone##ix##_auto_point1_temp_hyst.dev_attr.attr, \ | ||
1541 | &sensor_dev_attr_zone##ix##_auto_point1_temp.dev_attr.attr, \ | ||
1542 | &sensor_dev_attr_zone##ix##_auto_point2_temp.dev_attr.attr, \ | ||
1543 | &sensor_dev_attr_zone##ix##_auto_point3_temp.dev_attr.attr | ||
1544 | |||
1545 | #define SENSOR_DEV_ATTR_ZONE(ix) \ | ||
1546 | SENSOR_DEV_ATTR_ZONE_LOCK(ix), \ | ||
1547 | &sensor_dev_attr_zone##ix##_auto_channels_temp.dev_attr.attr | ||
1548 | |||
1549 | #define SENSOR_DEV_ATTR_FAN_1TO4(ix) \ | ||
1550 | &sensor_dev_attr_fan##ix##_input.dev_attr.attr, \ | ||
1551 | &sensor_dev_attr_fan##ix##_min.dev_attr.attr, \ | ||
1552 | &sensor_dev_attr_fan##ix##_alarm.dev_attr.attr, \ | ||
1553 | &sensor_dev_attr_fan##ix##_type.dev_attr.attr | ||
1554 | |||
1555 | #define SENSOR_DEV_ATTR_FAN_5TO6(ix) \ | ||
1556 | &sensor_dev_attr_fan##ix##_input.dev_attr.attr, \ | ||
1557 | &sensor_dev_attr_fan##ix##_min.dev_attr.attr, \ | ||
1558 | &sensor_dev_attr_fan##ix##_alarm.dev_attr.attr, \ | ||
1559 | &sensor_dev_attr_fan##ix##_max.dev_attr.attr | ||
1560 | |||
1561 | /* These attributes are read-writeable only if the chip is *not* locked */ | ||
1562 | #define SENSOR_DEV_ATTR_PWM_1TO3_LOCK(ix) \ | ||
1563 | &sensor_dev_attr_pwm##ix##_freq.dev_attr.attr, \ | ||
1564 | &sensor_dev_attr_pwm##ix##_enable.dev_attr.attr, \ | ||
1565 | &sensor_dev_attr_pwm##ix##_ramp_rate.dev_attr.attr, \ | ||
1566 | &sensor_dev_attr_pwm##ix##_auto_channels_zone.dev_attr.attr, \ | ||
1567 | &sensor_dev_attr_pwm##ix##_auto_pwm_min.dev_attr.attr, \ | ||
1568 | &sensor_dev_attr_pwm##ix##_auto_point1_pwm.dev_attr.attr | ||
1569 | |||
1570 | #define SENSOR_DEV_ATTR_PWM_1TO3(ix) \ | ||
1571 | SENSOR_DEV_ATTR_PWM_1TO3_LOCK(ix), \ | ||
1572 | &sensor_dev_attr_pwm##ix.dev_attr.attr, \ | ||
1573 | &sensor_dev_attr_pwm##ix##_auto_point2_pwm.dev_attr.attr | ||
1574 | |||
1575 | /* These attributes are read-writeable only if the chip is *not* locked */ | ||
1576 | #define SENSOR_DEV_ATTR_PWM_5TO6_LOCK(ix) \ | ||
1577 | &sensor_dev_attr_pwm##ix.dev_attr.attr, \ | ||
1578 | &sensor_dev_attr_pwm##ix##_freq.dev_attr.attr | ||
1579 | |||
1580 | #define SENSOR_DEV_ATTR_PWM_5TO6(ix) \ | ||
1581 | SENSOR_DEV_ATTR_PWM_5TO6_LOCK(ix), \ | ||
1582 | &sensor_dev_attr_pwm##ix##_enable.dev_attr.attr | ||
1583 | |||
1584 | /* This struct holds all the attributes that are always present and need to be | 1520 | /* This struct holds all the attributes that are always present and need to be |
1585 | * created unconditionally. The attributes that need modification of their | 1521 | * created unconditionally. The attributes that need modification of their |
1586 | * permissions are created read-only and write permissions are added or removed | 1522 | * permissions are created read-only and write permissions are added or removed |
1587 | * on the fly when required */ | 1523 | * on the fly when required */ |
1588 | static struct attribute *dme1737_attr[] ={ | 1524 | static struct attribute *dme1737_attr[] ={ |
1589 | /* Voltages */ | 1525 | /* Voltages */ |
1590 | SENSOR_DEV_ATTR_IN(0), | 1526 | &sensor_dev_attr_in0_input.dev_attr.attr, |
1591 | SENSOR_DEV_ATTR_IN(1), | 1527 | &sensor_dev_attr_in0_min.dev_attr.attr, |
1592 | SENSOR_DEV_ATTR_IN(2), | 1528 | &sensor_dev_attr_in0_max.dev_attr.attr, |
1593 | SENSOR_DEV_ATTR_IN(3), | 1529 | &sensor_dev_attr_in0_alarm.dev_attr.attr, |
1594 | SENSOR_DEV_ATTR_IN(4), | 1530 | &sensor_dev_attr_in1_input.dev_attr.attr, |
1595 | SENSOR_DEV_ATTR_IN(5), | 1531 | &sensor_dev_attr_in1_min.dev_attr.attr, |
1596 | SENSOR_DEV_ATTR_IN(6), | 1532 | &sensor_dev_attr_in1_max.dev_attr.attr, |
1533 | &sensor_dev_attr_in1_alarm.dev_attr.attr, | ||
1534 | &sensor_dev_attr_in2_input.dev_attr.attr, | ||
1535 | &sensor_dev_attr_in2_min.dev_attr.attr, | ||
1536 | &sensor_dev_attr_in2_max.dev_attr.attr, | ||
1537 | &sensor_dev_attr_in2_alarm.dev_attr.attr, | ||
1538 | &sensor_dev_attr_in3_input.dev_attr.attr, | ||
1539 | &sensor_dev_attr_in3_min.dev_attr.attr, | ||
1540 | &sensor_dev_attr_in3_max.dev_attr.attr, | ||
1541 | &sensor_dev_attr_in3_alarm.dev_attr.attr, | ||
1542 | &sensor_dev_attr_in4_input.dev_attr.attr, | ||
1543 | &sensor_dev_attr_in4_min.dev_attr.attr, | ||
1544 | &sensor_dev_attr_in4_max.dev_attr.attr, | ||
1545 | &sensor_dev_attr_in4_alarm.dev_attr.attr, | ||
1546 | &sensor_dev_attr_in5_input.dev_attr.attr, | ||
1547 | &sensor_dev_attr_in5_min.dev_attr.attr, | ||
1548 | &sensor_dev_attr_in5_max.dev_attr.attr, | ||
1549 | &sensor_dev_attr_in5_alarm.dev_attr.attr, | ||
1550 | &sensor_dev_attr_in6_input.dev_attr.attr, | ||
1551 | &sensor_dev_attr_in6_min.dev_attr.attr, | ||
1552 | &sensor_dev_attr_in6_max.dev_attr.attr, | ||
1553 | &sensor_dev_attr_in6_alarm.dev_attr.attr, | ||
1597 | /* Temperatures */ | 1554 | /* Temperatures */ |
1598 | SENSOR_DEV_ATTR_TEMP(1), | 1555 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
1599 | SENSOR_DEV_ATTR_TEMP(2), | 1556 | &sensor_dev_attr_temp1_min.dev_attr.attr, |
1600 | SENSOR_DEV_ATTR_TEMP(3), | 1557 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
1558 | &sensor_dev_attr_temp1_alarm.dev_attr.attr, | ||
1559 | &sensor_dev_attr_temp1_fault.dev_attr.attr, | ||
1560 | &sensor_dev_attr_temp1_offset.dev_attr.attr, | ||
1561 | &sensor_dev_attr_temp2_input.dev_attr.attr, | ||
1562 | &sensor_dev_attr_temp2_min.dev_attr.attr, | ||
1563 | &sensor_dev_attr_temp2_max.dev_attr.attr, | ||
1564 | &sensor_dev_attr_temp2_alarm.dev_attr.attr, | ||
1565 | &sensor_dev_attr_temp2_fault.dev_attr.attr, | ||
1566 | &sensor_dev_attr_temp2_offset.dev_attr.attr, | ||
1567 | &sensor_dev_attr_temp3_input.dev_attr.attr, | ||
1568 | &sensor_dev_attr_temp3_min.dev_attr.attr, | ||
1569 | &sensor_dev_attr_temp3_max.dev_attr.attr, | ||
1570 | &sensor_dev_attr_temp3_alarm.dev_attr.attr, | ||
1571 | &sensor_dev_attr_temp3_fault.dev_attr.attr, | ||
1572 | &sensor_dev_attr_temp3_offset.dev_attr.attr, | ||
1601 | /* Zones */ | 1573 | /* Zones */ |
1602 | SENSOR_DEV_ATTR_ZONE(1), | 1574 | &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr, |
1603 | SENSOR_DEV_ATTR_ZONE(2), | 1575 | &sensor_dev_attr_zone1_auto_point1_temp.dev_attr.attr, |
1604 | SENSOR_DEV_ATTR_ZONE(3), | 1576 | &sensor_dev_attr_zone1_auto_point2_temp.dev_attr.attr, |
1577 | &sensor_dev_attr_zone1_auto_point3_temp.dev_attr.attr, | ||
1578 | &sensor_dev_attr_zone1_auto_channels_temp.dev_attr.attr, | ||
1579 | &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr, | ||
1580 | &sensor_dev_attr_zone2_auto_point1_temp.dev_attr.attr, | ||
1581 | &sensor_dev_attr_zone2_auto_point2_temp.dev_attr.attr, | ||
1582 | &sensor_dev_attr_zone2_auto_point3_temp.dev_attr.attr, | ||
1583 | &sensor_dev_attr_zone2_auto_channels_temp.dev_attr.attr, | ||
1584 | &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr, | ||
1585 | &sensor_dev_attr_zone3_auto_point1_temp.dev_attr.attr, | ||
1586 | &sensor_dev_attr_zone3_auto_point2_temp.dev_attr.attr, | ||
1587 | &sensor_dev_attr_zone3_auto_point3_temp.dev_attr.attr, | ||
1588 | &sensor_dev_attr_zone3_auto_channels_temp.dev_attr.attr, | ||
1605 | /* Misc */ | 1589 | /* Misc */ |
1606 | &dev_attr_vrm.attr, | 1590 | &dev_attr_vrm.attr, |
1607 | &dev_attr_cpu0_vid.attr, | 1591 | &dev_attr_cpu0_vid.attr, |
@@ -1616,23 +1600,48 @@ static const struct attribute_group dme1737_group = { | |||
1616 | * Their creation depends on the chip configuration which is determined during | 1600 | * Their creation depends on the chip configuration which is determined during |
1617 | * module load. */ | 1601 | * module load. */ |
1618 | static struct attribute *dme1737_attr_pwm1[] = { | 1602 | static struct attribute *dme1737_attr_pwm1[] = { |
1619 | SENSOR_DEV_ATTR_PWM_1TO3(1), | 1603 | &sensor_dev_attr_pwm1.dev_attr.attr, |
1604 | &sensor_dev_attr_pwm1_freq.dev_attr.attr, | ||
1605 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, | ||
1606 | &sensor_dev_attr_pwm1_ramp_rate.dev_attr.attr, | ||
1607 | &sensor_dev_attr_pwm1_auto_channels_zone.dev_attr.attr, | ||
1608 | &sensor_dev_attr_pwm1_auto_pwm_min.dev_attr.attr, | ||
1609 | &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, | ||
1610 | &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr, | ||
1620 | NULL | 1611 | NULL |
1621 | }; | 1612 | }; |
1622 | static struct attribute *dme1737_attr_pwm2[] = { | 1613 | static struct attribute *dme1737_attr_pwm2[] = { |
1623 | SENSOR_DEV_ATTR_PWM_1TO3(2), | 1614 | &sensor_dev_attr_pwm2.dev_attr.attr, |
1615 | &sensor_dev_attr_pwm2_freq.dev_attr.attr, | ||
1616 | &sensor_dev_attr_pwm2_enable.dev_attr.attr, | ||
1617 | &sensor_dev_attr_pwm2_ramp_rate.dev_attr.attr, | ||
1618 | &sensor_dev_attr_pwm2_auto_channels_zone.dev_attr.attr, | ||
1619 | &sensor_dev_attr_pwm2_auto_pwm_min.dev_attr.attr, | ||
1620 | &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, | ||
1621 | &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr, | ||
1624 | NULL | 1622 | NULL |
1625 | }; | 1623 | }; |
1626 | static struct attribute *dme1737_attr_pwm3[] = { | 1624 | static struct attribute *dme1737_attr_pwm3[] = { |
1627 | SENSOR_DEV_ATTR_PWM_1TO3(3), | 1625 | &sensor_dev_attr_pwm3.dev_attr.attr, |
1626 | &sensor_dev_attr_pwm3_freq.dev_attr.attr, | ||
1627 | &sensor_dev_attr_pwm3_enable.dev_attr.attr, | ||
1628 | &sensor_dev_attr_pwm3_ramp_rate.dev_attr.attr, | ||
1629 | &sensor_dev_attr_pwm3_auto_channels_zone.dev_attr.attr, | ||
1630 | &sensor_dev_attr_pwm3_auto_pwm_min.dev_attr.attr, | ||
1631 | &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, | ||
1632 | &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr, | ||
1628 | NULL | 1633 | NULL |
1629 | }; | 1634 | }; |
1630 | static struct attribute *dme1737_attr_pwm5[] = { | 1635 | static struct attribute *dme1737_attr_pwm5[] = { |
1631 | SENSOR_DEV_ATTR_PWM_5TO6(5), | 1636 | &sensor_dev_attr_pwm5.dev_attr.attr, |
1637 | &sensor_dev_attr_pwm5_freq.dev_attr.attr, | ||
1638 | &sensor_dev_attr_pwm5_enable.dev_attr.attr, | ||
1632 | NULL | 1639 | NULL |
1633 | }; | 1640 | }; |
1634 | static struct attribute *dme1737_attr_pwm6[] = { | 1641 | static struct attribute *dme1737_attr_pwm6[] = { |
1635 | SENSOR_DEV_ATTR_PWM_5TO6(6), | 1642 | &sensor_dev_attr_pwm6.dev_attr.attr, |
1643 | &sensor_dev_attr_pwm6_freq.dev_attr.attr, | ||
1644 | &sensor_dev_attr_pwm6_enable.dev_attr.attr, | ||
1636 | NULL | 1645 | NULL |
1637 | }; | 1646 | }; |
1638 | 1647 | ||
@@ -1649,27 +1658,45 @@ static const struct attribute_group dme1737_pwm_group[] = { | |||
1649 | * Their creation depends on the chip configuration which is determined during | 1658 | * Their creation depends on the chip configuration which is determined during |
1650 | * module load. */ | 1659 | * module load. */ |
1651 | static struct attribute *dme1737_attr_fan1[] = { | 1660 | static struct attribute *dme1737_attr_fan1[] = { |
1652 | SENSOR_DEV_ATTR_FAN_1TO4(1), | 1661 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
1662 | &sensor_dev_attr_fan1_min.dev_attr.attr, | ||
1663 | &sensor_dev_attr_fan1_alarm.dev_attr.attr, | ||
1664 | &sensor_dev_attr_fan1_type.dev_attr.attr, | ||
1653 | NULL | 1665 | NULL |
1654 | }; | 1666 | }; |
1655 | static struct attribute *dme1737_attr_fan2[] = { | 1667 | static struct attribute *dme1737_attr_fan2[] = { |
1656 | SENSOR_DEV_ATTR_FAN_1TO4(2), | 1668 | &sensor_dev_attr_fan2_input.dev_attr.attr, |
1669 | &sensor_dev_attr_fan2_min.dev_attr.attr, | ||
1670 | &sensor_dev_attr_fan2_alarm.dev_attr.attr, | ||
1671 | &sensor_dev_attr_fan2_type.dev_attr.attr, | ||
1657 | NULL | 1672 | NULL |
1658 | }; | 1673 | }; |
1659 | static struct attribute *dme1737_attr_fan3[] = { | 1674 | static struct attribute *dme1737_attr_fan3[] = { |
1660 | SENSOR_DEV_ATTR_FAN_1TO4(3), | 1675 | &sensor_dev_attr_fan3_input.dev_attr.attr, |
1676 | &sensor_dev_attr_fan3_min.dev_attr.attr, | ||
1677 | &sensor_dev_attr_fan3_alarm.dev_attr.attr, | ||
1678 | &sensor_dev_attr_fan3_type.dev_attr.attr, | ||
1661 | NULL | 1679 | NULL |
1662 | }; | 1680 | }; |
1663 | static struct attribute *dme1737_attr_fan4[] = { | 1681 | static struct attribute *dme1737_attr_fan4[] = { |
1664 | SENSOR_DEV_ATTR_FAN_1TO4(4), | 1682 | &sensor_dev_attr_fan4_input.dev_attr.attr, |
1683 | &sensor_dev_attr_fan4_min.dev_attr.attr, | ||
1684 | &sensor_dev_attr_fan4_alarm.dev_attr.attr, | ||
1685 | &sensor_dev_attr_fan4_type.dev_attr.attr, | ||
1665 | NULL | 1686 | NULL |
1666 | }; | 1687 | }; |
1667 | static struct attribute *dme1737_attr_fan5[] = { | 1688 | static struct attribute *dme1737_attr_fan5[] = { |
1668 | SENSOR_DEV_ATTR_FAN_5TO6(5), | 1689 | &sensor_dev_attr_fan5_input.dev_attr.attr, |
1690 | &sensor_dev_attr_fan5_min.dev_attr.attr, | ||
1691 | &sensor_dev_attr_fan5_alarm.dev_attr.attr, | ||
1692 | &sensor_dev_attr_fan5_max.dev_attr.attr, | ||
1669 | NULL | 1693 | NULL |
1670 | }; | 1694 | }; |
1671 | static struct attribute *dme1737_attr_fan6[] = { | 1695 | static struct attribute *dme1737_attr_fan6[] = { |
1672 | SENSOR_DEV_ATTR_FAN_5TO6(6), | 1696 | &sensor_dev_attr_fan6_input.dev_attr.attr, |
1697 | &sensor_dev_attr_fan6_min.dev_attr.attr, | ||
1698 | &sensor_dev_attr_fan6_alarm.dev_attr.attr, | ||
1699 | &sensor_dev_attr_fan6_max.dev_attr.attr, | ||
1673 | NULL | 1700 | NULL |
1674 | }; | 1701 | }; |
1675 | 1702 | ||
@@ -1686,13 +1713,22 @@ static const struct attribute_group dme1737_fan_group[] = { | |||
1686 | * writeable if the chip is *not* locked. Otherwise they stay read-only. */ | 1713 | * writeable if the chip is *not* locked. Otherwise they stay read-only. */ |
1687 | static struct attribute *dme1737_attr_lock[] = { | 1714 | static struct attribute *dme1737_attr_lock[] = { |
1688 | /* Temperatures */ | 1715 | /* Temperatures */ |
1689 | SENSOR_DEV_ATTR_TEMP_LOCK(1), | 1716 | &sensor_dev_attr_temp1_offset.dev_attr.attr, |
1690 | SENSOR_DEV_ATTR_TEMP_LOCK(2), | 1717 | &sensor_dev_attr_temp2_offset.dev_attr.attr, |
1691 | SENSOR_DEV_ATTR_TEMP_LOCK(3), | 1718 | &sensor_dev_attr_temp3_offset.dev_attr.attr, |
1692 | /* Zones */ | 1719 | /* Zones */ |
1693 | SENSOR_DEV_ATTR_ZONE_LOCK(1), | 1720 | &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr, |
1694 | SENSOR_DEV_ATTR_ZONE_LOCK(2), | 1721 | &sensor_dev_attr_zone1_auto_point1_temp.dev_attr.attr, |
1695 | SENSOR_DEV_ATTR_ZONE_LOCK(3), | 1722 | &sensor_dev_attr_zone1_auto_point2_temp.dev_attr.attr, |
1723 | &sensor_dev_attr_zone1_auto_point3_temp.dev_attr.attr, | ||
1724 | &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr, | ||
1725 | &sensor_dev_attr_zone2_auto_point1_temp.dev_attr.attr, | ||
1726 | &sensor_dev_attr_zone2_auto_point2_temp.dev_attr.attr, | ||
1727 | &sensor_dev_attr_zone2_auto_point3_temp.dev_attr.attr, | ||
1728 | &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr, | ||
1729 | &sensor_dev_attr_zone3_auto_point1_temp.dev_attr.attr, | ||
1730 | &sensor_dev_attr_zone3_auto_point2_temp.dev_attr.attr, | ||
1731 | &sensor_dev_attr_zone3_auto_point3_temp.dev_attr.attr, | ||
1696 | NULL | 1732 | NULL |
1697 | }; | 1733 | }; |
1698 | 1734 | ||
@@ -1704,23 +1740,40 @@ static const struct attribute_group dme1737_lock_group = { | |||
1704 | * writeable if the chip is *not* locked and the respective PWM is available. | 1740 | * writeable if the chip is *not* locked and the respective PWM is available. |
1705 | * Otherwise they stay read-only. */ | 1741 | * Otherwise they stay read-only. */ |
1706 | static struct attribute *dme1737_attr_pwm1_lock[] = { | 1742 | static struct attribute *dme1737_attr_pwm1_lock[] = { |
1707 | SENSOR_DEV_ATTR_PWM_1TO3_LOCK(1), | 1743 | &sensor_dev_attr_pwm1_freq.dev_attr.attr, |
1744 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, | ||
1745 | &sensor_dev_attr_pwm1_ramp_rate.dev_attr.attr, | ||
1746 | &sensor_dev_attr_pwm1_auto_channels_zone.dev_attr.attr, | ||
1747 | &sensor_dev_attr_pwm1_auto_pwm_min.dev_attr.attr, | ||
1748 | &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, | ||
1708 | NULL | 1749 | NULL |
1709 | }; | 1750 | }; |
1710 | static struct attribute *dme1737_attr_pwm2_lock[] = { | 1751 | static struct attribute *dme1737_attr_pwm2_lock[] = { |
1711 | SENSOR_DEV_ATTR_PWM_1TO3_LOCK(2), | 1752 | &sensor_dev_attr_pwm2_freq.dev_attr.attr, |
1753 | &sensor_dev_attr_pwm2_enable.dev_attr.attr, | ||
1754 | &sensor_dev_attr_pwm2_ramp_rate.dev_attr.attr, | ||
1755 | &sensor_dev_attr_pwm2_auto_channels_zone.dev_attr.attr, | ||
1756 | &sensor_dev_attr_pwm2_auto_pwm_min.dev_attr.attr, | ||
1757 | &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, | ||
1712 | NULL | 1758 | NULL |
1713 | }; | 1759 | }; |
1714 | static struct attribute *dme1737_attr_pwm3_lock[] = { | 1760 | static struct attribute *dme1737_attr_pwm3_lock[] = { |
1715 | SENSOR_DEV_ATTR_PWM_1TO3_LOCK(3), | 1761 | &sensor_dev_attr_pwm3_freq.dev_attr.attr, |
1762 | &sensor_dev_attr_pwm3_enable.dev_attr.attr, | ||
1763 | &sensor_dev_attr_pwm3_ramp_rate.dev_attr.attr, | ||
1764 | &sensor_dev_attr_pwm3_auto_channels_zone.dev_attr.attr, | ||
1765 | &sensor_dev_attr_pwm3_auto_pwm_min.dev_attr.attr, | ||
1766 | &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, | ||
1716 | NULL | 1767 | NULL |
1717 | }; | 1768 | }; |
1718 | static struct attribute *dme1737_attr_pwm5_lock[] = { | 1769 | static struct attribute *dme1737_attr_pwm5_lock[] = { |
1719 | SENSOR_DEV_ATTR_PWM_5TO6_LOCK(5), | 1770 | &sensor_dev_attr_pwm5.dev_attr.attr, |
1771 | &sensor_dev_attr_pwm5_freq.dev_attr.attr, | ||
1720 | NULL | 1772 | NULL |
1721 | }; | 1773 | }; |
1722 | static struct attribute *dme1737_attr_pwm6_lock[] = { | 1774 | static struct attribute *dme1737_attr_pwm6_lock[] = { |
1723 | SENSOR_DEV_ATTR_PWM_5TO6_LOCK(6), | 1775 | &sensor_dev_attr_pwm6.dev_attr.attr, |
1776 | &sensor_dev_attr_pwm6_freq.dev_attr.attr, | ||
1724 | NULL | 1777 | NULL |
1725 | }; | 1778 | }; |
1726 | 1779 | ||