Lines Matching refs:attr
781 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_min_show() local
784 if (!temp_enabled(data, attr->index)) in temp_min_show()
787 return sprintf(buf, "%d\n", 1000 * (data->temp_min[attr->index] - 64)); in temp_min_show()
794 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_min_store() local
799 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) in temp_min_store()
806 data->temp_min[attr->index] = temp; in temp_min_store()
807 i2c_smbus_write_byte_data(client, ADT7462_TEMP_MIN_REG(attr->index), in temp_min_store()
817 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_max_show() local
820 if (!temp_enabled(data, attr->index)) in temp_max_show()
823 return sprintf(buf, "%d\n", 1000 * (data->temp_max[attr->index] - 64)); in temp_max_show()
830 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_max_store() local
835 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) in temp_max_store()
842 data->temp_max[attr->index] = temp; in temp_max_store()
843 i2c_smbus_write_byte_data(client, ADT7462_TEMP_MAX_REG(attr->index), in temp_max_store()
853 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_show() local
855 u8 frac = data->temp_frac[attr->index] >> TEMP_FRAC_OFFSET; in temp_show()
857 if (!temp_enabled(data, attr->index)) in temp_show()
860 return sprintf(buf, "%d\n", 1000 * (data->temp[attr->index] - 64) + in temp_show()
867 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in temp_label_show() local
870 return sprintf(buf, "%s\n", temp_label(data, attr->index)); in temp_label_show()
876 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in volt_max_show() local
878 int x = voltage_multiplier(data, attr->index); in volt_max_show()
880 x *= data->volt_max[attr->index]; in volt_max_show()
890 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in volt_max_store() local
893 int x = voltage_multiplier(data, attr->index); in volt_max_store()
904 data->volt_max[attr->index] = temp; in volt_max_store()
906 ADT7462_REG_VOLT_MAX(data, attr->index), in volt_max_store()
916 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in volt_min_show() local
918 int x = voltage_multiplier(data, attr->index); in volt_min_show()
920 x *= data->volt_min[attr->index]; in volt_min_show()
930 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in volt_min_store() local
933 int x = voltage_multiplier(data, attr->index); in volt_min_store()
944 data->volt_min[attr->index] = temp; in volt_min_store()
946 ADT7462_REG_VOLT_MIN(data, attr->index), in volt_min_store()
956 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in voltage_show() local
958 int x = voltage_multiplier(data, attr->index); in voltage_show()
960 x *= data->voltages[attr->index]; in voltage_show()
969 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in voltage_label_show() local
972 return sprintf(buf, "%s\n", voltage_label(data, attr->index)); in voltage_label_show()
978 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in alarm_show() local
980 int reg = attr->index >> ADT7462_ALARM_REG_SHIFT; in alarm_show()
981 int mask = attr->index & ADT7462_ALARM_FLAG_MASK; in alarm_show()
997 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in fan_min_show() local
1002 temp = data->fan_min[attr->index]; in fan_min_show()
1005 if (!fan_enabled(data, attr->index) || in fan_min_show()
1016 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in fan_min_store() local
1022 !fan_enabled(data, attr->index)) in fan_min_store()
1030 data->fan_min[attr->index] = temp; in fan_min_store()
1031 i2c_smbus_write_byte_data(client, ADT7462_REG_FAN_MIN(attr->index), in fan_min_store()
1041 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in fan_show() local
1044 if (!fan_enabled(data, attr->index) || in fan_show()
1045 !FAN_DATA_VALID(data->fan[attr->index])) in fan_show()
1049 FAN_PERIOD_TO_RPM(data->fan[attr->index])); in fan_show()
1087 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_show() local
1089 return sprintf(buf, "%d\n", data->pwm[attr->index]); in pwm_show()
1095 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_store() local
1106 data->pwm[attr->index] = temp; in pwm_store()
1107 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM(attr->index), temp); in pwm_store()
1144 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_min_show() local
1146 return sprintf(buf, "%d\n", data->pwm_min[attr->index]); in pwm_min_show()
1153 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_min_store() local
1164 data->pwm_min[attr->index] = temp; in pwm_min_store()
1165 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_MIN(attr->index), in pwm_min_store()
1175 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_hyst_show() local
1178 (data->pwm_trange[attr->index] & ADT7462_PWM_HYST_MASK)); in pwm_hyst_show()
1185 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_hyst_store() local
1198 temp |= data->pwm_trange[attr->index] & ADT7462_PWM_RANGE_MASK; in pwm_hyst_store()
1201 data->pwm_trange[attr->index] = temp; in pwm_hyst_store()
1202 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_TRANGE(attr->index), in pwm_hyst_store()
1212 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_tmax_show() local
1216 int trange = trange_values[data->pwm_trange[attr->index] >> in pwm_tmax_show()
1218 int tmin = (data->pwm_tmin[attr->index] - 64) * 1000; in pwm_tmax_show()
1228 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_tmax_store() local
1238 tmin = (data->pwm_tmin[attr->index] - 64) * 1000; in pwm_tmax_store()
1244 temp |= data->pwm_trange[attr->index] & ADT7462_PWM_HYST_MASK; in pwm_tmax_store()
1247 data->pwm_trange[attr->index] = temp; in pwm_tmax_store()
1248 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_TRANGE(attr->index), in pwm_tmax_store()
1258 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_tmin_show() local
1260 return sprintf(buf, "%d\n", 1000 * (data->pwm_tmin[attr->index] - 64)); in pwm_tmin_show()
1267 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_tmin_store() local
1279 data->pwm_tmin[attr->index] = temp; in pwm_tmin_store()
1280 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_TMIN(attr->index), in pwm_tmin_store()
1290 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_auto_show() local
1292 int cfg = data->pwm_cfg[attr->index] >> ADT7462_PWM_CHANNEL_SHIFT; in pwm_auto_show()
1322 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_auto_store() local
1332 set_pwm_channel(client, data, attr->index, 4); in pwm_auto_store()
1335 set_pwm_channel(client, data, attr->index, 7); in pwm_auto_store()
1345 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_auto_temp_show() local
1347 int channel = data->pwm_cfg[attr->index] >> ADT7462_PWM_CHANNEL_SHIFT; in pwm_auto_temp_show()
1379 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); in pwm_auto_temp_store() local
1391 set_pwm_channel(client, data, attr->index, temp); in pwm_auto_temp_store()
1591 &sensor_dev_attr_temp1_max.dev_attr.attr,
1592 &sensor_dev_attr_temp2_max.dev_attr.attr,
1593 &sensor_dev_attr_temp3_max.dev_attr.attr,
1594 &sensor_dev_attr_temp4_max.dev_attr.attr,
1596 &sensor_dev_attr_temp1_min.dev_attr.attr,
1597 &sensor_dev_attr_temp2_min.dev_attr.attr,
1598 &sensor_dev_attr_temp3_min.dev_attr.attr,
1599 &sensor_dev_attr_temp4_min.dev_attr.attr,
1601 &sensor_dev_attr_temp1_input.dev_attr.attr,
1602 &sensor_dev_attr_temp2_input.dev_attr.attr,
1603 &sensor_dev_attr_temp3_input.dev_attr.attr,
1604 &sensor_dev_attr_temp4_input.dev_attr.attr,
1606 &sensor_dev_attr_temp1_label.dev_attr.attr,
1607 &sensor_dev_attr_temp2_label.dev_attr.attr,
1608 &sensor_dev_attr_temp3_label.dev_attr.attr,
1609 &sensor_dev_attr_temp4_label.dev_attr.attr,
1611 &sensor_dev_attr_temp1_alarm.dev_attr.attr,
1612 &sensor_dev_attr_temp2_alarm.dev_attr.attr,
1613 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
1614 &sensor_dev_attr_temp4_alarm.dev_attr.attr,
1616 &sensor_dev_attr_in1_max.dev_attr.attr,
1617 &sensor_dev_attr_in2_max.dev_attr.attr,
1618 &sensor_dev_attr_in3_max.dev_attr.attr,
1619 &sensor_dev_attr_in4_max.dev_attr.attr,
1620 &sensor_dev_attr_in5_max.dev_attr.attr,
1621 &sensor_dev_attr_in6_max.dev_attr.attr,
1622 &sensor_dev_attr_in7_max.dev_attr.attr,
1623 &sensor_dev_attr_in8_max.dev_attr.attr,
1624 &sensor_dev_attr_in9_max.dev_attr.attr,
1625 &sensor_dev_attr_in10_max.dev_attr.attr,
1626 &sensor_dev_attr_in11_max.dev_attr.attr,
1627 &sensor_dev_attr_in12_max.dev_attr.attr,
1628 &sensor_dev_attr_in13_max.dev_attr.attr,
1630 &sensor_dev_attr_in1_min.dev_attr.attr,
1631 &sensor_dev_attr_in2_min.dev_attr.attr,
1632 &sensor_dev_attr_in3_min.dev_attr.attr,
1633 &sensor_dev_attr_in4_min.dev_attr.attr,
1634 &sensor_dev_attr_in5_min.dev_attr.attr,
1635 &sensor_dev_attr_in6_min.dev_attr.attr,
1636 &sensor_dev_attr_in7_min.dev_attr.attr,
1637 &sensor_dev_attr_in8_min.dev_attr.attr,
1638 &sensor_dev_attr_in9_min.dev_attr.attr,
1639 &sensor_dev_attr_in10_min.dev_attr.attr,
1640 &sensor_dev_attr_in11_min.dev_attr.attr,
1641 &sensor_dev_attr_in12_min.dev_attr.attr,
1642 &sensor_dev_attr_in13_min.dev_attr.attr,
1644 &sensor_dev_attr_in1_input.dev_attr.attr,
1645 &sensor_dev_attr_in2_input.dev_attr.attr,
1646 &sensor_dev_attr_in3_input.dev_attr.attr,
1647 &sensor_dev_attr_in4_input.dev_attr.attr,
1648 &sensor_dev_attr_in5_input.dev_attr.attr,
1649 &sensor_dev_attr_in6_input.dev_attr.attr,
1650 &sensor_dev_attr_in7_input.dev_attr.attr,
1651 &sensor_dev_attr_in8_input.dev_attr.attr,
1652 &sensor_dev_attr_in9_input.dev_attr.attr,
1653 &sensor_dev_attr_in10_input.dev_attr.attr,
1654 &sensor_dev_attr_in11_input.dev_attr.attr,
1655 &sensor_dev_attr_in12_input.dev_attr.attr,
1656 &sensor_dev_attr_in13_input.dev_attr.attr,
1658 &sensor_dev_attr_in1_label.dev_attr.attr,
1659 &sensor_dev_attr_in2_label.dev_attr.attr,
1660 &sensor_dev_attr_in3_label.dev_attr.attr,
1661 &sensor_dev_attr_in4_label.dev_attr.attr,
1662 &sensor_dev_attr_in5_label.dev_attr.attr,
1663 &sensor_dev_attr_in6_label.dev_attr.attr,
1664 &sensor_dev_attr_in7_label.dev_attr.attr,
1665 &sensor_dev_attr_in8_label.dev_attr.attr,
1666 &sensor_dev_attr_in9_label.dev_attr.attr,
1667 &sensor_dev_attr_in10_label.dev_attr.attr,
1668 &sensor_dev_attr_in11_label.dev_attr.attr,
1669 &sensor_dev_attr_in12_label.dev_attr.attr,
1670 &sensor_dev_attr_in13_label.dev_attr.attr,
1672 &sensor_dev_attr_in1_alarm.dev_attr.attr,
1673 &sensor_dev_attr_in2_alarm.dev_attr.attr,
1674 &sensor_dev_attr_in3_alarm.dev_attr.attr,
1675 &sensor_dev_attr_in4_alarm.dev_attr.attr,
1676 &sensor_dev_attr_in5_alarm.dev_attr.attr,
1677 &sensor_dev_attr_in6_alarm.dev_attr.attr,
1678 &sensor_dev_attr_in7_alarm.dev_attr.attr,
1679 &sensor_dev_attr_in8_alarm.dev_attr.attr,
1680 &sensor_dev_attr_in9_alarm.dev_attr.attr,
1681 &sensor_dev_attr_in10_alarm.dev_attr.attr,
1682 &sensor_dev_attr_in11_alarm.dev_attr.attr,
1683 &sensor_dev_attr_in12_alarm.dev_attr.attr,
1684 &sensor_dev_attr_in13_alarm.dev_attr.attr,
1686 &sensor_dev_attr_fan1_min.dev_attr.attr,
1687 &sensor_dev_attr_fan2_min.dev_attr.attr,
1688 &sensor_dev_attr_fan3_min.dev_attr.attr,
1689 &sensor_dev_attr_fan4_min.dev_attr.attr,
1690 &sensor_dev_attr_fan5_min.dev_attr.attr,
1691 &sensor_dev_attr_fan6_min.dev_attr.attr,
1692 &sensor_dev_attr_fan7_min.dev_attr.attr,
1693 &sensor_dev_attr_fan8_min.dev_attr.attr,
1695 &sensor_dev_attr_fan1_input.dev_attr.attr,
1696 &sensor_dev_attr_fan2_input.dev_attr.attr,
1697 &sensor_dev_attr_fan3_input.dev_attr.attr,
1698 &sensor_dev_attr_fan4_input.dev_attr.attr,
1699 &sensor_dev_attr_fan5_input.dev_attr.attr,
1700 &sensor_dev_attr_fan6_input.dev_attr.attr,
1701 &sensor_dev_attr_fan7_input.dev_attr.attr,
1702 &sensor_dev_attr_fan8_input.dev_attr.attr,
1704 &sensor_dev_attr_fan1_alarm.dev_attr.attr,
1705 &sensor_dev_attr_fan2_alarm.dev_attr.attr,
1706 &sensor_dev_attr_fan3_alarm.dev_attr.attr,
1707 &sensor_dev_attr_fan4_alarm.dev_attr.attr,
1708 &sensor_dev_attr_fan5_alarm.dev_attr.attr,
1709 &sensor_dev_attr_fan6_alarm.dev_attr.attr,
1710 &sensor_dev_attr_fan7_alarm.dev_attr.attr,
1711 &sensor_dev_attr_fan8_alarm.dev_attr.attr,
1713 &sensor_dev_attr_force_pwm_max.dev_attr.attr,
1714 &sensor_dev_attr_pwm1.dev_attr.attr,
1715 &sensor_dev_attr_pwm2.dev_attr.attr,
1716 &sensor_dev_attr_pwm3.dev_attr.attr,
1717 &sensor_dev_attr_pwm4.dev_attr.attr,
1719 &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
1720 &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
1721 &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
1722 &sensor_dev_attr_pwm4_auto_point1_pwm.dev_attr.attr,
1724 &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
1725 &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
1726 &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
1727 &sensor_dev_attr_pwm4_auto_point2_pwm.dev_attr.attr,
1729 &sensor_dev_attr_temp1_auto_point1_hyst.dev_attr.attr,
1730 &sensor_dev_attr_temp2_auto_point1_hyst.dev_attr.attr,
1731 &sensor_dev_attr_temp3_auto_point1_hyst.dev_attr.attr,
1732 &sensor_dev_attr_temp4_auto_point1_hyst.dev_attr.attr,
1734 &sensor_dev_attr_temp1_auto_point2_hyst.dev_attr.attr,
1735 &sensor_dev_attr_temp2_auto_point2_hyst.dev_attr.attr,
1736 &sensor_dev_attr_temp3_auto_point2_hyst.dev_attr.attr,
1737 &sensor_dev_attr_temp4_auto_point2_hyst.dev_attr.attr,
1739 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr,
1740 &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr,
1741 &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr,
1742 &sensor_dev_attr_temp4_auto_point1_temp.dev_attr.attr,
1744 &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr,
1745 &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr,
1746 &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr,
1747 &sensor_dev_attr_temp4_auto_point2_temp.dev_attr.attr,
1749 &sensor_dev_attr_pwm1_enable.dev_attr.attr,
1750 &sensor_dev_attr_pwm2_enable.dev_attr.attr,
1751 &sensor_dev_attr_pwm3_enable.dev_attr.attr,
1752 &sensor_dev_attr_pwm4_enable.dev_attr.attr,
1754 &sensor_dev_attr_pwm1_auto_channels_temp.dev_attr.attr,
1755 &sensor_dev_attr_pwm2_auto_channels_temp.dev_attr.attr,
1756 &sensor_dev_attr_pwm3_auto_channels_temp.dev_attr.attr,
1757 &sensor_dev_attr_pwm4_auto_channels_temp.dev_attr.attr,