22 #include <linux/module.h>
24 #include <linux/i2c.h>
30 #include <linux/slab.h>
33 static const unsigned short normal_i2c[] = { 0x58, 0x5C,
I2C_CLIENT_END };
36 #define ADT7462_REG_DEVICE 0x3D
37 #define ADT7462_REG_VENDOR 0x3E
38 #define ADT7462_REG_REVISION 0x3F
40 #define ADT7462_REG_MIN_TEMP_BASE_ADDR 0x44
41 #define ADT7462_REG_MIN_TEMP_MAX_ADDR 0x47
42 #define ADT7462_REG_MAX_TEMP_BASE_ADDR 0x48
43 #define ADT7462_REG_MAX_TEMP_MAX_ADDR 0x4B
44 #define ADT7462_REG_TEMP_BASE_ADDR 0x88
45 #define ADT7462_REG_TEMP_MAX_ADDR 0x8F
47 #define ADT7462_REG_FAN_BASE_ADDR 0x98
48 #define ADT7462_REG_FAN_MAX_ADDR 0x9F
49 #define ADT7462_REG_FAN2_BASE_ADDR 0xA2
50 #define ADT7462_REG_FAN2_MAX_ADDR 0xA9
51 #define ADT7462_REG_FAN_ENABLE 0x07
52 #define ADT7462_REG_FAN_MIN_BASE_ADDR 0x78
53 #define ADT7462_REG_FAN_MIN_MAX_ADDR 0x7F
55 #define ADT7462_REG_CFG2 0x02
56 #define ADT7462_FSPD_MASK 0x20
58 #define ADT7462_REG_PWM_BASE_ADDR 0xAA
59 #define ADT7462_REG_PWM_MAX_ADDR 0xAD
60 #define ADT7462_REG_PWM_MIN_BASE_ADDR 0x28
61 #define ADT7462_REG_PWM_MIN_MAX_ADDR 0x2B
62 #define ADT7462_REG_PWM_MAX 0x2C
63 #define ADT7462_REG_PWM_TEMP_MIN_BASE_ADDR 0x5C
64 #define ADT7462_REG_PWM_TEMP_MIN_MAX_ADDR 0x5F
65 #define ADT7462_REG_PWM_TEMP_RANGE_BASE_ADDR 0x60
66 #define ADT7462_REG_PWM_TEMP_RANGE_MAX_ADDR 0x63
67 #define ADT7462_PWM_HYST_MASK 0x0F
68 #define ADT7462_PWM_RANGE_MASK 0xF0
69 #define ADT7462_PWM_RANGE_SHIFT 4
70 #define ADT7462_REG_PWM_CFG_BASE_ADDR 0x21
71 #define ADT7462_REG_PWM_CFG_MAX_ADDR 0x24
72 #define ADT7462_PWM_CHANNEL_MASK 0xE0
73 #define ADT7462_PWM_CHANNEL_SHIFT 5
75 #define ADT7462_REG_PIN_CFG_BASE_ADDR 0x10
76 #define ADT7462_REG_PIN_CFG_MAX_ADDR 0x13
77 #define ADT7462_PIN7_INPUT 0x01
78 #define ADT7462_DIODE3_INPUT 0x20
79 #define ADT7462_DIODE1_INPUT 0x40
80 #define ADT7462_VID_INPUT 0x80
81 #define ADT7462_PIN22_INPUT 0x04
82 #define ADT7462_PIN21_INPUT 0x08
83 #define ADT7462_PIN19_INPUT 0x10
84 #define ADT7462_PIN15_INPUT 0x20
85 #define ADT7462_PIN13_INPUT 0x40
86 #define ADT7462_PIN8_INPUT 0x80
87 #define ADT7462_PIN23_MASK 0x03
88 #define ADT7462_PIN23_SHIFT 0
89 #define ADT7462_PIN26_MASK 0x0C
90 #define ADT7462_PIN26_SHIFT 2
91 #define ADT7462_PIN25_MASK 0x30
92 #define ADT7462_PIN25_SHIFT 4
93 #define ADT7462_PIN24_MASK 0xC0
94 #define ADT7462_PIN24_SHIFT 6
95 #define ADT7462_PIN26_VOLT_INPUT 0x08
96 #define ADT7462_PIN25_VOLT_INPUT 0x20
97 #define ADT7462_PIN28_SHIFT 4
98 #define ADT7462_PIN28_VOLT 0x5
100 #define ADT7462_REG_ALARM1 0xB8
101 #define ADT7462_LT_ALARM 0x02
102 #define ADT7462_R1T_ALARM 0x04
103 #define ADT7462_R2T_ALARM 0x08
104 #define ADT7462_R3T_ALARM 0x10
105 #define ADT7462_REG_ALARM2 0xBB
106 #define ADT7462_V0_ALARM 0x01
107 #define ADT7462_V1_ALARM 0x02
108 #define ADT7462_V2_ALARM 0x04
109 #define ADT7462_V3_ALARM 0x08
110 #define ADT7462_V4_ALARM 0x10
111 #define ADT7462_V5_ALARM 0x20
112 #define ADT7462_V6_ALARM 0x40
113 #define ADT7462_V7_ALARM 0x80
114 #define ADT7462_REG_ALARM3 0xBC
115 #define ADT7462_V8_ALARM 0x08
116 #define ADT7462_V9_ALARM 0x10
117 #define ADT7462_V10_ALARM 0x20
118 #define ADT7462_V11_ALARM 0x40
119 #define ADT7462_V12_ALARM 0x80
120 #define ADT7462_REG_ALARM4 0xBD
121 #define ADT7462_F0_ALARM 0x01
122 #define ADT7462_F1_ALARM 0x02
123 #define ADT7462_F2_ALARM 0x04
124 #define ADT7462_F3_ALARM 0x08
125 #define ADT7462_F4_ALARM 0x10
126 #define ADT7462_F5_ALARM 0x20
127 #define ADT7462_F6_ALARM 0x40
128 #define ADT7462_F7_ALARM 0x80
129 #define ADT7462_ALARM1 0x0000
130 #define ADT7462_ALARM2 0x0100
131 #define ADT7462_ALARM3 0x0200
132 #define ADT7462_ALARM4 0x0300
133 #define ADT7462_ALARM_REG_SHIFT 8
134 #define ADT7462_ALARM_FLAG_MASK 0x0F
136 #define ADT7462_TEMP_COUNT 4
137 #define ADT7462_TEMP_REG(x) (ADT7462_REG_TEMP_BASE_ADDR + ((x) * 2))
138 #define ADT7462_TEMP_MIN_REG(x) (ADT7462_REG_MIN_TEMP_BASE_ADDR + (x))
139 #define ADT7462_TEMP_MAX_REG(x) (ADT7462_REG_MAX_TEMP_BASE_ADDR + (x))
140 #define TEMP_FRAC_OFFSET 6
142 #define ADT7462_FAN_COUNT 8
143 #define ADT7462_REG_FAN_MIN(x) (ADT7462_REG_FAN_MIN_BASE_ADDR + (x))
145 #define ADT7462_PWM_COUNT 4
146 #define ADT7462_REG_PWM(x) (ADT7462_REG_PWM_BASE_ADDR + (x))
147 #define ADT7462_REG_PWM_MIN(x) (ADT7462_REG_PWM_MIN_BASE_ADDR + (x))
148 #define ADT7462_REG_PWM_TMIN(x) \
149 (ADT7462_REG_PWM_TEMP_MIN_BASE_ADDR + (x))
150 #define ADT7462_REG_PWM_TRANGE(x) \
151 (ADT7462_REG_PWM_TEMP_RANGE_BASE_ADDR + (x))
153 #define ADT7462_PIN_CFG_REG_COUNT 4
154 #define ADT7462_REG_PIN_CFG(x) (ADT7462_REG_PIN_CFG_BASE_ADDR + (x))
155 #define ADT7462_REG_PWM_CFG(x) (ADT7462_REG_PWM_CFG_BASE_ADDR + (x))
157 #define ADT7462_ALARM_REG_COUNT 4
182 #define ADT7462_VOLT_COUNT 13
184 #define ADT7462_VENDOR 0x41
185 #define ADT7462_DEVICE 0x62
187 #define ADT7462_REVISION 0x04
190 #define SENSOR_REFRESH_INTERVAL (2 * HZ)
193 #define LIMIT_REFRESH_INTERVAL (60 * HZ)
196 #define FAN_PERIOD_TO_RPM(x) ((90000 * 60) / (x))
197 #define FAN_RPM_TO_PERIOD FAN_PERIOD_TO_RPM
198 #define FAN_PERIOD_INVALID 65535
199 #define FAN_DATA_VALID(x) ((x) && (x) != FAN_PERIOD_INVALID)
201 #define MASK_AND_SHIFT(value, prefix) \
202 (((value) & prefix##_MASK) >> prefix##_SHIFT)
252 .probe = adt7462_probe,
253 .remove = adt7462_remove,
254 .id_table = adt7462_id,
255 .detect = adt7462_detect,
256 .address_list = normal_i2c,
272 static int ADT7462_REG_FAN(
int fan)
339 static int ADT7462_REG_VOLT_MIN(
struct adt7462_data *data,
int which)
398 static int ADT7462_REG_VOLT(
struct adt7462_data *data,
int which)
458 static const char *voltage_label(
struct adt7462_data *data,
int which)
543 return "+1.5V 3GPIO";
550 static int voltage_multiplier(
struct adt7462_data *data,
int which)
637 static int temp_enabled(
struct adt7462_data *data,
int which)
655 static const char *temp_label(
struct adt7462_data *data,
int which)
675 #define NUM_TRANGE_VALUES 16
695 static int find_trange_value(
int trange)
700 if (trange_values[i] == trange)
710 unsigned long local_jiffies =
jiffies;
717 goto no_sensor_update;
731 data->
fan[i] = adt7462_read_word_data(client,
746 int reg = ADT7462_REG_VOLT(data, i);
780 int reg = ADT7462_REG_VOLT_MAX(data, i);
784 reg = ADT7462_REG_VOLT_MIN(data, i);
819 if (!temp_enabled(data, attr->
index))
835 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->
index))
839 temp = SENSORS_LIMIT(temp, 0, 255);
857 if (!temp_enabled(data, attr->
index))
873 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->
index))
877 temp = SENSORS_LIMIT(temp, 0, 255);
895 if (!temp_enabled(data, attr->
index))
909 return sprintf(buf,
"%s\n", temp_label(data, attr->
index));
918 int x = voltage_multiplier(data, attr->
index);
923 return sprintf(buf,
"%d\n", x);
934 int x = voltage_multiplier(data, attr->
index);
937 if (kstrtol(buf, 10, &temp) || !x)
942 temp = SENSORS_LIMIT(temp, 0, 255);
947 ADT7462_REG_VOLT_MAX(data, attr->
index),
960 int x = voltage_multiplier(data, attr->
index);
965 return sprintf(buf,
"%d\n", x);
976 int x = voltage_multiplier(data, attr->
index);
979 if (kstrtol(buf, 10, &temp) || !x)
984 temp = SENSORS_LIMIT(temp, 0, 255);
989 ADT7462_REG_VOLT_MIN(data, attr->
index),
1001 struct adt7462_data *data = adt7462_update_device(dev);
1002 int x = voltage_multiplier(data, attr->
index);
1007 return sprintf(buf,
"%d\n", x);
1015 struct adt7462_data *data = adt7462_update_device(dev);
1017 return sprintf(buf,
"%s\n", voltage_label(data, attr->
index));
1025 struct adt7462_data *data = adt7462_update_device(dev);
1029 if (data->
alarms[reg] & mask)
1045 struct adt7462_data *data = adt7462_update_device(dev);
1061 const char *buf,
size_t count)
1065 struct adt7462_data *data = i2c_get_clientdata(client);
1068 if (kstrtol(buf, 10, &temp) || !temp ||
1074 temp = SENSORS_LIMIT(temp, 1, 255);
1089 struct adt7462_data *data = adt7462_update_device(dev);
1103 struct adt7462_data *data = adt7462_update_device(dev);
1113 struct adt7462_data *data = i2c_get_clientdata(client);
1117 if (kstrtol(buf, 10, &temp))
1137 struct adt7462_data *data = adt7462_update_device(dev);
1142 const char *buf,
size_t count)
1146 struct adt7462_data *data = i2c_get_clientdata(client);
1149 if (kstrtol(buf, 10, &temp))
1152 temp = SENSORS_LIMIT(temp, 0, 255);
1166 struct adt7462_data *data = adt7462_update_device(dev);
1176 struct adt7462_data *data = i2c_get_clientdata(client);
1179 if (kstrtol(buf, 10, &temp))
1182 temp = SENSORS_LIMIT(temp, 0, 255);
1197 struct adt7462_data *data = adt7462_update_device(dev);
1208 struct adt7462_data *data = i2c_get_clientdata(client);
1211 if (kstrtol(buf, 10, &temp))
1214 temp = SENSORS_LIMIT(temp, 0, 255);
1230 struct adt7462_data *data = adt7462_update_device(dev);
1231 return sprintf(buf,
"%d\n", 1000 *
1242 struct adt7462_data *data = i2c_get_clientdata(client);
1245 if (kstrtol(buf, 10, &temp))
1249 temp = SENSORS_LIMIT(temp, 0, 15);
1269 struct adt7462_data *data = adt7462_update_device(dev);
1276 return sprintf(buf,
"%d\n", tmin + trange);
1287 struct adt7462_data *data = i2c_get_clientdata(client);
1288 int tmin, trange_value;
1291 if (kstrtol(buf, 10, &trange))
1296 trange_value = find_trange_value(trange - tmin);
1298 if (trange_value < 0)
1318 struct adt7462_data *data = adt7462_update_device(dev);
1329 struct adt7462_data *data = i2c_get_clientdata(client);
1332 if (kstrtol(buf, 10, &temp))
1336 temp = SENSORS_LIMIT(temp, 0, 255);
1352 struct adt7462_data *data = adt7462_update_device(dev);
1365 static void set_pwm_channel(
struct i2c_client *client,
1386 struct adt7462_data *data = i2c_get_clientdata(client);
1389 if (kstrtol(buf, 10, &temp))
1394 set_pwm_channel(client, data, attr->
index, 4);
1397 set_pwm_channel(client, data, attr->
index, 7);
1409 struct adt7462_data *data = adt7462_update_device(dev);
1417 return sprintf(buf,
"%d\n", (1 << channel));
1427 static int cvt_auto_temp(
int input)
1435 return ilog2(input);
1445 struct adt7462_data *data = i2c_get_clientdata(client);
1448 if (kstrtol(buf, 10, &temp))
1451 temp = cvt_auto_temp(temp);
1455 set_pwm_channel(client, data, attr->
index, temp);
1650 show_force_pwm_max, set_force_pwm_max, 0);
1658 show_pwm_min, set_pwm_min, 0);
1660 show_pwm_min, set_pwm_min, 1);
1662 show_pwm_min, set_pwm_min, 2);
1664 show_pwm_min, set_pwm_min, 3);
1667 show_pwm_max, set_pwm_max, 0);
1669 show_pwm_max, set_pwm_max, 1);
1671 show_pwm_max, set_pwm_max, 2);
1673 show_pwm_max, set_pwm_max, 3);
1676 show_pwm_hyst, set_pwm_hyst, 0);
1678 show_pwm_hyst, set_pwm_hyst, 1);
1680 show_pwm_hyst, set_pwm_hyst, 2);
1682 show_pwm_hyst, set_pwm_hyst, 3);
1685 show_pwm_hyst, set_pwm_hyst, 0);
1687 show_pwm_hyst, set_pwm_hyst, 1);
1689 show_pwm_hyst, set_pwm_hyst, 2);
1691 show_pwm_hyst, set_pwm_hyst, 3);
1694 show_pwm_tmin, set_pwm_tmin, 0);
1696 show_pwm_tmin, set_pwm_tmin, 1);
1698 show_pwm_tmin, set_pwm_tmin, 2);
1700 show_pwm_tmin, set_pwm_tmin, 3);
1703 show_pwm_tmax, set_pwm_tmax, 0);
1705 show_pwm_tmax, set_pwm_tmax, 1);
1707 show_pwm_tmax, set_pwm_tmax, 2);
1709 show_pwm_tmax, set_pwm_tmax, 3);
1721 show_pwm_auto_temp, set_pwm_auto_temp, 0);
1723 show_pwm_auto_temp, set_pwm_auto_temp, 1);
1725 show_pwm_auto_temp, set_pwm_auto_temp, 2);
1727 show_pwm_auto_temp, set_pwm_auto_temp, 3);
1729 static struct attribute *adt7462_attr[] = {
1730 &sensor_dev_attr_temp1_max.dev_attr.attr,
1731 &sensor_dev_attr_temp2_max.dev_attr.attr,
1732 &sensor_dev_attr_temp3_max.dev_attr.attr,
1733 &sensor_dev_attr_temp4_max.dev_attr.attr,
1735 &sensor_dev_attr_temp1_min.dev_attr.attr,
1736 &sensor_dev_attr_temp2_min.dev_attr.attr,
1737 &sensor_dev_attr_temp3_min.dev_attr.attr,
1738 &sensor_dev_attr_temp4_min.dev_attr.attr,
1740 &sensor_dev_attr_temp1_input.dev_attr.attr,
1741 &sensor_dev_attr_temp2_input.dev_attr.attr,
1742 &sensor_dev_attr_temp3_input.dev_attr.attr,
1743 &sensor_dev_attr_temp4_input.dev_attr.attr,
1745 &sensor_dev_attr_temp1_label.dev_attr.attr,
1746 &sensor_dev_attr_temp2_label.dev_attr.attr,
1747 &sensor_dev_attr_temp3_label.dev_attr.attr,
1748 &sensor_dev_attr_temp4_label.dev_attr.attr,
1750 &sensor_dev_attr_temp1_alarm.dev_attr.attr,
1751 &sensor_dev_attr_temp2_alarm.dev_attr.attr,
1752 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
1753 &sensor_dev_attr_temp4_alarm.dev_attr.attr,
1755 &sensor_dev_attr_in1_max.dev_attr.attr,
1756 &sensor_dev_attr_in2_max.dev_attr.attr,
1757 &sensor_dev_attr_in3_max.dev_attr.attr,
1758 &sensor_dev_attr_in4_max.dev_attr.attr,
1759 &sensor_dev_attr_in5_max.dev_attr.attr,
1760 &sensor_dev_attr_in6_max.dev_attr.attr,
1761 &sensor_dev_attr_in7_max.dev_attr.attr,
1762 &sensor_dev_attr_in8_max.dev_attr.attr,
1763 &sensor_dev_attr_in9_max.dev_attr.attr,
1764 &sensor_dev_attr_in10_max.dev_attr.attr,
1765 &sensor_dev_attr_in11_max.dev_attr.attr,
1766 &sensor_dev_attr_in12_max.dev_attr.attr,
1767 &sensor_dev_attr_in13_max.dev_attr.attr,
1769 &sensor_dev_attr_in1_min.dev_attr.attr,
1770 &sensor_dev_attr_in2_min.dev_attr.attr,
1771 &sensor_dev_attr_in3_min.dev_attr.attr,
1772 &sensor_dev_attr_in4_min.dev_attr.attr,
1773 &sensor_dev_attr_in5_min.dev_attr.attr,
1774 &sensor_dev_attr_in6_min.dev_attr.attr,
1775 &sensor_dev_attr_in7_min.dev_attr.attr,
1776 &sensor_dev_attr_in8_min.dev_attr.attr,
1777 &sensor_dev_attr_in9_min.dev_attr.attr,
1778 &sensor_dev_attr_in10_min.dev_attr.attr,
1779 &sensor_dev_attr_in11_min.dev_attr.attr,
1780 &sensor_dev_attr_in12_min.dev_attr.attr,
1781 &sensor_dev_attr_in13_min.dev_attr.attr,
1783 &sensor_dev_attr_in1_input.dev_attr.attr,
1784 &sensor_dev_attr_in2_input.dev_attr.attr,
1785 &sensor_dev_attr_in3_input.dev_attr.attr,
1786 &sensor_dev_attr_in4_input.dev_attr.attr,
1787 &sensor_dev_attr_in5_input.dev_attr.attr,
1788 &sensor_dev_attr_in6_input.dev_attr.attr,
1789 &sensor_dev_attr_in7_input.dev_attr.attr,
1790 &sensor_dev_attr_in8_input.dev_attr.attr,
1791 &sensor_dev_attr_in9_input.dev_attr.attr,
1792 &sensor_dev_attr_in10_input.dev_attr.attr,
1793 &sensor_dev_attr_in11_input.dev_attr.attr,
1794 &sensor_dev_attr_in12_input.dev_attr.attr,
1795 &sensor_dev_attr_in13_input.dev_attr.attr,
1797 &sensor_dev_attr_in1_label.dev_attr.attr,
1798 &sensor_dev_attr_in2_label.dev_attr.attr,
1799 &sensor_dev_attr_in3_label.dev_attr.attr,
1800 &sensor_dev_attr_in4_label.dev_attr.attr,
1801 &sensor_dev_attr_in5_label.dev_attr.attr,
1802 &sensor_dev_attr_in6_label.dev_attr.attr,
1803 &sensor_dev_attr_in7_label.dev_attr.attr,
1804 &sensor_dev_attr_in8_label.dev_attr.attr,
1805 &sensor_dev_attr_in9_label.dev_attr.attr,
1806 &sensor_dev_attr_in10_label.dev_attr.attr,
1807 &sensor_dev_attr_in11_label.dev_attr.attr,
1808 &sensor_dev_attr_in12_label.dev_attr.attr,
1809 &sensor_dev_attr_in13_label.dev_attr.attr,
1811 &sensor_dev_attr_in1_alarm.dev_attr.attr,
1812 &sensor_dev_attr_in2_alarm.dev_attr.attr,
1813 &sensor_dev_attr_in3_alarm.dev_attr.attr,
1814 &sensor_dev_attr_in4_alarm.dev_attr.attr,
1815 &sensor_dev_attr_in5_alarm.dev_attr.attr,
1816 &sensor_dev_attr_in6_alarm.dev_attr.attr,
1817 &sensor_dev_attr_in7_alarm.dev_attr.attr,
1818 &sensor_dev_attr_in8_alarm.dev_attr.attr,
1819 &sensor_dev_attr_in9_alarm.dev_attr.attr,
1820 &sensor_dev_attr_in10_alarm.dev_attr.attr,
1821 &sensor_dev_attr_in11_alarm.dev_attr.attr,
1822 &sensor_dev_attr_in12_alarm.dev_attr.attr,
1823 &sensor_dev_attr_in13_alarm.dev_attr.attr,
1825 &sensor_dev_attr_fan1_min.dev_attr.attr,
1826 &sensor_dev_attr_fan2_min.dev_attr.attr,
1827 &sensor_dev_attr_fan3_min.dev_attr.attr,
1828 &sensor_dev_attr_fan4_min.dev_attr.attr,
1829 &sensor_dev_attr_fan5_min.dev_attr.attr,
1830 &sensor_dev_attr_fan6_min.dev_attr.attr,
1831 &sensor_dev_attr_fan7_min.dev_attr.attr,
1832 &sensor_dev_attr_fan8_min.dev_attr.attr,
1834 &sensor_dev_attr_fan1_input.dev_attr.attr,
1835 &sensor_dev_attr_fan2_input.dev_attr.attr,
1836 &sensor_dev_attr_fan3_input.dev_attr.attr,
1837 &sensor_dev_attr_fan4_input.dev_attr.attr,
1838 &sensor_dev_attr_fan5_input.dev_attr.attr,
1839 &sensor_dev_attr_fan6_input.dev_attr.attr,
1840 &sensor_dev_attr_fan7_input.dev_attr.attr,
1841 &sensor_dev_attr_fan8_input.dev_attr.attr,
1843 &sensor_dev_attr_fan1_alarm.dev_attr.attr,
1844 &sensor_dev_attr_fan2_alarm.dev_attr.attr,
1845 &sensor_dev_attr_fan3_alarm.dev_attr.attr,
1846 &sensor_dev_attr_fan4_alarm.dev_attr.attr,
1847 &sensor_dev_attr_fan5_alarm.dev_attr.attr,
1848 &sensor_dev_attr_fan6_alarm.dev_attr.attr,
1849 &sensor_dev_attr_fan7_alarm.dev_attr.attr,
1850 &sensor_dev_attr_fan8_alarm.dev_attr.attr,
1852 &sensor_dev_attr_force_pwm_max.dev_attr.attr,
1853 &sensor_dev_attr_pwm1.dev_attr.attr,
1854 &sensor_dev_attr_pwm2.dev_attr.attr,
1855 &sensor_dev_attr_pwm3.dev_attr.attr,
1856 &sensor_dev_attr_pwm4.dev_attr.attr,
1858 &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
1859 &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
1860 &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
1861 &sensor_dev_attr_pwm4_auto_point1_pwm.dev_attr.attr,
1863 &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
1864 &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
1865 &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
1866 &sensor_dev_attr_pwm4_auto_point2_pwm.dev_attr.attr,
1868 &sensor_dev_attr_temp1_auto_point1_hyst.dev_attr.attr,
1869 &sensor_dev_attr_temp2_auto_point1_hyst.dev_attr.attr,
1870 &sensor_dev_attr_temp3_auto_point1_hyst.dev_attr.attr,
1871 &sensor_dev_attr_temp4_auto_point1_hyst.dev_attr.attr,
1873 &sensor_dev_attr_temp1_auto_point2_hyst.dev_attr.attr,
1874 &sensor_dev_attr_temp2_auto_point2_hyst.dev_attr.attr,
1875 &sensor_dev_attr_temp3_auto_point2_hyst.dev_attr.attr,
1876 &sensor_dev_attr_temp4_auto_point2_hyst.dev_attr.attr,
1878 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr,
1879 &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr,
1880 &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr,
1881 &sensor_dev_attr_temp4_auto_point1_temp.dev_attr.attr,
1883 &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr,
1884 &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr,
1885 &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr,
1886 &sensor_dev_attr_temp4_auto_point2_temp.dev_attr.attr,
1888 &sensor_dev_attr_pwm1_enable.dev_attr.attr,
1889 &sensor_dev_attr_pwm2_enable.dev_attr.attr,
1890 &sensor_dev_attr_pwm3_enable.dev_attr.attr,
1891 &sensor_dev_attr_pwm4_enable.dev_attr.attr,
1893 &sensor_dev_attr_pwm1_auto_channels_temp.dev_attr.attr,
1894 &sensor_dev_attr_pwm2_auto_channels_temp.dev_attr.attr,
1895 &sensor_dev_attr_pwm3_auto_channels_temp.dev_attr.attr,
1896 &sensor_dev_attr_pwm4_auto_channels_temp.dev_attr.attr,
1901 static int adt7462_detect(
struct i2c_client *client,
1927 static int adt7462_probe(
struct i2c_client *client,
1938 i2c_set_clientdata(client, data);
1944 data->
attrs.attrs = adt7462_attr;
1962 static int adt7462_remove(
struct i2c_client *client)
1964 struct adt7462_data *data = i2c_get_clientdata(client);