aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYani Ioannou <yani.ioannou@gmail.com>2005-06-05 04:51:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:36 -0400
commit050480f12aeab62d39a1a07546606a47217ebefa (patch)
treeffae2c627f613c6da54599f0752d38039c22a011
parent0a3e7eeabc9f76b7496488aad2d11626ff6a2a4f (diff)
[PATCH] I2C: drivers/i2c/chips/adm1026.c: use dynamic sysfs callbacks
Finally (phew!) this patch demonstrates how to adapt the adm1026 to take advantage of the new callbacks, and the i2c-sysfs.h defined structure/macros. Most of the other sensor/hwmon drivers could be updated in the same way. The odd few exceptions (bmcsensors for example) however might be better off with their own custom attribute structure. Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/i2c/chips/adm1026.c524
1 files changed, 241 insertions, 283 deletions
diff --git a/drivers/i2c/chips/adm1026.c b/drivers/i2c/chips/adm1026.c
index c127bd965c31..b15fafe8f111 100644
--- a/drivers/i2c/chips/adm1026.c
+++ b/drivers/i2c/chips/adm1026.c
@@ -30,6 +30,7 @@
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c-sensor.h> 32#include <linux/i2c-sensor.h>
33#include <linux/i2c-sysfs.h>
33#include <linux/i2c-vid.h> 34#include <linux/i2c-vid.h>
34 35
35/* Addresses to scan */ 36/* Addresses to scan */
@@ -711,19 +712,27 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
711 return data; 712 return data;
712} 713}
713 714
714static ssize_t show_in(struct device *dev, char *buf, int nr) 715static ssize_t show_in(struct device *dev, struct device_attribute *attr,
716 char *buf)
715{ 717{
718 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
719 int nr = sensor_attr->index;
716 struct adm1026_data *data = adm1026_update_device(dev); 720 struct adm1026_data *data = adm1026_update_device(dev);
717 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr])); 721 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr]));
718} 722}
719static ssize_t show_in_min(struct device *dev, char *buf, int nr) 723static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
724 char *buf)
720{ 725{
726 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
727 int nr = sensor_attr->index;
721 struct adm1026_data *data = adm1026_update_device(dev); 728 struct adm1026_data *data = adm1026_update_device(dev);
722 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr])); 729 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr]));
723} 730}
724static ssize_t set_in_min(struct device *dev, const char *buf, 731static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
725 size_t count, int nr) 732 const char *buf, size_t count)
726{ 733{
734 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
735 int nr = sensor_attr->index;
727 struct i2c_client *client = to_i2c_client(dev); 736 struct i2c_client *client = to_i2c_client(dev);
728 struct adm1026_data *data = i2c_get_clientdata(client); 737 struct adm1026_data *data = i2c_get_clientdata(client);
729 int val = simple_strtol(buf, NULL, 10); 738 int val = simple_strtol(buf, NULL, 10);
@@ -734,14 +743,19 @@ static ssize_t set_in_min(struct device *dev, const char *buf,
734 up(&data->update_lock); 743 up(&data->update_lock);
735 return count; 744 return count;
736} 745}
737static ssize_t show_in_max(struct device *dev, char *buf, int nr) 746static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
747 char *buf)
738{ 748{
749 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
750 int nr = sensor_attr->index;
739 struct adm1026_data *data = adm1026_update_device(dev); 751 struct adm1026_data *data = adm1026_update_device(dev);
740 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr])); 752 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr]));
741} 753}
742static ssize_t set_in_max(struct device *dev, const char *buf, 754static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
743 size_t count, int nr) 755 const char *buf, size_t count)
744{ 756{
757 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
758 int nr = sensor_attr->index;
745 struct i2c_client *client = to_i2c_client(dev); 759 struct i2c_client *client = to_i2c_client(dev);
746 struct adm1026_data *data = i2c_get_clientdata(client); 760 struct adm1026_data *data = i2c_get_clientdata(client);
747 int val = simple_strtol(buf, NULL, 10); 761 int val = simple_strtol(buf, NULL, 10);
@@ -753,34 +767,13 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
753 return count; 767 return count;
754} 768}
755 769
756#define in_reg(offset) \ 770#define in_reg(offset) \
757static ssize_t show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 771static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in, \
758{ \ 772 NULL, offset); \
759 return show_in(dev, buf, offset); \ 773static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
760} \ 774 show_in_min, set_in_min, offset); \
761static ssize_t show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ 775static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
762{ \ 776 show_in_max, set_in_max, offset);
763 return show_in_min(dev, buf, offset); \
764} \
765static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
766 const char *buf, size_t count) \
767{ \
768 return set_in_min(dev, buf, count, offset); \
769} \
770static ssize_t show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
771{ \
772 return show_in_max(dev, buf, offset); \
773} \
774static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
775 const char *buf, size_t count) \
776{ \
777 return set_in_max(dev, buf, count, offset); \
778} \
779static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); \
780static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
781 show_in##offset##_min, set_in##offset##_min); \
782static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
783 show_in##offset##_max, set_in##offset##_max);
784 777
785 778
786in_reg(0); 779in_reg(0);
@@ -843,30 +836,38 @@ static ssize_t set_in16_max(struct device *dev, struct device_attribute *attr, c
843 return count; 836 return count;
844} 837}
845 838
846static DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL); 839static SENSOR_DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL, 16);
847static DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min); 840static SENSOR_DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min, 16);
848static DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max); 841static SENSOR_DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max, 16);
849 842
850 843
851 844
852 845
853/* Now add fan read/write functions */ 846/* Now add fan read/write functions */
854 847
855static ssize_t show_fan(struct device *dev, char *buf, int nr) 848static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
849 char *buf)
856{ 850{
851 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
852 int nr = sensor_attr->index;
857 struct adm1026_data *data = adm1026_update_device(dev); 853 struct adm1026_data *data = adm1026_update_device(dev);
858 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 854 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr],
859 data->fan_div[nr])); 855 data->fan_div[nr]));
860} 856}
861static ssize_t show_fan_min(struct device *dev, char *buf, int nr) 857static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
858 char *buf)
862{ 859{
860 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
861 int nr = sensor_attr->index;
863 struct adm1026_data *data = adm1026_update_device(dev); 862 struct adm1026_data *data = adm1026_update_device(dev);
864 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr], 863 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr],
865 data->fan_div[nr])); 864 data->fan_div[nr]));
866} 865}
867static ssize_t set_fan_min(struct device *dev, const char *buf, 866static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
868 size_t count, int nr) 867 const char *buf, size_t count)
869{ 868{
869 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
870 int nr = sensor_attr->index;
870 struct i2c_client *client = to_i2c_client(dev); 871 struct i2c_client *client = to_i2c_client(dev);
871 struct adm1026_data *data = i2c_get_clientdata(client); 872 struct adm1026_data *data = i2c_get_clientdata(client);
872 int val = simple_strtol(buf, NULL, 10); 873 int val = simple_strtol(buf, NULL, 10);
@@ -879,23 +880,11 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
879 return count; 880 return count;
880} 881}
881 882
882#define fan_offset(offset) \ 883#define fan_offset(offset) \
883static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 884static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \
884{ \ 885 offset - 1); \
885 return show_fan(dev, buf, offset - 1); \ 886static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
886} \ 887 show_fan_min, set_fan_min, offset - 1);
887static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
888{ \
889 return show_fan_min(dev, buf, offset - 1); \
890} \
891static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
892 const char *buf, size_t count) \
893{ \
894 return set_fan_min(dev, buf, count, offset - 1); \
895} \
896static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \
897static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
898 show_fan_##offset##_min, set_fan_##offset##_min);
899 888
900fan_offset(1); 889fan_offset(1);
901fan_offset(2); 890fan_offset(2);
@@ -926,14 +915,19 @@ static void fixup_fan_min(struct device *dev, int fan, int old_div)
926} 915}
927 916
928/* Now add fan_div read/write functions */ 917/* Now add fan_div read/write functions */
929static ssize_t show_fan_div(struct device *dev, char *buf, int nr) 918static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,
919 char *buf)
930{ 920{
921 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
922 int nr = sensor_attr->index;
931 struct adm1026_data *data = adm1026_update_device(dev); 923 struct adm1026_data *data = adm1026_update_device(dev);
932 return sprintf(buf,"%d\n", data->fan_div[nr]); 924 return sprintf(buf,"%d\n", data->fan_div[nr]);
933} 925}
934static ssize_t set_fan_div(struct device *dev, const char *buf, 926static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
935 size_t count, int nr) 927 const char *buf, size_t count)
936{ 928{
929 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
930 int nr = sensor_attr->index;
937 struct i2c_client *client = to_i2c_client(dev); 931 struct i2c_client *client = to_i2c_client(dev);
938 struct adm1026_data *data = i2c_get_clientdata(client); 932 struct adm1026_data *data = i2c_get_clientdata(client);
939 int val,orig_div,new_div,shift; 933 int val,orig_div,new_div,shift;
@@ -967,17 +961,8 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
967} 961}
968 962
969#define fan_offset_div(offset) \ 963#define fan_offset_div(offset) \
970static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \ 964static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
971{ \ 965 show_fan_div, set_fan_div, offset - 1);
972 return show_fan_div(dev, buf, offset - 1); \
973} \
974static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
975 const char *buf, size_t count) \
976{ \
977 return set_fan_div(dev, buf, count, offset - 1); \
978} \
979static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
980 show_fan_##offset##_div, set_fan_##offset##_div);
981 966
982fan_offset_div(1); 967fan_offset_div(1);
983fan_offset_div(2); 968fan_offset_div(2);
@@ -989,19 +974,27 @@ fan_offset_div(7);
989fan_offset_div(8); 974fan_offset_div(8);
990 975
991/* Temps */ 976/* Temps */
992static ssize_t show_temp(struct device *dev, char *buf, int nr) 977static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
978 char *buf)
993{ 979{
980 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
981 int nr = sensor_attr->index;
994 struct adm1026_data *data = adm1026_update_device(dev); 982 struct adm1026_data *data = adm1026_update_device(dev);
995 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr])); 983 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr]));
996} 984}
997static ssize_t show_temp_min(struct device *dev, char *buf, int nr) 985static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
986 char *buf)
998{ 987{
988 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
989 int nr = sensor_attr->index;
999 struct adm1026_data *data = adm1026_update_device(dev); 990 struct adm1026_data *data = adm1026_update_device(dev);
1000 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr])); 991 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr]));
1001} 992}
1002static ssize_t set_temp_min(struct device *dev, const char *buf, 993static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
1003 size_t count, int nr) 994 const char *buf, size_t count)
1004{ 995{
996 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
997 int nr = sensor_attr->index;
1005 struct i2c_client *client = to_i2c_client(dev); 998 struct i2c_client *client = to_i2c_client(dev);
1006 struct adm1026_data *data = i2c_get_clientdata(client); 999 struct adm1026_data *data = i2c_get_clientdata(client);
1007 int val = simple_strtol(buf, NULL, 10); 1000 int val = simple_strtol(buf, NULL, 10);
@@ -1013,14 +1006,19 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
1013 up(&data->update_lock); 1006 up(&data->update_lock);
1014 return count; 1007 return count;
1015} 1008}
1016static ssize_t show_temp_max(struct device *dev, char *buf, int nr) 1009static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
1010 char *buf)
1017{ 1011{
1012 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1013 int nr = sensor_attr->index;
1018 struct adm1026_data *data = adm1026_update_device(dev); 1014 struct adm1026_data *data = adm1026_update_device(dev);
1019 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr])); 1015 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr]));
1020} 1016}
1021static ssize_t set_temp_max(struct device *dev, const char *buf, 1017static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
1022 size_t count, int nr) 1018 const char *buf, size_t count)
1023{ 1019{
1020 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1021 int nr = sensor_attr->index;
1024 struct i2c_client *client = to_i2c_client(dev); 1022 struct i2c_client *client = to_i2c_client(dev);
1025 struct adm1026_data *data = i2c_get_clientdata(client); 1023 struct adm1026_data *data = i2c_get_clientdata(client);
1026 int val = simple_strtol(buf, NULL, 10); 1024 int val = simple_strtol(buf, NULL, 10);
@@ -1032,48 +1030,34 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
1032 up(&data->update_lock); 1030 up(&data->update_lock);
1033 return count; 1031 return count;
1034} 1032}
1035#define temp_reg(offset) \ 1033
1036static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 1034#define temp_reg(offset) \
1037{ \ 1035static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \
1038 return show_temp(dev, buf, offset - 1); \ 1036 NULL, offset - 1); \
1039} \ 1037static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1040static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ 1038 show_temp_min, set_temp_min, offset - 1); \
1041{ \ 1039static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1042 return show_temp_min(dev, buf, offset - 1); \ 1040 show_temp_max, set_temp_max, offset - 1);
1043} \
1044static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
1045{ \
1046 return show_temp_max(dev, buf, offset - 1); \
1047} \
1048static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
1049 const char *buf, size_t count) \
1050{ \
1051 return set_temp_min(dev, buf, count, offset - 1); \
1052} \
1053static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
1054 const char *buf, size_t count) \
1055{ \
1056 return set_temp_max(dev, buf, count, offset - 1); \
1057} \
1058static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \
1059static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1060 show_temp_##offset##_min, set_temp_##offset##_min); \
1061static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1062 show_temp_##offset##_max, set_temp_##offset##_max);
1063 1041
1064 1042
1065temp_reg(1); 1043temp_reg(1);
1066temp_reg(2); 1044temp_reg(2);
1067temp_reg(3); 1045temp_reg(3);
1068 1046
1069static ssize_t show_temp_offset(struct device *dev, char *buf, int nr) 1047static ssize_t show_temp_offset(struct device *dev,
1048 struct device_attribute *attr, char *buf)
1070{ 1049{
1050 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1051 int nr = sensor_attr->index;
1071 struct adm1026_data *data = adm1026_update_device(dev); 1052 struct adm1026_data *data = adm1026_update_device(dev);
1072 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr])); 1053 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr]));
1073} 1054}
1074static ssize_t set_temp_offset(struct device *dev, const char *buf, 1055static ssize_t set_temp_offset(struct device *dev,
1075 size_t count, int nr) 1056 struct device_attribute *attr, const char *buf,
1057 size_t count)
1076{ 1058{
1059 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1060 int nr = sensor_attr->index;
1077 struct i2c_client *client = to_i2c_client(dev); 1061 struct i2c_client *client = to_i2c_client(dev);
1078 struct adm1026_data *data = i2c_get_clientdata(client); 1062 struct adm1026_data *data = i2c_get_clientdata(client);
1079 int val = simple_strtol(buf, NULL, 10); 1063 int val = simple_strtol(buf, NULL, 10);
@@ -1086,46 +1070,45 @@ static ssize_t set_temp_offset(struct device *dev, const char *buf,
1086 return count; 1070 return count;
1087} 1071}
1088 1072
1089#define temp_offset_reg(offset) \ 1073#define temp_offset_reg(offset) \
1090static ssize_t show_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, char *buf) \ 1074static SENSOR_DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1091{ \ 1075 show_temp_offset, set_temp_offset, offset - 1);
1092 return show_temp_offset(dev, buf, offset - 1); \
1093} \
1094static ssize_t set_temp_##offset##_offset (struct device *dev, struct device_attribute *attr, \
1095 const char *buf, size_t count) \
1096{ \
1097 return set_temp_offset(dev, buf, count, offset - 1); \
1098} \
1099static DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1100 show_temp_##offset##_offset, set_temp_##offset##_offset);
1101 1076
1102temp_offset_reg(1); 1077temp_offset_reg(1);
1103temp_offset_reg(2); 1078temp_offset_reg(2);
1104temp_offset_reg(3); 1079temp_offset_reg(3);
1105 1080
1106static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, char *buf, 1081static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev,
1107 int nr) 1082 struct device_attribute *attr, char *buf)
1108{ 1083{
1084 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1085 int nr = sensor_attr->index;
1109 struct adm1026_data *data = adm1026_update_device(dev); 1086 struct adm1026_data *data = adm1026_update_device(dev);
1110 return sprintf(buf,"%d\n", TEMP_FROM_REG( 1087 return sprintf(buf,"%d\n", TEMP_FROM_REG(
1111 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr])); 1088 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr]));
1112} 1089}
1113static ssize_t show_temp_auto_point2_temp(struct device *dev, char *buf, 1090static ssize_t show_temp_auto_point2_temp(struct device *dev,
1114 int nr) 1091 struct device_attribute *attr, char *buf)
1115{ 1092{
1093 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1094 int nr = sensor_attr->index;
1116 struct adm1026_data *data = adm1026_update_device(dev); 1095 struct adm1026_data *data = adm1026_update_device(dev);
1117 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] + 1096 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] +
1118 ADM1026_FAN_CONTROL_TEMP_RANGE)); 1097 ADM1026_FAN_CONTROL_TEMP_RANGE));
1119} 1098}
1120static ssize_t show_temp_auto_point1_temp(struct device *dev, char *buf, 1099static ssize_t show_temp_auto_point1_temp(struct device *dev,
1121 int nr) 1100 struct device_attribute *attr, char *buf)
1122{ 1101{
1102 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1103 int nr = sensor_attr->index;
1123 struct adm1026_data *data = adm1026_update_device(dev); 1104 struct adm1026_data *data = adm1026_update_device(dev);
1124 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr])); 1105 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr]));
1125} 1106}
1126static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf, 1107static ssize_t set_temp_auto_point1_temp(struct device *dev,
1127 size_t count, int nr) 1108 struct device_attribute *attr, const char *buf, size_t count)
1128{ 1109{
1110 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1111 int nr = sensor_attr->index;
1129 struct i2c_client *client = to_i2c_client(dev); 1112 struct i2c_client *client = to_i2c_client(dev);
1130 struct adm1026_data *data = i2c_get_clientdata(client); 1113 struct adm1026_data *data = i2c_get_clientdata(client);
1131 int val = simple_strtol(buf, NULL, 10); 1114 int val = simple_strtol(buf, NULL, 10);
@@ -1138,46 +1121,27 @@ static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf,
1138 return count; 1121 return count;
1139} 1122}
1140 1123
1141#define temp_auto_point(offset) \ 1124#define temp_auto_point(offset) \
1142static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ 1125static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1143 char *buf) \ 1126 show_temp_auto_point1_temp, set_temp_auto_point1_temp, \
1144{ \ 1127 offset - 1); \
1145 return show_temp_auto_point1_temp(dev, buf, offset - 1); \ 1128static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1146} \ 1129 show_temp_auto_point1_temp_hyst, NULL, offset - 1); \
1147static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, struct device_attribute *attr, \ 1130static SENSOR_DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1148 const char *buf, size_t count) \ 1131 show_temp_auto_point2_temp, NULL, offset - 1);
1149{ \
1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \
1151} \
1152static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \
1153 *dev, struct device_attribute *attr, char *buf) \
1154{ \
1155 return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \
1156} \
1157static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, struct device_attribute *attr, \
1158 char *buf) \
1159{ \
1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \
1161} \
1162static DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1163 show_temp##offset##_auto_point1_temp, \
1164 set_temp##offset##_auto_point1_temp); \
1165static DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1166 show_temp##offset##_auto_point1_temp_hyst, NULL); \
1167static DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1168 show_temp##offset##_auto_point2_temp, NULL);
1169 1132
1170temp_auto_point(1); 1133temp_auto_point(1);
1171temp_auto_point(2); 1134temp_auto_point(2);
1172temp_auto_point(3); 1135temp_auto_point(3);
1173 1136
1174static ssize_t show_temp_crit_enable(struct device *dev, struct device_attribute *attr, char *buf) 1137static ssize_t show_temp_crit_enable(struct device *dev,
1138 struct device_attribute *attr, char *buf)
1175{ 1139{
1176 struct adm1026_data *data = adm1026_update_device(dev); 1140 struct adm1026_data *data = adm1026_update_device(dev);
1177 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); 1141 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4);
1178} 1142}
1179static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute *attr, const char *buf, 1143static ssize_t set_temp_crit_enable(struct device *dev,
1180 size_t count) 1144 struct device_attribute *attr, const char *buf, size_t count)
1181{ 1145{
1182 struct i2c_client *client = to_i2c_client(dev); 1146 struct i2c_client *client = to_i2c_client(dev);
1183 struct adm1026_data *data = i2c_get_clientdata(client); 1147 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -1193,24 +1157,27 @@ static ssize_t set_temp_crit_enable(struct device *dev, struct device_attribute
1193 return count; 1157 return count;
1194} 1158}
1195 1159
1196static DEVICE_ATTR(temp1_crit_enable, S_IRUGO | S_IWUSR, 1160#define temp_crit_enable(offset) \
1197 show_temp_crit_enable, set_temp_crit_enable); 1161static DEVICE_ATTR(temp##offset##_crit_enable, S_IRUGO | S_IWUSR, \
1198
1199static DEVICE_ATTR(temp2_crit_enable, S_IRUGO | S_IWUSR,
1200 show_temp_crit_enable, set_temp_crit_enable);
1201
1202static DEVICE_ATTR(temp3_crit_enable, S_IRUGO | S_IWUSR,
1203 show_temp_crit_enable, set_temp_crit_enable); 1162 show_temp_crit_enable, set_temp_crit_enable);
1204 1163
1164temp_crit_enable(1);
1165temp_crit_enable(2);
1166temp_crit_enable(3);
1205 1167
1206static ssize_t show_temp_crit(struct device *dev, char *buf, int nr) 1168static ssize_t show_temp_crit(struct device *dev,
1169 struct device_attribute *attr, char *buf)
1207{ 1170{
1171 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1172 int nr = sensor_attr->index;
1208 struct adm1026_data *data = adm1026_update_device(dev); 1173 struct adm1026_data *data = adm1026_update_device(dev);
1209 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr])); 1174 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr]));
1210} 1175}
1211static ssize_t set_temp_crit(struct device *dev, const char *buf, 1176static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr,
1212 size_t count, int nr) 1177 const char *buf, size_t count)
1213{ 1178{
1179 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1180 int nr = sensor_attr->index;
1214 struct i2c_client *client = to_i2c_client(dev); 1181 struct i2c_client *client = to_i2c_client(dev);
1215 struct adm1026_data *data = i2c_get_clientdata(client); 1182 struct adm1026_data *data = i2c_get_clientdata(client);
1216 int val = simple_strtol(buf, NULL, 10); 1183 int val = simple_strtol(buf, NULL, 10);
@@ -1223,18 +1190,9 @@ static ssize_t set_temp_crit(struct device *dev, const char *buf,
1223 return count; 1190 return count;
1224} 1191}
1225 1192
1226#define temp_crit_reg(offset) \ 1193#define temp_crit_reg(offset) \
1227static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \ 1194static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1228{ \ 1195 show_temp_crit, set_temp_crit, offset - 1);
1229 return show_temp_crit(dev, buf, offset - 1); \
1230} \
1231static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \
1232 const char *buf, size_t count) \
1233{ \
1234 return set_temp_crit(dev, buf, count, offset - 1); \
1235} \
1236static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1237 show_temp_##offset##_crit, set_temp_##offset##_crit);
1238 1196
1239temp_crit_reg(1); 1197temp_crit_reg(1);
1240temp_crit_reg(2); 1198temp_crit_reg(2);
@@ -1597,114 +1555,114 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,
1597 adm1026_init_client(new_client); 1555 adm1026_init_client(new_client);
1598 1556
1599 /* Register sysfs hooks */ 1557 /* Register sysfs hooks */
1600 device_create_file(&new_client->dev, &dev_attr_in0_input); 1558 device_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr);
1601 device_create_file(&new_client->dev, &dev_attr_in0_max); 1559 device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr);
1602 device_create_file(&new_client->dev, &dev_attr_in0_min); 1560 device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr);
1603 device_create_file(&new_client->dev, &dev_attr_in1_input); 1561 device_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr);
1604 device_create_file(&new_client->dev, &dev_attr_in1_max); 1562 device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr);
1605 device_create_file(&new_client->dev, &dev_attr_in1_min); 1563 device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr);
1606 device_create_file(&new_client->dev, &dev_attr_in2_input); 1564 device_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr);
1607 device_create_file(&new_client->dev, &dev_attr_in2_max); 1565 device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr);
1608 device_create_file(&new_client->dev, &dev_attr_in2_min); 1566 device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr);
1609 device_create_file(&new_client->dev, &dev_attr_in3_input); 1567 device_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr);
1610 device_create_file(&new_client->dev, &dev_attr_in3_max); 1568 device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr);
1611 device_create_file(&new_client->dev, &dev_attr_in3_min); 1569 device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr);
1612 device_create_file(&new_client->dev, &dev_attr_in4_input); 1570 device_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr);
1613 device_create_file(&new_client->dev, &dev_attr_in4_max); 1571 device_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr);
1614 device_create_file(&new_client->dev, &dev_attr_in4_min); 1572 device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr);
1615 device_create_file(&new_client->dev, &dev_attr_in5_input); 1573 device_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr);
1616 device_create_file(&new_client->dev, &dev_attr_in5_max); 1574 device_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr);
1617 device_create_file(&new_client->dev, &dev_attr_in5_min); 1575 device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr);
1618 device_create_file(&new_client->dev, &dev_attr_in6_input); 1576 device_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr);
1619 device_create_file(&new_client->dev, &dev_attr_in6_max); 1577 device_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr);
1620 device_create_file(&new_client->dev, &dev_attr_in6_min); 1578 device_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr);
1621 device_create_file(&new_client->dev, &dev_attr_in7_input); 1579 device_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr);
1622 device_create_file(&new_client->dev, &dev_attr_in7_max); 1580 device_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr);
1623 device_create_file(&new_client->dev, &dev_attr_in7_min); 1581 device_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr);
1624 device_create_file(&new_client->dev, &dev_attr_in8_input); 1582 device_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr);
1625 device_create_file(&new_client->dev, &dev_attr_in8_max); 1583 device_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr);
1626 device_create_file(&new_client->dev, &dev_attr_in8_min); 1584 device_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr);
1627 device_create_file(&new_client->dev, &dev_attr_in9_input); 1585 device_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr);
1628 device_create_file(&new_client->dev, &dev_attr_in9_max); 1586 device_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr);
1629 device_create_file(&new_client->dev, &dev_attr_in9_min); 1587 device_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr);
1630 device_create_file(&new_client->dev, &dev_attr_in10_input); 1588 device_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr);
1631 device_create_file(&new_client->dev, &dev_attr_in10_max); 1589 device_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr);
1632 device_create_file(&new_client->dev, &dev_attr_in10_min); 1590 device_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr);
1633 device_create_file(&new_client->dev, &dev_attr_in11_input); 1591 device_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr);
1634 device_create_file(&new_client->dev, &dev_attr_in11_max); 1592 device_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr);
1635 device_create_file(&new_client->dev, &dev_attr_in11_min); 1593 device_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr);
1636 device_create_file(&new_client->dev, &dev_attr_in12_input); 1594 device_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr);
1637 device_create_file(&new_client->dev, &dev_attr_in12_max); 1595 device_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr);
1638 device_create_file(&new_client->dev, &dev_attr_in12_min); 1596 device_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr);
1639 device_create_file(&new_client->dev, &dev_attr_in13_input); 1597 device_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr);
1640 device_create_file(&new_client->dev, &dev_attr_in13_max); 1598 device_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr);
1641 device_create_file(&new_client->dev, &dev_attr_in13_min); 1599 device_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr);
1642 device_create_file(&new_client->dev, &dev_attr_in14_input); 1600 device_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr);
1643 device_create_file(&new_client->dev, &dev_attr_in14_max); 1601 device_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr);
1644 device_create_file(&new_client->dev, &dev_attr_in14_min); 1602 device_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr);
1645 device_create_file(&new_client->dev, &dev_attr_in15_input); 1603 device_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr);
1646 device_create_file(&new_client->dev, &dev_attr_in15_max); 1604 device_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr);
1647 device_create_file(&new_client->dev, &dev_attr_in15_min); 1605 device_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr);
1648 device_create_file(&new_client->dev, &dev_attr_in16_input); 1606 device_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr);
1649 device_create_file(&new_client->dev, &dev_attr_in16_max); 1607 device_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr);
1650 device_create_file(&new_client->dev, &dev_attr_in16_min); 1608 device_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr);
1651 device_create_file(&new_client->dev, &dev_attr_fan1_input); 1609 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr);
1652 device_create_file(&new_client->dev, &dev_attr_fan1_div); 1610 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr);
1653 device_create_file(&new_client->dev, &dev_attr_fan1_min); 1611 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr);
1654 device_create_file(&new_client->dev, &dev_attr_fan2_input); 1612 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr);
1655 device_create_file(&new_client->dev, &dev_attr_fan2_div); 1613 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr);
1656 device_create_file(&new_client->dev, &dev_attr_fan2_min); 1614 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr);
1657 device_create_file(&new_client->dev, &dev_attr_fan3_input); 1615 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr);
1658 device_create_file(&new_client->dev, &dev_attr_fan3_div); 1616 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr);
1659 device_create_file(&new_client->dev, &dev_attr_fan3_min); 1617 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr);
1660 device_create_file(&new_client->dev, &dev_attr_fan4_input); 1618 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr);
1661 device_create_file(&new_client->dev, &dev_attr_fan4_div); 1619 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr);
1662 device_create_file(&new_client->dev, &dev_attr_fan4_min); 1620 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr);
1663 device_create_file(&new_client->dev, &dev_attr_fan5_input); 1621 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr);
1664 device_create_file(&new_client->dev, &dev_attr_fan5_div); 1622 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr);
1665 device_create_file(&new_client->dev, &dev_attr_fan5_min); 1623 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr);
1666 device_create_file(&new_client->dev, &dev_attr_fan6_input); 1624 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr);
1667 device_create_file(&new_client->dev, &dev_attr_fan6_div); 1625 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr);
1668 device_create_file(&new_client->dev, &dev_attr_fan6_min); 1626 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr);
1669 device_create_file(&new_client->dev, &dev_attr_fan7_input); 1627 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr);
1670 device_create_file(&new_client->dev, &dev_attr_fan7_div); 1628 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr);
1671 device_create_file(&new_client->dev, &dev_attr_fan7_min); 1629 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr);
1672 device_create_file(&new_client->dev, &dev_attr_fan8_input); 1630 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr);
1673 device_create_file(&new_client->dev, &dev_attr_fan8_div); 1631 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr);
1674 device_create_file(&new_client->dev, &dev_attr_fan8_min); 1632 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr);
1675 device_create_file(&new_client->dev, &dev_attr_temp1_input); 1633 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_input.dev_attr);
1676 device_create_file(&new_client->dev, &dev_attr_temp1_max); 1634 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_max.dev_attr);
1677 device_create_file(&new_client->dev, &dev_attr_temp1_min); 1635 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_min.dev_attr);
1678 device_create_file(&new_client->dev, &dev_attr_temp2_input); 1636 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_input.dev_attr);
1679 device_create_file(&new_client->dev, &dev_attr_temp2_max); 1637 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_max.dev_attr);
1680 device_create_file(&new_client->dev, &dev_attr_temp2_min); 1638 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr);
1681 device_create_file(&new_client->dev, &dev_attr_temp3_input); 1639 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr);
1682 device_create_file(&new_client->dev, &dev_attr_temp3_max); 1640 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr);
1683 device_create_file(&new_client->dev, &dev_attr_temp3_min); 1641 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr);
1684 device_create_file(&new_client->dev, &dev_attr_temp1_offset); 1642 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr);
1685 device_create_file(&new_client->dev, &dev_attr_temp2_offset); 1643 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr);
1686 device_create_file(&new_client->dev, &dev_attr_temp3_offset); 1644 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr);
1687 device_create_file(&new_client->dev, 1645 device_create_file(&new_client->dev,
1688 &dev_attr_temp1_auto_point1_temp); 1646 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr);
1689 device_create_file(&new_client->dev, 1647 device_create_file(&new_client->dev,
1690 &dev_attr_temp2_auto_point1_temp); 1648 &sensor_dev_attr_temp2_auto_point1_temp.dev_attr);
1691 device_create_file(&new_client->dev, 1649 device_create_file(&new_client->dev,
1692 &dev_attr_temp3_auto_point1_temp); 1650 &sensor_dev_attr_temp3_auto_point1_temp.dev_attr);
1693 device_create_file(&new_client->dev, 1651 device_create_file(&new_client->dev,
1694 &dev_attr_temp1_auto_point1_temp_hyst); 1652 &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr);
1695 device_create_file(&new_client->dev, 1653 device_create_file(&new_client->dev,
1696 &dev_attr_temp2_auto_point1_temp_hyst); 1654 &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr);
1697 device_create_file(&new_client->dev, 1655 device_create_file(&new_client->dev,
1698 &dev_attr_temp3_auto_point1_temp_hyst); 1656 &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr);
1699 device_create_file(&new_client->dev, 1657 device_create_file(&new_client->dev,
1700 &dev_attr_temp1_auto_point2_temp); 1658 &sensor_dev_attr_temp1_auto_point2_temp.dev_attr);
1701 device_create_file(&new_client->dev, 1659 device_create_file(&new_client->dev,
1702 &dev_attr_temp2_auto_point2_temp); 1660 &sensor_dev_attr_temp2_auto_point2_temp.dev_attr);
1703 device_create_file(&new_client->dev, 1661 device_create_file(&new_client->dev,
1704 &dev_attr_temp3_auto_point2_temp); 1662 &sensor_dev_attr_temp3_auto_point2_temp.dev_attr);
1705 device_create_file(&new_client->dev, &dev_attr_temp1_crit); 1663 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_crit.dev_attr);
1706 device_create_file(&new_client->dev, &dev_attr_temp2_crit); 1664 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_crit.dev_attr);
1707 device_create_file(&new_client->dev, &dev_attr_temp3_crit); 1665 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_crit.dev_attr);
1708 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable); 1666 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);
1709 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable); 1667 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);
1710 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable); 1668 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);