aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/chips/adm1021.c6
-rw-r--r--drivers/i2c/chips/adm1025.c28
-rw-r--r--drivers/i2c/chips/adm1026.c98
3 files changed, 66 insertions, 66 deletions
diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
index 9c59a370b6d9..9058c3956710 100644
--- a/drivers/i2c/chips/adm1021.c
+++ b/drivers/i2c/chips/adm1021.c
@@ -137,7 +137,7 @@ static struct i2c_driver adm1021_driver = {
137}; 137};
138 138
139#define show(value) \ 139#define show(value) \
140static ssize_t show_##value(struct device *dev, char *buf) \ 140static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
141{ \ 141{ \
142 struct adm1021_data *data = adm1021_update_device(dev); \ 142 struct adm1021_data *data = adm1021_update_device(dev); \
143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -150,7 +150,7 @@ show(remote_temp_hyst);
150show(remote_temp_input); 150show(remote_temp_input);
151 151
152#define show2(value) \ 152#define show2(value) \
153static ssize_t show_##value(struct device *dev, char *buf) \ 153static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
154{ \ 154{ \
155 struct adm1021_data *data = adm1021_update_device(dev); \ 155 struct adm1021_data *data = adm1021_update_device(dev); \
156 return sprintf(buf, "%d\n", data->value); \ 156 return sprintf(buf, "%d\n", data->value); \
@@ -159,7 +159,7 @@ show2(alarms);
159show2(die_code); 159show2(die_code);
160 160
161#define set(value, reg) \ 161#define set(value, reg) \
162static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 162static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
163{ \ 163{ \
164 struct i2c_client *client = to_i2c_client(dev); \ 164 struct i2c_client *client = to_i2c_client(dev); \
165 struct adm1021_data *data = i2c_get_clientdata(client); \ 165 struct adm1021_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/adm1025.c b/drivers/i2c/chips/adm1025.c
index e0771a3d05c9..111f0c86c933 100644
--- a/drivers/i2c/chips/adm1025.c
+++ b/drivers/i2c/chips/adm1025.c
@@ -153,19 +153,19 @@ struct adm1025_data {
153 */ 153 */
154 154
155#define show_in(offset) \ 155#define show_in(offset) \
156static ssize_t show_in##offset(struct device *dev, char *buf) \ 156static ssize_t show_in##offset(struct device *dev, struct device_attribute *attr, char *buf) \
157{ \ 157{ \
158 struct adm1025_data *data = adm1025_update_device(dev); \ 158 struct adm1025_data *data = adm1025_update_device(dev); \
159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
160 in_scale[offset])); \ 160 in_scale[offset])); \
161} \ 161} \
162static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 162static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
163{ \ 163{ \
164 struct adm1025_data *data = adm1025_update_device(dev); \ 164 struct adm1025_data *data = adm1025_update_device(dev); \
165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
166 in_scale[offset])); \ 166 in_scale[offset])); \
167} \ 167} \
168static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 168static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
169{ \ 169{ \
170 struct adm1025_data *data = adm1025_update_device(dev); \ 170 struct adm1025_data *data = adm1025_update_device(dev); \
171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -180,17 +180,17 @@ show_in(4);
180show_in(5); 180show_in(5);
181 181
182#define show_temp(offset) \ 182#define show_temp(offset) \
183static ssize_t show_temp##offset(struct device *dev, char *buf) \ 183static ssize_t show_temp##offset(struct device *dev, struct device_attribute *attr, char *buf) \
184{ \ 184{ \
185 struct adm1025_data *data = adm1025_update_device(dev); \ 185 struct adm1025_data *data = adm1025_update_device(dev); \
186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
187} \ 187} \
188static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 188static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
189{ \ 189{ \
190 struct adm1025_data *data = adm1025_update_device(dev); \ 190 struct adm1025_data *data = adm1025_update_device(dev); \
191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
192} \ 192} \
193static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 193static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
194{ \ 194{ \
195 struct adm1025_data *data = adm1025_update_device(dev); \ 195 struct adm1025_data *data = adm1025_update_device(dev); \
196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
@@ -200,7 +200,7 @@ show_temp(1);
200show_temp(2); 200show_temp(2);
201 201
202#define set_in(offset) \ 202#define set_in(offset) \
203static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 203static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
204 size_t count) \ 204 size_t count) \
205{ \ 205{ \
206 struct i2c_client *client = to_i2c_client(dev); \ 206 struct i2c_client *client = to_i2c_client(dev); \
@@ -214,7 +214,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
214 up(&data->update_lock); \ 214 up(&data->update_lock); \
215 return count; \ 215 return count; \
216} \ 216} \
217static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 217static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
218 size_t count) \ 218 size_t count) \
219{ \ 219{ \
220 struct i2c_client *client = to_i2c_client(dev); \ 220 struct i2c_client *client = to_i2c_client(dev); \
@@ -240,7 +240,7 @@ set_in(4);
240set_in(5); 240set_in(5);
241 241
242#define set_temp(offset) \ 242#define set_temp(offset) \
243static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 243static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
244 size_t count) \ 244 size_t count) \
245{ \ 245{ \
246 struct i2c_client *client = to_i2c_client(dev); \ 246 struct i2c_client *client = to_i2c_client(dev); \
@@ -254,7 +254,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
254 up(&data->update_lock); \ 254 up(&data->update_lock); \
255 return count; \ 255 return count; \
256} \ 256} \
257static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 257static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
258 size_t count) \ 258 size_t count) \
259{ \ 259{ \
260 struct i2c_client *client = to_i2c_client(dev); \ 260 struct i2c_client *client = to_i2c_client(dev); \
@@ -275,26 +275,26 @@ static DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \
275set_temp(1); 275set_temp(1);
276set_temp(2); 276set_temp(2);
277 277
278static ssize_t show_alarms(struct device *dev, char *buf) 278static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
279{ 279{
280 struct adm1025_data *data = adm1025_update_device(dev); 280 struct adm1025_data *data = adm1025_update_device(dev);
281 return sprintf(buf, "%u\n", data->alarms); 281 return sprintf(buf, "%u\n", data->alarms);
282} 282}
283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
284 284
285static ssize_t show_vid(struct device *dev, char *buf) 285static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
286{ 286{
287 struct adm1025_data *data = adm1025_update_device(dev); 287 struct adm1025_data *data = adm1025_update_device(dev);
288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
289} 289}
290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); 290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL);
291 291
292static ssize_t show_vrm(struct device *dev, char *buf) 292static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct adm1025_data *data = adm1025_update_device(dev); 294 struct adm1025_data *data = adm1025_update_device(dev);
295 return sprintf(buf, "%u\n", data->vrm); 295 return sprintf(buf, "%u\n", data->vrm);
296} 296}
297static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 297static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
298{ 298{
299 struct i2c_client *client = to_i2c_client(dev); 299 struct i2c_client *client = to_i2c_client(dev);
300 struct adm1025_data *data = i2c_get_clientdata(client); 300 struct adm1025_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/adm1026.c b/drivers/i2c/chips/adm1026.c
index 39e2f4a900bf..c127bd965c31 100644
--- a/drivers/i2c/chips/adm1026.c
+++ b/drivers/i2c/chips/adm1026.c
@@ -754,24 +754,24 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
754} 754}
755 755
756#define in_reg(offset) \ 756#define in_reg(offset) \
757static ssize_t show_in##offset (struct device *dev, char *buf) \ 757static ssize_t show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
758{ \ 758{ \
759 return show_in(dev, buf, offset); \ 759 return show_in(dev, buf, offset); \
760} \ 760} \
761static ssize_t show_in##offset##_min (struct device *dev, char *buf) \ 761static ssize_t show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
762{ \ 762{ \
763 return show_in_min(dev, buf, offset); \ 763 return show_in_min(dev, buf, offset); \
764} \ 764} \
765static ssize_t set_in##offset##_min (struct device *dev, \ 765static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
766 const char *buf, size_t count) \ 766 const char *buf, size_t count) \
767{ \ 767{ \
768 return set_in_min(dev, buf, count, offset); \ 768 return set_in_min(dev, buf, count, offset); \
769} \ 769} \
770static ssize_t show_in##offset##_max (struct device *dev, char *buf) \ 770static ssize_t show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
771{ \ 771{ \
772 return show_in_max(dev, buf, offset); \ 772 return show_in_max(dev, buf, offset); \
773} \ 773} \
774static ssize_t set_in##offset##_max (struct device *dev, \ 774static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
775 const char *buf, size_t count) \ 775 const char *buf, size_t count) \
776{ \ 776{ \
777 return set_in_max(dev, buf, count, offset); \ 777 return set_in_max(dev, buf, count, offset); \
@@ -800,19 +800,19 @@ in_reg(13);
800in_reg(14); 800in_reg(14);
801in_reg(15); 801in_reg(15);
802 802
803static ssize_t show_in16(struct device *dev, char *buf) 803static ssize_t show_in16(struct device *dev, struct device_attribute *attr, char *buf)
804{ 804{
805 struct adm1026_data *data = adm1026_update_device(dev); 805 struct adm1026_data *data = adm1026_update_device(dev);
806 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - 806 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) -
807 NEG12_OFFSET); 807 NEG12_OFFSET);
808} 808}
809static ssize_t show_in16_min(struct device *dev, char *buf) 809static ssize_t show_in16_min(struct device *dev, struct device_attribute *attr, char *buf)
810{ 810{
811 struct adm1026_data *data = adm1026_update_device(dev); 811 struct adm1026_data *data = adm1026_update_device(dev);
812 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) 812 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16])
813 - NEG12_OFFSET); 813 - NEG12_OFFSET);
814} 814}
815static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count) 815static ssize_t set_in16_min(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
816{ 816{
817 struct i2c_client *client = to_i2c_client(dev); 817 struct i2c_client *client = to_i2c_client(dev);
818 struct adm1026_data *data = i2c_get_clientdata(client); 818 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -824,13 +824,13 @@ static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count)
824 up(&data->update_lock); 824 up(&data->update_lock);
825 return count; 825 return count;
826} 826}
827static ssize_t show_in16_max(struct device *dev, char *buf) 827static ssize_t show_in16_max(struct device *dev, struct device_attribute *attr, char *buf)
828{ 828{
829 struct adm1026_data *data = adm1026_update_device(dev); 829 struct adm1026_data *data = adm1026_update_device(dev);
830 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) 830 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16])
831 - NEG12_OFFSET); 831 - NEG12_OFFSET);
832} 832}
833static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count) 833static ssize_t set_in16_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
834{ 834{
835 struct i2c_client *client = to_i2c_client(dev); 835 struct i2c_client *client = to_i2c_client(dev);
836 struct adm1026_data *data = i2c_get_clientdata(client); 836 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -880,15 +880,15 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
880} 880}
881 881
882#define fan_offset(offset) \ 882#define fan_offset(offset) \
883static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 883static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
884{ \ 884{ \
885 return show_fan(dev, buf, offset - 1); \ 885 return show_fan(dev, buf, offset - 1); \
886} \ 886} \
887static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 887static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
888{ \ 888{ \
889 return show_fan_min(dev, buf, offset - 1); \ 889 return show_fan_min(dev, buf, offset - 1); \
890} \ 890} \
891static ssize_t set_fan_##offset##_min (struct device *dev, \ 891static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
892 const char *buf, size_t count) \ 892 const char *buf, size_t count) \
893{ \ 893{ \
894 return set_fan_min(dev, buf, count, offset - 1); \ 894 return set_fan_min(dev, buf, count, offset - 1); \
@@ -967,11 +967,11 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
967} 967}
968 968
969#define fan_offset_div(offset) \ 969#define fan_offset_div(offset) \
970static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 970static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
971{ \ 971{ \
972 return show_fan_div(dev, buf, offset - 1); \ 972 return show_fan_div(dev, buf, offset - 1); \
973} \ 973} \
974static ssize_t set_fan_##offset##_div (struct device *dev, \ 974static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
975 const char *buf, size_t count) \ 975 const char *buf, size_t count) \
976{ \ 976{ \
977 return set_fan_div(dev, buf, count, offset - 1); \ 977 return set_fan_div(dev, buf, count, offset - 1); \
@@ -1033,24 +1033,24 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
1033 return count; 1033 return count;
1034} 1034}
1035#define temp_reg(offset) \ 1035#define temp_reg(offset) \
1036static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 1036static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
1037{ \ 1037{ \
1038 return show_temp(dev, buf, offset - 1); \ 1038 return show_temp(dev, buf, offset - 1); \
1039} \ 1039} \
1040static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 1040static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
1041{ \ 1041{ \
1042 return show_temp_min(dev, buf, offset - 1); \ 1042 return show_temp_min(dev, buf, offset - 1); \
1043} \ 1043} \
1044static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 1044static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
1045{ \ 1045{ \
1046 return show_temp_max(dev, buf, offset - 1); \ 1046 return show_temp_max(dev, buf, offset - 1); \
1047} \ 1047} \
1048static ssize_t set_temp_##offset##_min (struct device *dev, \ 1048static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
1049 const char *buf, size_t count) \ 1049 const char *buf, size_t count) \
1050{ \ 1050{ \
1051 return set_temp_min(dev, buf, count, offset - 1); \ 1051 return set_temp_min(dev, buf, count, offset - 1); \
1052} \ 1052} \
1053static ssize_t set_temp_##offset##_max (struct device *dev, \ 1053static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
1054 const char *buf, size_t count) \ 1054 const char *buf, size_t count) \
1055{ \ 1055{ \
1056 return set_temp_max(dev, buf, count, offset - 1); \ 1056 return set_temp_max(dev, buf, count, offset - 1); \
@@ -1087,11 +1087,11 @@ static ssize_t set_temp_offset(struct device *dev, const char *buf,
1087} 1087}
1088 1088
1089#define temp_offset_reg(offset) \ 1089#define temp_offset_reg(offset) \
1090static ssize_t show_temp_##offset##_offset (struct device *dev, char *buf) \ 1090static ssize_t show_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, char *buf) \
1091{ \ 1091{ \
1092 return show_temp_offset(dev, buf, offset - 1); \ 1092 return show_temp_offset(dev, buf, offset - 1); \
1093} \ 1093} \
1094static ssize_t set_temp_##offset##_offset (struct device *dev, \ 1094static ssize_t set_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, \
1095 const char *buf, size_t count) \ 1095 const char *buf, size_t count) \
1096{ \ 1096{ \
1097 return set_temp_offset(dev, buf, count, offset - 1); \ 1097 return set_temp_offset(dev, buf, count, offset - 1); \
@@ -1139,22 +1139,22 @@ static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf,
1139} 1139}
1140 1140
1141#define temp_auto_point(offset) \ 1141#define temp_auto_point(offset) \
1142static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, \ 1142static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \
1143 char *buf) \ 1143 char *buf) \
1144{ \ 1144{ \
1145 return show_temp_auto_point1_temp(dev, buf, offset - 1); \ 1145 return show_temp_auto_point1_temp(dev, buf, offset - 1); \
1146} \ 1146} \
1147static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, \ 1147static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \
1148 const char *buf, size_t count) \ 1148 const char *buf, size_t count) \
1149{ \ 1149{ \
1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \ 1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \
1151} \ 1151} \
1152static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \ 1152static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \
1153 *dev, char *buf) \ 1153 *dev, struct device_attribute *attr, char *buf) \
1154{ \ 1154{ \
1155 return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \ 1155 return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \
1156} \ 1156} \
1157static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, \ 1157static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, struct device_attribute *attr, \
1158 char *buf) \ 1158 char *buf) \
1159{ \ 1159{ \
1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \ 1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \
@@ -1171,12 +1171,12 @@ temp_auto_point(1);
1171temp_auto_point(2); 1171temp_auto_point(2);
1172temp_auto_point(3); 1172temp_auto_point(3);
1173 1173
1174static ssize_t show_temp_crit_enable(struct device *dev, char *buf) 1174static ssize_t show_temp_crit_enable(struct device *dev, struct device_attribute *attr, char *buf)
1175{ 1175{
1176 struct adm1026_data *data = adm1026_update_device(dev); 1176 struct adm1026_data *data = adm1026_update_device(dev);
1177 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); 1177 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4);
1178} 1178}
1179static ssize_t set_temp_crit_enable(struct device *dev, const char *buf, 1179static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute *attr, const char *buf,
1180 size_t count) 1180 size_t count)
1181{ 1181{
1182 struct i2c_client *client = to_i2c_client(dev); 1182 struct i2c_client *client = to_i2c_client(dev);
@@ -1224,11 +1224,11 @@ static ssize_t set_temp_crit(struct device *dev, const char *buf,
1224} 1224}
1225 1225
1226#define temp_crit_reg(offset) \ 1226#define temp_crit_reg(offset) \
1227static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 1227static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \
1228{ \ 1228{ \
1229 return show_temp_crit(dev, buf, offset - 1); \ 1229 return show_temp_crit(dev, buf, offset - 1); \
1230} \ 1230} \
1231static ssize_t set_temp_##offset##_crit (struct device *dev, \ 1231static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \
1232 const char *buf, size_t count) \ 1232 const char *buf, size_t count) \
1233{ \ 1233{ \
1234 return set_temp_crit(dev, buf, count, offset - 1); \ 1234 return set_temp_crit(dev, buf, count, offset - 1); \
@@ -1240,12 +1240,12 @@ temp_crit_reg(1);
1240temp_crit_reg(2); 1240temp_crit_reg(2);
1241temp_crit_reg(3); 1241temp_crit_reg(3);
1242 1242
1243static ssize_t show_analog_out_reg(struct device *dev, char *buf) 1243static ssize_t show_analog_out_reg(struct device *dev, struct device_attribute *attr, char *buf)
1244{ 1244{
1245 struct adm1026_data *data = adm1026_update_device(dev); 1245 struct adm1026_data *data = adm1026_update_device(dev);
1246 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out)); 1246 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out));
1247} 1247}
1248static ssize_t set_analog_out_reg(struct device *dev, const char *buf, 1248static ssize_t set_analog_out_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1249 size_t count) 1249 size_t count)
1250{ 1250{
1251 struct i2c_client *client = to_i2c_client(dev); 1251 struct i2c_client *client = to_i2c_client(dev);
@@ -1262,7 +1262,7 @@ static ssize_t set_analog_out_reg(struct device *dev, const char *buf,
1262static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, 1262static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg,
1263 set_analog_out_reg); 1263 set_analog_out_reg);
1264 1264
1265static ssize_t show_vid_reg(struct device *dev, char *buf) 1265static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
1266{ 1266{
1267 struct adm1026_data *data = adm1026_update_device(dev); 1267 struct adm1026_data *data = adm1026_update_device(dev);
1268 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); 1268 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));
@@ -1270,12 +1270,12 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
1270 1270
1271static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL); 1271static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL);
1272 1272
1273static ssize_t show_vrm_reg(struct device *dev, char *buf) 1273static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1274{ 1274{
1275 struct adm1026_data *data = adm1026_update_device(dev); 1275 struct adm1026_data *data = adm1026_update_device(dev);
1276 return sprintf(buf,"%d\n", data->vrm); 1276 return sprintf(buf,"%d\n", data->vrm);
1277} 1277}
1278static ssize_t store_vrm_reg(struct device *dev, const char *buf, 1278static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1279 size_t count) 1279 size_t count)
1280{ 1280{
1281 struct i2c_client *client = to_i2c_client(dev); 1281 struct i2c_client *client = to_i2c_client(dev);
@@ -1287,7 +1287,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf,
1287 1287
1288static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 1288static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
1289 1289
1290static ssize_t show_alarms_reg(struct device *dev, char *buf) 1290static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
1291{ 1291{
1292 struct adm1026_data *data = adm1026_update_device(dev); 1292 struct adm1026_data *data = adm1026_update_device(dev);
1293 return sprintf(buf, "%ld\n", (long) (data->alarms)); 1293 return sprintf(buf, "%ld\n", (long) (data->alarms));
@@ -1295,12 +1295,12 @@ static ssize_t show_alarms_reg(struct device *dev, char *buf)
1295 1295
1296static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 1296static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
1297 1297
1298static ssize_t show_alarm_mask(struct device *dev, char *buf) 1298static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf)
1299{ 1299{
1300 struct adm1026_data *data = adm1026_update_device(dev); 1300 struct adm1026_data *data = adm1026_update_device(dev);
1301 return sprintf(buf,"%ld\n", data->alarm_mask); 1301 return sprintf(buf,"%ld\n", data->alarm_mask);
1302} 1302}
1303static ssize_t set_alarm_mask(struct device *dev, const char *buf, 1303static ssize_t set_alarm_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1304 size_t count) 1304 size_t count)
1305{ 1305{
1306 struct i2c_client *client = to_i2c_client(dev); 1306 struct i2c_client *client = to_i2c_client(dev);
@@ -1331,12 +1331,12 @@ static DEVICE_ATTR(alarm_mask, S_IRUGO | S_IWUSR, show_alarm_mask,
1331 set_alarm_mask); 1331 set_alarm_mask);
1332 1332
1333 1333
1334static ssize_t show_gpio(struct device *dev, char *buf) 1334static ssize_t show_gpio(struct device *dev, struct device_attribute *attr, char *buf)
1335{ 1335{
1336 struct adm1026_data *data = adm1026_update_device(dev); 1336 struct adm1026_data *data = adm1026_update_device(dev);
1337 return sprintf(buf,"%ld\n", data->gpio); 1337 return sprintf(buf,"%ld\n", data->gpio);
1338} 1338}
1339static ssize_t set_gpio(struct device *dev, const char *buf, 1339static ssize_t set_gpio(struct device *dev, struct device_attribute *attr, const char *buf,
1340 size_t count) 1340 size_t count)
1341{ 1341{
1342 struct i2c_client *client = to_i2c_client(dev); 1342 struct i2c_client *client = to_i2c_client(dev);
@@ -1359,12 +1359,12 @@ static ssize_t set_gpio(struct device *dev, const char *buf,
1359static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio); 1359static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio);
1360 1360
1361 1361
1362static ssize_t show_gpio_mask(struct device *dev, char *buf) 1362static ssize_t show_gpio_mask(struct device *dev, struct device_attribute *attr, char *buf)
1363{ 1363{
1364 struct adm1026_data *data = adm1026_update_device(dev); 1364 struct adm1026_data *data = adm1026_update_device(dev);
1365 return sprintf(buf,"%ld\n", data->gpio_mask); 1365 return sprintf(buf,"%ld\n", data->gpio_mask);
1366} 1366}
1367static ssize_t set_gpio_mask(struct device *dev, const char *buf, 1367static ssize_t set_gpio_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1368 size_t count) 1368 size_t count)
1369{ 1369{
1370 struct i2c_client *client = to_i2c_client(dev); 1370 struct i2c_client *client = to_i2c_client(dev);
@@ -1386,12 +1386,12 @@ static ssize_t set_gpio_mask(struct device *dev, const char *buf,
1386 1386
1387static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask); 1387static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask);
1388 1388
1389static ssize_t show_pwm_reg(struct device *dev, char *buf) 1389static ssize_t show_pwm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1390{ 1390{
1391 struct adm1026_data *data = adm1026_update_device(dev); 1391 struct adm1026_data *data = adm1026_update_device(dev);
1392 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm)); 1392 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm));
1393} 1393}
1394static ssize_t set_pwm_reg(struct device *dev, const char *buf, 1394static ssize_t set_pwm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1395 size_t count) 1395 size_t count)
1396{ 1396{
1397 struct i2c_client *client = to_i2c_client(dev); 1397 struct i2c_client *client = to_i2c_client(dev);
@@ -1407,12 +1407,12 @@ static ssize_t set_pwm_reg(struct device *dev, const char *buf,
1407 } 1407 }
1408 return count; 1408 return count;
1409} 1409}
1410static ssize_t show_auto_pwm_min(struct device *dev, char *buf) 1410static ssize_t show_auto_pwm_min(struct device *dev, struct device_attribute *attr, char *buf)
1411{ 1411{
1412 struct adm1026_data *data = adm1026_update_device(dev); 1412 struct adm1026_data *data = adm1026_update_device(dev);
1413 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min); 1413 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min);
1414} 1414}
1415static ssize_t set_auto_pwm_min(struct device *dev, const char *buf, 1415static ssize_t set_auto_pwm_min(struct device *dev, struct device_attribute *attr, const char *buf,
1416 size_t count) 1416 size_t count)
1417{ 1417{
1418 struct i2c_client *client = to_i2c_client(dev); 1418 struct i2c_client *client = to_i2c_client(dev);
@@ -1429,16 +1429,16 @@ static ssize_t set_auto_pwm_min(struct device *dev, const char *buf,
1429 up(&data->update_lock); 1429 up(&data->update_lock);
1430 return count; 1430 return count;
1431} 1431}
1432static ssize_t show_auto_pwm_max(struct device *dev, char *buf) 1432static ssize_t show_auto_pwm_max(struct device *dev, struct device_attribute *attr, char *buf)
1433{ 1433{
1434 return sprintf(buf,"%d\n", ADM1026_PWM_MAX); 1434 return sprintf(buf,"%d\n", ADM1026_PWM_MAX);
1435} 1435}
1436static ssize_t show_pwm_enable(struct device *dev, char *buf) 1436static ssize_t show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf)
1437{ 1437{
1438 struct adm1026_data *data = adm1026_update_device(dev); 1438 struct adm1026_data *data = adm1026_update_device(dev);
1439 return sprintf(buf,"%d\n", data->pwm1.enable); 1439 return sprintf(buf,"%d\n", data->pwm1.enable);
1440} 1440}
1441static ssize_t set_pwm_enable(struct device *dev, const char *buf, 1441static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr, const char *buf,
1442 size_t count) 1442 size_t count)
1443{ 1443{
1444 struct i2c_client *client = to_i2c_client(dev); 1444 struct i2c_client *client = to_i2c_client(dev);