.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * A hwmon driver for the Analog Devices ADT7462 |
---|
3 | 4 | * Copyright (C) 2008 IBM |
---|
4 | 5 | * |
---|
5 | 6 | * Author: Darrick J. Wong <darrick.wong@oracle.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License as published by |
---|
9 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
10 | | - * (at your option) any later version. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, |
---|
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | | - * |
---|
17 | | - * You should have received a copy of the GNU General Public License |
---|
18 | | - * along with this program; if not, write to the Free Software |
---|
19 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
20 | 7 | */ |
---|
21 | 8 | |
---|
22 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
448 | 435 | case 3: |
---|
449 | 436 | return "+1.5V"; |
---|
450 | 437 | } |
---|
| 438 | + fallthrough; |
---|
451 | 439 | case 2: |
---|
452 | 440 | if (!(data->pin_cfg[1] & ADT7462_PIN22_INPUT)) |
---|
453 | 441 | return "+12V3"; |
---|
.. | .. |
---|
505 | 493 | case 3: |
---|
506 | 494 | return "+1.5"; |
---|
507 | 495 | } |
---|
| 496 | + fallthrough; |
---|
508 | 497 | case 11: |
---|
509 | 498 | if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT == |
---|
510 | 499 | ADT7462_PIN28_VOLT && |
---|
.. | .. |
---|
542 | 531 | case 3: |
---|
543 | 532 | return 7800; |
---|
544 | 533 | } |
---|
| 534 | + fallthrough; |
---|
545 | 535 | case 2: |
---|
546 | 536 | if (!(data->pin_cfg[1] & ADT7462_PIN22_INPUT)) |
---|
547 | 537 | return 62500; |
---|
.. | .. |
---|
599 | 589 | case 3: |
---|
600 | 590 | return 7800; |
---|
601 | 591 | } |
---|
| 592 | + fallthrough; |
---|
602 | 593 | case 11: |
---|
603 | 594 | case 12: |
---|
604 | 595 | if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT == |
---|
.. | .. |
---|
784 | 775 | return data; |
---|
785 | 776 | } |
---|
786 | 777 | |
---|
787 | | -static ssize_t show_temp_min(struct device *dev, |
---|
788 | | - struct device_attribute *devattr, |
---|
789 | | - char *buf) |
---|
| 778 | +static ssize_t temp_min_show(struct device *dev, |
---|
| 779 | + struct device_attribute *devattr, char *buf) |
---|
790 | 780 | { |
---|
791 | 781 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
792 | 782 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
797 | 787 | return sprintf(buf, "%d\n", 1000 * (data->temp_min[attr->index] - 64)); |
---|
798 | 788 | } |
---|
799 | 789 | |
---|
800 | | -static ssize_t set_temp_min(struct device *dev, |
---|
801 | | - struct device_attribute *devattr, |
---|
802 | | - const char *buf, |
---|
803 | | - size_t count) |
---|
| 790 | +static ssize_t temp_min_store(struct device *dev, |
---|
| 791 | + struct device_attribute *devattr, |
---|
| 792 | + const char *buf, size_t count) |
---|
804 | 793 | { |
---|
805 | 794 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
806 | 795 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
822 | 811 | return count; |
---|
823 | 812 | } |
---|
824 | 813 | |
---|
825 | | -static ssize_t show_temp_max(struct device *dev, |
---|
826 | | - struct device_attribute *devattr, |
---|
827 | | - char *buf) |
---|
| 814 | +static ssize_t temp_max_show(struct device *dev, |
---|
| 815 | + struct device_attribute *devattr, char *buf) |
---|
828 | 816 | { |
---|
829 | 817 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
830 | 818 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
835 | 823 | return sprintf(buf, "%d\n", 1000 * (data->temp_max[attr->index] - 64)); |
---|
836 | 824 | } |
---|
837 | 825 | |
---|
838 | | -static ssize_t set_temp_max(struct device *dev, |
---|
839 | | - struct device_attribute *devattr, |
---|
840 | | - const char *buf, |
---|
841 | | - size_t count) |
---|
| 826 | +static ssize_t temp_max_store(struct device *dev, |
---|
| 827 | + struct device_attribute *devattr, |
---|
| 828 | + const char *buf, size_t count) |
---|
842 | 829 | { |
---|
843 | 830 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
844 | 831 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
860 | 847 | return count; |
---|
861 | 848 | } |
---|
862 | 849 | |
---|
863 | | -static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, |
---|
| 850 | +static ssize_t temp_show(struct device *dev, struct device_attribute *devattr, |
---|
864 | 851 | char *buf) |
---|
865 | 852 | { |
---|
866 | 853 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
.. | .. |
---|
874 | 861 | 250 * frac); |
---|
875 | 862 | } |
---|
876 | 863 | |
---|
877 | | -static ssize_t show_temp_label(struct device *dev, |
---|
878 | | - struct device_attribute *devattr, |
---|
879 | | - char *buf) |
---|
| 864 | +static ssize_t temp_label_show(struct device *dev, |
---|
| 865 | + struct device_attribute *devattr, char *buf) |
---|
880 | 866 | { |
---|
881 | 867 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
882 | 868 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
884 | 870 | return sprintf(buf, "%s\n", temp_label(data, attr->index)); |
---|
885 | 871 | } |
---|
886 | 872 | |
---|
887 | | -static ssize_t show_volt_max(struct device *dev, |
---|
888 | | - struct device_attribute *devattr, |
---|
889 | | - char *buf) |
---|
| 873 | +static ssize_t volt_max_show(struct device *dev, |
---|
| 874 | + struct device_attribute *devattr, char *buf) |
---|
890 | 875 | { |
---|
891 | 876 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
892 | 877 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
898 | 883 | return sprintf(buf, "%d\n", x); |
---|
899 | 884 | } |
---|
900 | 885 | |
---|
901 | | -static ssize_t set_volt_max(struct device *dev, |
---|
902 | | - struct device_attribute *devattr, |
---|
903 | | - const char *buf, |
---|
904 | | - size_t count) |
---|
| 886 | +static ssize_t volt_max_store(struct device *dev, |
---|
| 887 | + struct device_attribute *devattr, |
---|
| 888 | + const char *buf, size_t count) |
---|
905 | 889 | { |
---|
906 | 890 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
907 | 891 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
926 | 910 | return count; |
---|
927 | 911 | } |
---|
928 | 912 | |
---|
929 | | -static ssize_t show_volt_min(struct device *dev, |
---|
930 | | - struct device_attribute *devattr, |
---|
931 | | - char *buf) |
---|
| 913 | +static ssize_t volt_min_show(struct device *dev, |
---|
| 914 | + struct device_attribute *devattr, char *buf) |
---|
932 | 915 | { |
---|
933 | 916 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
934 | 917 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
940 | 923 | return sprintf(buf, "%d\n", x); |
---|
941 | 924 | } |
---|
942 | 925 | |
---|
943 | | -static ssize_t set_volt_min(struct device *dev, |
---|
944 | | - struct device_attribute *devattr, |
---|
945 | | - const char *buf, |
---|
946 | | - size_t count) |
---|
| 926 | +static ssize_t volt_min_store(struct device *dev, |
---|
| 927 | + struct device_attribute *devattr, |
---|
| 928 | + const char *buf, size_t count) |
---|
947 | 929 | { |
---|
948 | 930 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
949 | 931 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
968 | 950 | return count; |
---|
969 | 951 | } |
---|
970 | 952 | |
---|
971 | | -static ssize_t show_voltage(struct device *dev, |
---|
972 | | - struct device_attribute *devattr, |
---|
973 | | - char *buf) |
---|
| 953 | +static ssize_t voltage_show(struct device *dev, |
---|
| 954 | + struct device_attribute *devattr, char *buf) |
---|
974 | 955 | { |
---|
975 | 956 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
976 | 957 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
982 | 963 | return sprintf(buf, "%d\n", x); |
---|
983 | 964 | } |
---|
984 | 965 | |
---|
985 | | -static ssize_t show_voltage_label(struct device *dev, |
---|
986 | | - struct device_attribute *devattr, |
---|
987 | | - char *buf) |
---|
| 966 | +static ssize_t voltage_label_show(struct device *dev, |
---|
| 967 | + struct device_attribute *devattr, char *buf) |
---|
988 | 968 | { |
---|
989 | 969 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
990 | 970 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
992 | 972 | return sprintf(buf, "%s\n", voltage_label(data, attr->index)); |
---|
993 | 973 | } |
---|
994 | 974 | |
---|
995 | | -static ssize_t show_alarm(struct device *dev, |
---|
996 | | - struct device_attribute *devattr, |
---|
997 | | - char *buf) |
---|
| 975 | +static ssize_t alarm_show(struct device *dev, |
---|
| 976 | + struct device_attribute *devattr, char *buf) |
---|
998 | 977 | { |
---|
999 | 978 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1000 | 979 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1012 | 991 | return data->fan_enabled & (1 << fan); |
---|
1013 | 992 | } |
---|
1014 | 993 | |
---|
1015 | | -static ssize_t show_fan_min(struct device *dev, |
---|
1016 | | - struct device_attribute *devattr, |
---|
1017 | | - char *buf) |
---|
| 994 | +static ssize_t fan_min_show(struct device *dev, |
---|
| 995 | + struct device_attribute *devattr, char *buf) |
---|
1018 | 996 | { |
---|
1019 | 997 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1020 | 998 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1031 | 1009 | return sprintf(buf, "%d\n", FAN_PERIOD_TO_RPM(temp)); |
---|
1032 | 1010 | } |
---|
1033 | 1011 | |
---|
1034 | | -static ssize_t set_fan_min(struct device *dev, |
---|
1035 | | - struct device_attribute *devattr, |
---|
1036 | | - const char *buf, size_t count) |
---|
| 1012 | +static ssize_t fan_min_store(struct device *dev, |
---|
| 1013 | + struct device_attribute *devattr, |
---|
| 1014 | + const char *buf, size_t count) |
---|
1037 | 1015 | { |
---|
1038 | 1016 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1039 | 1017 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1057 | 1035 | return count; |
---|
1058 | 1036 | } |
---|
1059 | 1037 | |
---|
1060 | | -static ssize_t show_fan(struct device *dev, struct device_attribute *devattr, |
---|
| 1038 | +static ssize_t fan_show(struct device *dev, struct device_attribute *devattr, |
---|
1061 | 1039 | char *buf) |
---|
1062 | 1040 | { |
---|
1063 | 1041 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
.. | .. |
---|
1071 | 1049 | FAN_PERIOD_TO_RPM(data->fan[attr->index])); |
---|
1072 | 1050 | } |
---|
1073 | 1051 | |
---|
1074 | | -static ssize_t show_force_pwm_max(struct device *dev, |
---|
1075 | | - struct device_attribute *devattr, |
---|
1076 | | - char *buf) |
---|
| 1052 | +static ssize_t force_pwm_max_show(struct device *dev, |
---|
| 1053 | + struct device_attribute *devattr, char *buf) |
---|
1077 | 1054 | { |
---|
1078 | 1055 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
1079 | 1056 | return sprintf(buf, "%d\n", (data->cfg2 & ADT7462_FSPD_MASK ? 1 : 0)); |
---|
1080 | 1057 | } |
---|
1081 | 1058 | |
---|
1082 | | -static ssize_t set_force_pwm_max(struct device *dev, |
---|
1083 | | - struct device_attribute *devattr, |
---|
1084 | | - const char *buf, |
---|
1085 | | - size_t count) |
---|
| 1059 | +static ssize_t force_pwm_max_store(struct device *dev, |
---|
| 1060 | + struct device_attribute *devattr, |
---|
| 1061 | + const char *buf, size_t count) |
---|
1086 | 1062 | { |
---|
1087 | 1063 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
1088 | 1064 | struct i2c_client *client = data->client; |
---|
.. | .. |
---|
1105 | 1081 | return count; |
---|
1106 | 1082 | } |
---|
1107 | 1083 | |
---|
1108 | | -static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, |
---|
| 1084 | +static ssize_t pwm_show(struct device *dev, struct device_attribute *devattr, |
---|
1109 | 1085 | char *buf) |
---|
1110 | 1086 | { |
---|
1111 | 1087 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
.. | .. |
---|
1113 | 1089 | return sprintf(buf, "%d\n", data->pwm[attr->index]); |
---|
1114 | 1090 | } |
---|
1115 | 1091 | |
---|
1116 | | -static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr, |
---|
1117 | | - const char *buf, size_t count) |
---|
| 1092 | +static ssize_t pwm_store(struct device *dev, struct device_attribute *devattr, |
---|
| 1093 | + const char *buf, size_t count) |
---|
1118 | 1094 | { |
---|
1119 | 1095 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1120 | 1096 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1134 | 1110 | return count; |
---|
1135 | 1111 | } |
---|
1136 | 1112 | |
---|
1137 | | -static ssize_t show_pwm_max(struct device *dev, |
---|
1138 | | - struct device_attribute *devattr, |
---|
1139 | | - char *buf) |
---|
| 1113 | +static ssize_t pwm_max_show(struct device *dev, |
---|
| 1114 | + struct device_attribute *devattr, char *buf) |
---|
1140 | 1115 | { |
---|
1141 | 1116 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
1142 | 1117 | return sprintf(buf, "%d\n", data->pwm_max); |
---|
1143 | 1118 | } |
---|
1144 | 1119 | |
---|
1145 | | -static ssize_t set_pwm_max(struct device *dev, |
---|
1146 | | - struct device_attribute *devattr, |
---|
1147 | | - const char *buf, |
---|
1148 | | - size_t count) |
---|
| 1120 | +static ssize_t pwm_max_store(struct device *dev, |
---|
| 1121 | + struct device_attribute *devattr, |
---|
| 1122 | + const char *buf, size_t count) |
---|
1149 | 1123 | { |
---|
1150 | 1124 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
1151 | 1125 | struct i2c_client *client = data->client; |
---|
.. | .. |
---|
1164 | 1138 | return count; |
---|
1165 | 1139 | } |
---|
1166 | 1140 | |
---|
1167 | | -static ssize_t show_pwm_min(struct device *dev, |
---|
1168 | | - struct device_attribute *devattr, |
---|
1169 | | - char *buf) |
---|
| 1141 | +static ssize_t pwm_min_show(struct device *dev, |
---|
| 1142 | + struct device_attribute *devattr, char *buf) |
---|
1170 | 1143 | { |
---|
1171 | 1144 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1172 | 1145 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
1173 | 1146 | return sprintf(buf, "%d\n", data->pwm_min[attr->index]); |
---|
1174 | 1147 | } |
---|
1175 | 1148 | |
---|
1176 | | -static ssize_t set_pwm_min(struct device *dev, |
---|
1177 | | - struct device_attribute *devattr, |
---|
1178 | | - const char *buf, |
---|
1179 | | - size_t count) |
---|
| 1149 | +static ssize_t pwm_min_store(struct device *dev, |
---|
| 1150 | + struct device_attribute *devattr, |
---|
| 1151 | + const char *buf, size_t count) |
---|
1180 | 1152 | { |
---|
1181 | 1153 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1182 | 1154 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1197 | 1169 | return count; |
---|
1198 | 1170 | } |
---|
1199 | 1171 | |
---|
1200 | | -static ssize_t show_pwm_hyst(struct device *dev, |
---|
1201 | | - struct device_attribute *devattr, |
---|
1202 | | - char *buf) |
---|
| 1172 | +static ssize_t pwm_hyst_show(struct device *dev, |
---|
| 1173 | + struct device_attribute *devattr, char *buf) |
---|
1203 | 1174 | { |
---|
1204 | 1175 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1205 | 1176 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1207 | 1178 | (data->pwm_trange[attr->index] & ADT7462_PWM_HYST_MASK)); |
---|
1208 | 1179 | } |
---|
1209 | 1180 | |
---|
1210 | | -static ssize_t set_pwm_hyst(struct device *dev, |
---|
1211 | | - struct device_attribute *devattr, |
---|
1212 | | - const char *buf, |
---|
1213 | | - size_t count) |
---|
| 1181 | +static ssize_t pwm_hyst_store(struct device *dev, |
---|
| 1182 | + struct device_attribute *devattr, |
---|
| 1183 | + const char *buf, size_t count) |
---|
1214 | 1184 | { |
---|
1215 | 1185 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1216 | 1186 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1236 | 1206 | return count; |
---|
1237 | 1207 | } |
---|
1238 | 1208 | |
---|
1239 | | -static ssize_t show_pwm_tmax(struct device *dev, |
---|
1240 | | - struct device_attribute *devattr, |
---|
1241 | | - char *buf) |
---|
| 1209 | +static ssize_t pwm_tmax_show(struct device *dev, |
---|
| 1210 | + struct device_attribute *devattr, char *buf) |
---|
1242 | 1211 | { |
---|
1243 | 1212 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1244 | 1213 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1251 | 1220 | return sprintf(buf, "%d\n", tmin + trange); |
---|
1252 | 1221 | } |
---|
1253 | 1222 | |
---|
1254 | | -static ssize_t set_pwm_tmax(struct device *dev, |
---|
1255 | | - struct device_attribute *devattr, |
---|
1256 | | - const char *buf, |
---|
1257 | | - size_t count) |
---|
| 1223 | +static ssize_t pwm_tmax_store(struct device *dev, |
---|
| 1224 | + struct device_attribute *devattr, |
---|
| 1225 | + const char *buf, size_t count) |
---|
1258 | 1226 | { |
---|
1259 | 1227 | int temp; |
---|
1260 | 1228 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
.. | .. |
---|
1284 | 1252 | return count; |
---|
1285 | 1253 | } |
---|
1286 | 1254 | |
---|
1287 | | -static ssize_t show_pwm_tmin(struct device *dev, |
---|
1288 | | - struct device_attribute *devattr, |
---|
1289 | | - char *buf) |
---|
| 1255 | +static ssize_t pwm_tmin_show(struct device *dev, |
---|
| 1256 | + struct device_attribute *devattr, char *buf) |
---|
1290 | 1257 | { |
---|
1291 | 1258 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1292 | 1259 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
1293 | 1260 | return sprintf(buf, "%d\n", 1000 * (data->pwm_tmin[attr->index] - 64)); |
---|
1294 | 1261 | } |
---|
1295 | 1262 | |
---|
1296 | | -static ssize_t set_pwm_tmin(struct device *dev, |
---|
1297 | | - struct device_attribute *devattr, |
---|
1298 | | - const char *buf, |
---|
1299 | | - size_t count) |
---|
| 1263 | +static ssize_t pwm_tmin_store(struct device *dev, |
---|
| 1264 | + struct device_attribute *devattr, |
---|
| 1265 | + const char *buf, size_t count) |
---|
1300 | 1266 | { |
---|
1301 | 1267 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1302 | 1268 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1318 | 1284 | return count; |
---|
1319 | 1285 | } |
---|
1320 | 1286 | |
---|
1321 | | -static ssize_t show_pwm_auto(struct device *dev, |
---|
1322 | | - struct device_attribute *devattr, |
---|
1323 | | - char *buf) |
---|
| 1287 | +static ssize_t pwm_auto_show(struct device *dev, |
---|
| 1288 | + struct device_attribute *devattr, char *buf) |
---|
1324 | 1289 | { |
---|
1325 | 1290 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1326 | 1291 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1350 | 1315 | mutex_unlock(&data->lock); |
---|
1351 | 1316 | } |
---|
1352 | 1317 | |
---|
1353 | | -static ssize_t set_pwm_auto(struct device *dev, |
---|
1354 | | - struct device_attribute *devattr, |
---|
1355 | | - const char *buf, |
---|
1356 | | - size_t count) |
---|
| 1318 | +static ssize_t pwm_auto_store(struct device *dev, |
---|
| 1319 | + struct device_attribute *devattr, |
---|
| 1320 | + const char *buf, size_t count) |
---|
1357 | 1321 | { |
---|
1358 | 1322 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1359 | 1323 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1375 | 1339 | } |
---|
1376 | 1340 | } |
---|
1377 | 1341 | |
---|
1378 | | -static ssize_t show_pwm_auto_temp(struct device *dev, |
---|
1379 | | - struct device_attribute *devattr, |
---|
1380 | | - char *buf) |
---|
| 1342 | +static ssize_t pwm_auto_temp_show(struct device *dev, |
---|
| 1343 | + struct device_attribute *devattr, char *buf) |
---|
1381 | 1344 | { |
---|
1382 | 1345 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1383 | 1346 | struct adt7462_data *data = adt7462_update_device(dev); |
---|
.. | .. |
---|
1409 | 1372 | return ilog2(input); |
---|
1410 | 1373 | } |
---|
1411 | 1374 | |
---|
1412 | | -static ssize_t set_pwm_auto_temp(struct device *dev, |
---|
1413 | | - struct device_attribute *devattr, |
---|
1414 | | - const char *buf, |
---|
1415 | | - size_t count) |
---|
| 1375 | +static ssize_t pwm_auto_temp_store(struct device *dev, |
---|
| 1376 | + struct device_attribute *devattr, |
---|
| 1377 | + const char *buf, size_t count) |
---|
1416 | 1378 | { |
---|
1417 | 1379 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
1418 | 1380 | struct adt7462_data *data = dev_get_drvdata(dev); |
---|
.. | .. |
---|
1431 | 1393 | return count; |
---|
1432 | 1394 | } |
---|
1433 | 1395 | |
---|
1434 | | -static SENSOR_DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, |
---|
1435 | | - set_temp_max, 0); |
---|
1436 | | -static SENSOR_DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_temp_max, |
---|
1437 | | - set_temp_max, 1); |
---|
1438 | | -static SENSOR_DEVICE_ATTR(temp3_max, S_IWUSR | S_IRUGO, show_temp_max, |
---|
1439 | | - set_temp_max, 2); |
---|
1440 | | -static SENSOR_DEVICE_ATTR(temp4_max, S_IWUSR | S_IRUGO, show_temp_max, |
---|
1441 | | - set_temp_max, 3); |
---|
| 1396 | +static SENSOR_DEVICE_ATTR_RW(temp1_max, temp_max, 0); |
---|
| 1397 | +static SENSOR_DEVICE_ATTR_RW(temp2_max, temp_max, 1); |
---|
| 1398 | +static SENSOR_DEVICE_ATTR_RW(temp3_max, temp_max, 2); |
---|
| 1399 | +static SENSOR_DEVICE_ATTR_RW(temp4_max, temp_max, 3); |
---|
1442 | 1400 | |
---|
1443 | | -static SENSOR_DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, show_temp_min, |
---|
1444 | | - set_temp_min, 0); |
---|
1445 | | -static SENSOR_DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_temp_min, |
---|
1446 | | - set_temp_min, 1); |
---|
1447 | | -static SENSOR_DEVICE_ATTR(temp3_min, S_IWUSR | S_IRUGO, show_temp_min, |
---|
1448 | | - set_temp_min, 2); |
---|
1449 | | -static SENSOR_DEVICE_ATTR(temp4_min, S_IWUSR | S_IRUGO, show_temp_min, |
---|
1450 | | - set_temp_min, 3); |
---|
| 1401 | +static SENSOR_DEVICE_ATTR_RW(temp1_min, temp_min, 0); |
---|
| 1402 | +static SENSOR_DEVICE_ATTR_RW(temp2_min, temp_min, 1); |
---|
| 1403 | +static SENSOR_DEVICE_ATTR_RW(temp3_min, temp_min, 2); |
---|
| 1404 | +static SENSOR_DEVICE_ATTR_RW(temp4_min, temp_min, 3); |
---|
1451 | 1405 | |
---|
1452 | | -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0); |
---|
1453 | | -static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1); |
---|
1454 | | -static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2); |
---|
1455 | | -static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3); |
---|
| 1406 | +static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0); |
---|
| 1407 | +static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1); |
---|
| 1408 | +static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2); |
---|
| 1409 | +static SENSOR_DEVICE_ATTR_RO(temp4_input, temp, 3); |
---|
1456 | 1410 | |
---|
1457 | | -static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_temp_label, NULL, 0); |
---|
1458 | | -static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, show_temp_label, NULL, 1); |
---|
1459 | | -static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, show_temp_label, NULL, 2); |
---|
1460 | | -static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, show_temp_label, NULL, 3); |
---|
| 1411 | +static SENSOR_DEVICE_ATTR_RO(temp1_label, temp_label, 0); |
---|
| 1412 | +static SENSOR_DEVICE_ATTR_RO(temp2_label, temp_label, 1); |
---|
| 1413 | +static SENSOR_DEVICE_ATTR_RO(temp3_label, temp_label, 2); |
---|
| 1414 | +static SENSOR_DEVICE_ATTR_RO(temp4_label, temp_label, 3); |
---|
1461 | 1415 | |
---|
1462 | | -static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, |
---|
1463 | | - ADT7462_ALARM1 | ADT7462_LT_ALARM); |
---|
1464 | | -static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, |
---|
1465 | | - ADT7462_ALARM1 | ADT7462_R1T_ALARM); |
---|
1466 | | -static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, |
---|
1467 | | - ADT7462_ALARM1 | ADT7462_R2T_ALARM); |
---|
1468 | | -static SENSOR_DEVICE_ATTR(temp4_alarm, S_IRUGO, show_alarm, NULL, |
---|
1469 | | - ADT7462_ALARM1 | ADT7462_R3T_ALARM); |
---|
| 1416 | +static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, |
---|
| 1417 | + ADT7462_ALARM1 | ADT7462_LT_ALARM); |
---|
| 1418 | +static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm, |
---|
| 1419 | + ADT7462_ALARM1 | ADT7462_R1T_ALARM); |
---|
| 1420 | +static SENSOR_DEVICE_ATTR_RO(temp3_alarm, alarm, |
---|
| 1421 | + ADT7462_ALARM1 | ADT7462_R2T_ALARM); |
---|
| 1422 | +static SENSOR_DEVICE_ATTR_RO(temp4_alarm, alarm, |
---|
| 1423 | + ADT7462_ALARM1 | ADT7462_R3T_ALARM); |
---|
1470 | 1424 | |
---|
1471 | | -static SENSOR_DEVICE_ATTR(in1_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1472 | | - set_volt_max, 0); |
---|
1473 | | -static SENSOR_DEVICE_ATTR(in2_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1474 | | - set_volt_max, 1); |
---|
1475 | | -static SENSOR_DEVICE_ATTR(in3_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1476 | | - set_volt_max, 2); |
---|
1477 | | -static SENSOR_DEVICE_ATTR(in4_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1478 | | - set_volt_max, 3); |
---|
1479 | | -static SENSOR_DEVICE_ATTR(in5_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1480 | | - set_volt_max, 4); |
---|
1481 | | -static SENSOR_DEVICE_ATTR(in6_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1482 | | - set_volt_max, 5); |
---|
1483 | | -static SENSOR_DEVICE_ATTR(in7_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1484 | | - set_volt_max, 6); |
---|
1485 | | -static SENSOR_DEVICE_ATTR(in8_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1486 | | - set_volt_max, 7); |
---|
1487 | | -static SENSOR_DEVICE_ATTR(in9_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1488 | | - set_volt_max, 8); |
---|
1489 | | -static SENSOR_DEVICE_ATTR(in10_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1490 | | - set_volt_max, 9); |
---|
1491 | | -static SENSOR_DEVICE_ATTR(in11_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1492 | | - set_volt_max, 10); |
---|
1493 | | -static SENSOR_DEVICE_ATTR(in12_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1494 | | - set_volt_max, 11); |
---|
1495 | | -static SENSOR_DEVICE_ATTR(in13_max, S_IWUSR | S_IRUGO, show_volt_max, |
---|
1496 | | - set_volt_max, 12); |
---|
| 1425 | +static SENSOR_DEVICE_ATTR_RW(in1_max, volt_max, 0); |
---|
| 1426 | +static SENSOR_DEVICE_ATTR_RW(in2_max, volt_max, 1); |
---|
| 1427 | +static SENSOR_DEVICE_ATTR_RW(in3_max, volt_max, 2); |
---|
| 1428 | +static SENSOR_DEVICE_ATTR_RW(in4_max, volt_max, 3); |
---|
| 1429 | +static SENSOR_DEVICE_ATTR_RW(in5_max, volt_max, 4); |
---|
| 1430 | +static SENSOR_DEVICE_ATTR_RW(in6_max, volt_max, 5); |
---|
| 1431 | +static SENSOR_DEVICE_ATTR_RW(in7_max, volt_max, 6); |
---|
| 1432 | +static SENSOR_DEVICE_ATTR_RW(in8_max, volt_max, 7); |
---|
| 1433 | +static SENSOR_DEVICE_ATTR_RW(in9_max, volt_max, 8); |
---|
| 1434 | +static SENSOR_DEVICE_ATTR_RW(in10_max, volt_max, 9); |
---|
| 1435 | +static SENSOR_DEVICE_ATTR_RW(in11_max, volt_max, 10); |
---|
| 1436 | +static SENSOR_DEVICE_ATTR_RW(in12_max, volt_max, 11); |
---|
| 1437 | +static SENSOR_DEVICE_ATTR_RW(in13_max, volt_max, 12); |
---|
1497 | 1438 | |
---|
1498 | | -static SENSOR_DEVICE_ATTR(in1_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1499 | | - set_volt_min, 0); |
---|
1500 | | -static SENSOR_DEVICE_ATTR(in2_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1501 | | - set_volt_min, 1); |
---|
1502 | | -static SENSOR_DEVICE_ATTR(in3_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1503 | | - set_volt_min, 2); |
---|
1504 | | -static SENSOR_DEVICE_ATTR(in4_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1505 | | - set_volt_min, 3); |
---|
1506 | | -static SENSOR_DEVICE_ATTR(in5_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1507 | | - set_volt_min, 4); |
---|
1508 | | -static SENSOR_DEVICE_ATTR(in6_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1509 | | - set_volt_min, 5); |
---|
1510 | | -static SENSOR_DEVICE_ATTR(in7_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1511 | | - set_volt_min, 6); |
---|
1512 | | -static SENSOR_DEVICE_ATTR(in8_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1513 | | - set_volt_min, 7); |
---|
1514 | | -static SENSOR_DEVICE_ATTR(in9_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1515 | | - set_volt_min, 8); |
---|
1516 | | -static SENSOR_DEVICE_ATTR(in10_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1517 | | - set_volt_min, 9); |
---|
1518 | | -static SENSOR_DEVICE_ATTR(in11_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1519 | | - set_volt_min, 10); |
---|
1520 | | -static SENSOR_DEVICE_ATTR(in12_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1521 | | - set_volt_min, 11); |
---|
1522 | | -static SENSOR_DEVICE_ATTR(in13_min, S_IWUSR | S_IRUGO, show_volt_min, |
---|
1523 | | - set_volt_min, 12); |
---|
| 1439 | +static SENSOR_DEVICE_ATTR_RW(in1_min, volt_min, 0); |
---|
| 1440 | +static SENSOR_DEVICE_ATTR_RW(in2_min, volt_min, 1); |
---|
| 1441 | +static SENSOR_DEVICE_ATTR_RW(in3_min, volt_min, 2); |
---|
| 1442 | +static SENSOR_DEVICE_ATTR_RW(in4_min, volt_min, 3); |
---|
| 1443 | +static SENSOR_DEVICE_ATTR_RW(in5_min, volt_min, 4); |
---|
| 1444 | +static SENSOR_DEVICE_ATTR_RW(in6_min, volt_min, 5); |
---|
| 1445 | +static SENSOR_DEVICE_ATTR_RW(in7_min, volt_min, 6); |
---|
| 1446 | +static SENSOR_DEVICE_ATTR_RW(in8_min, volt_min, 7); |
---|
| 1447 | +static SENSOR_DEVICE_ATTR_RW(in9_min, volt_min, 8); |
---|
| 1448 | +static SENSOR_DEVICE_ATTR_RW(in10_min, volt_min, 9); |
---|
| 1449 | +static SENSOR_DEVICE_ATTR_RW(in11_min, volt_min, 10); |
---|
| 1450 | +static SENSOR_DEVICE_ATTR_RW(in12_min, volt_min, 11); |
---|
| 1451 | +static SENSOR_DEVICE_ATTR_RW(in13_min, volt_min, 12); |
---|
1524 | 1452 | |
---|
1525 | | -static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 0); |
---|
1526 | | -static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 1); |
---|
1527 | | -static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_voltage, NULL, 2); |
---|
1528 | | -static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, show_voltage, NULL, 3); |
---|
1529 | | -static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, show_voltage, NULL, 4); |
---|
1530 | | -static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 5); |
---|
1531 | | -static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 6); |
---|
1532 | | -static SENSOR_DEVICE_ATTR(in8_input, S_IRUGO, show_voltage, NULL, 7); |
---|
1533 | | -static SENSOR_DEVICE_ATTR(in9_input, S_IRUGO, show_voltage, NULL, 8); |
---|
1534 | | -static SENSOR_DEVICE_ATTR(in10_input, S_IRUGO, show_voltage, NULL, 9); |
---|
1535 | | -static SENSOR_DEVICE_ATTR(in11_input, S_IRUGO, show_voltage, NULL, 10); |
---|
1536 | | -static SENSOR_DEVICE_ATTR(in12_input, S_IRUGO, show_voltage, NULL, 11); |
---|
1537 | | -static SENSOR_DEVICE_ATTR(in13_input, S_IRUGO, show_voltage, NULL, 12); |
---|
| 1453 | +static SENSOR_DEVICE_ATTR_RO(in1_input, voltage, 0); |
---|
| 1454 | +static SENSOR_DEVICE_ATTR_RO(in2_input, voltage, 1); |
---|
| 1455 | +static SENSOR_DEVICE_ATTR_RO(in3_input, voltage, 2); |
---|
| 1456 | +static SENSOR_DEVICE_ATTR_RO(in4_input, voltage, 3); |
---|
| 1457 | +static SENSOR_DEVICE_ATTR_RO(in5_input, voltage, 4); |
---|
| 1458 | +static SENSOR_DEVICE_ATTR_RO(in6_input, voltage, 5); |
---|
| 1459 | +static SENSOR_DEVICE_ATTR_RO(in7_input, voltage, 6); |
---|
| 1460 | +static SENSOR_DEVICE_ATTR_RO(in8_input, voltage, 7); |
---|
| 1461 | +static SENSOR_DEVICE_ATTR_RO(in9_input, voltage, 8); |
---|
| 1462 | +static SENSOR_DEVICE_ATTR_RO(in10_input, voltage, 9); |
---|
| 1463 | +static SENSOR_DEVICE_ATTR_RO(in11_input, voltage, 10); |
---|
| 1464 | +static SENSOR_DEVICE_ATTR_RO(in12_input, voltage, 11); |
---|
| 1465 | +static SENSOR_DEVICE_ATTR_RO(in13_input, voltage, 12); |
---|
1538 | 1466 | |
---|
1539 | | -static SENSOR_DEVICE_ATTR(in1_label, S_IRUGO, show_voltage_label, NULL, 0); |
---|
1540 | | -static SENSOR_DEVICE_ATTR(in2_label, S_IRUGO, show_voltage_label, NULL, 1); |
---|
1541 | | -static SENSOR_DEVICE_ATTR(in3_label, S_IRUGO, show_voltage_label, NULL, 2); |
---|
1542 | | -static SENSOR_DEVICE_ATTR(in4_label, S_IRUGO, show_voltage_label, NULL, 3); |
---|
1543 | | -static SENSOR_DEVICE_ATTR(in5_label, S_IRUGO, show_voltage_label, NULL, 4); |
---|
1544 | | -static SENSOR_DEVICE_ATTR(in6_label, S_IRUGO, show_voltage_label, NULL, 5); |
---|
1545 | | -static SENSOR_DEVICE_ATTR(in7_label, S_IRUGO, show_voltage_label, NULL, 6); |
---|
1546 | | -static SENSOR_DEVICE_ATTR(in8_label, S_IRUGO, show_voltage_label, NULL, 7); |
---|
1547 | | -static SENSOR_DEVICE_ATTR(in9_label, S_IRUGO, show_voltage_label, NULL, 8); |
---|
1548 | | -static SENSOR_DEVICE_ATTR(in10_label, S_IRUGO, show_voltage_label, NULL, 9); |
---|
1549 | | -static SENSOR_DEVICE_ATTR(in11_label, S_IRUGO, show_voltage_label, NULL, 10); |
---|
1550 | | -static SENSOR_DEVICE_ATTR(in12_label, S_IRUGO, show_voltage_label, NULL, 11); |
---|
1551 | | -static SENSOR_DEVICE_ATTR(in13_label, S_IRUGO, show_voltage_label, NULL, 12); |
---|
| 1467 | +static SENSOR_DEVICE_ATTR_RO(in1_label, voltage_label, 0); |
---|
| 1468 | +static SENSOR_DEVICE_ATTR_RO(in2_label, voltage_label, 1); |
---|
| 1469 | +static SENSOR_DEVICE_ATTR_RO(in3_label, voltage_label, 2); |
---|
| 1470 | +static SENSOR_DEVICE_ATTR_RO(in4_label, voltage_label, 3); |
---|
| 1471 | +static SENSOR_DEVICE_ATTR_RO(in5_label, voltage_label, 4); |
---|
| 1472 | +static SENSOR_DEVICE_ATTR_RO(in6_label, voltage_label, 5); |
---|
| 1473 | +static SENSOR_DEVICE_ATTR_RO(in7_label, voltage_label, 6); |
---|
| 1474 | +static SENSOR_DEVICE_ATTR_RO(in8_label, voltage_label, 7); |
---|
| 1475 | +static SENSOR_DEVICE_ATTR_RO(in9_label, voltage_label, 8); |
---|
| 1476 | +static SENSOR_DEVICE_ATTR_RO(in10_label, voltage_label, 9); |
---|
| 1477 | +static SENSOR_DEVICE_ATTR_RO(in11_label, voltage_label, 10); |
---|
| 1478 | +static SENSOR_DEVICE_ATTR_RO(in12_label, voltage_label, 11); |
---|
| 1479 | +static SENSOR_DEVICE_ATTR_RO(in13_label, voltage_label, 12); |
---|
1552 | 1480 | |
---|
1553 | | -static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, |
---|
1554 | | - ADT7462_ALARM2 | ADT7462_V0_ALARM); |
---|
1555 | | -static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, |
---|
1556 | | - ADT7462_ALARM2 | ADT7462_V7_ALARM); |
---|
1557 | | -static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, |
---|
1558 | | - ADT7462_ALARM2 | ADT7462_V2_ALARM); |
---|
1559 | | -static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, |
---|
1560 | | - ADT7462_ALARM2 | ADT7462_V6_ALARM); |
---|
1561 | | -static SENSOR_DEVICE_ATTR(in5_alarm, S_IRUGO, show_alarm, NULL, |
---|
1562 | | - ADT7462_ALARM2 | ADT7462_V5_ALARM); |
---|
1563 | | -static SENSOR_DEVICE_ATTR(in6_alarm, S_IRUGO, show_alarm, NULL, |
---|
1564 | | - ADT7462_ALARM2 | ADT7462_V4_ALARM); |
---|
1565 | | -static SENSOR_DEVICE_ATTR(in7_alarm, S_IRUGO, show_alarm, NULL, |
---|
1566 | | - ADT7462_ALARM2 | ADT7462_V3_ALARM); |
---|
1567 | | -static SENSOR_DEVICE_ATTR(in8_alarm, S_IRUGO, show_alarm, NULL, |
---|
1568 | | - ADT7462_ALARM2 | ADT7462_V1_ALARM); |
---|
1569 | | -static SENSOR_DEVICE_ATTR(in9_alarm, S_IRUGO, show_alarm, NULL, |
---|
1570 | | - ADT7462_ALARM3 | ADT7462_V10_ALARM); |
---|
1571 | | -static SENSOR_DEVICE_ATTR(in10_alarm, S_IRUGO, show_alarm, NULL, |
---|
1572 | | - ADT7462_ALARM3 | ADT7462_V9_ALARM); |
---|
1573 | | -static SENSOR_DEVICE_ATTR(in11_alarm, S_IRUGO, show_alarm, NULL, |
---|
1574 | | - ADT7462_ALARM3 | ADT7462_V8_ALARM); |
---|
1575 | | -static SENSOR_DEVICE_ATTR(in12_alarm, S_IRUGO, show_alarm, NULL, |
---|
1576 | | - ADT7462_ALARM3 | ADT7462_V11_ALARM); |
---|
1577 | | -static SENSOR_DEVICE_ATTR(in13_alarm, S_IRUGO, show_alarm, NULL, |
---|
1578 | | - ADT7462_ALARM3 | ADT7462_V12_ALARM); |
---|
| 1481 | +static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm, |
---|
| 1482 | + ADT7462_ALARM2 | ADT7462_V0_ALARM); |
---|
| 1483 | +static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm, |
---|
| 1484 | + ADT7462_ALARM2 | ADT7462_V7_ALARM); |
---|
| 1485 | +static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm, |
---|
| 1486 | + ADT7462_ALARM2 | ADT7462_V2_ALARM); |
---|
| 1487 | +static SENSOR_DEVICE_ATTR_RO(in4_alarm, alarm, |
---|
| 1488 | + ADT7462_ALARM2 | ADT7462_V6_ALARM); |
---|
| 1489 | +static SENSOR_DEVICE_ATTR_RO(in5_alarm, alarm, |
---|
| 1490 | + ADT7462_ALARM2 | ADT7462_V5_ALARM); |
---|
| 1491 | +static SENSOR_DEVICE_ATTR_RO(in6_alarm, alarm, |
---|
| 1492 | + ADT7462_ALARM2 | ADT7462_V4_ALARM); |
---|
| 1493 | +static SENSOR_DEVICE_ATTR_RO(in7_alarm, alarm, |
---|
| 1494 | + ADT7462_ALARM2 | ADT7462_V3_ALARM); |
---|
| 1495 | +static SENSOR_DEVICE_ATTR_RO(in8_alarm, alarm, |
---|
| 1496 | + ADT7462_ALARM2 | ADT7462_V1_ALARM); |
---|
| 1497 | +static SENSOR_DEVICE_ATTR_RO(in9_alarm, alarm, |
---|
| 1498 | + ADT7462_ALARM3 | ADT7462_V10_ALARM); |
---|
| 1499 | +static SENSOR_DEVICE_ATTR_RO(in10_alarm, alarm, |
---|
| 1500 | + ADT7462_ALARM3 | ADT7462_V9_ALARM); |
---|
| 1501 | +static SENSOR_DEVICE_ATTR_RO(in11_alarm, alarm, |
---|
| 1502 | + ADT7462_ALARM3 | ADT7462_V8_ALARM); |
---|
| 1503 | +static SENSOR_DEVICE_ATTR_RO(in12_alarm, alarm, |
---|
| 1504 | + ADT7462_ALARM3 | ADT7462_V11_ALARM); |
---|
| 1505 | +static SENSOR_DEVICE_ATTR_RO(in13_alarm, alarm, |
---|
| 1506 | + ADT7462_ALARM3 | ADT7462_V12_ALARM); |
---|
1579 | 1507 | |
---|
1580 | | -static SENSOR_DEVICE_ATTR(fan1_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1581 | | - set_fan_min, 0); |
---|
1582 | | -static SENSOR_DEVICE_ATTR(fan2_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1583 | | - set_fan_min, 1); |
---|
1584 | | -static SENSOR_DEVICE_ATTR(fan3_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1585 | | - set_fan_min, 2); |
---|
1586 | | -static SENSOR_DEVICE_ATTR(fan4_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1587 | | - set_fan_min, 3); |
---|
1588 | | -static SENSOR_DEVICE_ATTR(fan5_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1589 | | - set_fan_min, 4); |
---|
1590 | | -static SENSOR_DEVICE_ATTR(fan6_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1591 | | - set_fan_min, 5); |
---|
1592 | | -static SENSOR_DEVICE_ATTR(fan7_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1593 | | - set_fan_min, 6); |
---|
1594 | | -static SENSOR_DEVICE_ATTR(fan8_min, S_IWUSR | S_IRUGO, show_fan_min, |
---|
1595 | | - set_fan_min, 7); |
---|
| 1508 | +static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0); |
---|
| 1509 | +static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1); |
---|
| 1510 | +static SENSOR_DEVICE_ATTR_RW(fan3_min, fan_min, 2); |
---|
| 1511 | +static SENSOR_DEVICE_ATTR_RW(fan4_min, fan_min, 3); |
---|
| 1512 | +static SENSOR_DEVICE_ATTR_RW(fan5_min, fan_min, 4); |
---|
| 1513 | +static SENSOR_DEVICE_ATTR_RW(fan6_min, fan_min, 5); |
---|
| 1514 | +static SENSOR_DEVICE_ATTR_RW(fan7_min, fan_min, 6); |
---|
| 1515 | +static SENSOR_DEVICE_ATTR_RW(fan8_min, fan_min, 7); |
---|
1596 | 1516 | |
---|
1597 | | -static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0); |
---|
1598 | | -static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 1); |
---|
1599 | | -static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, show_fan, NULL, 2); |
---|
1600 | | -static SENSOR_DEVICE_ATTR(fan4_input, S_IRUGO, show_fan, NULL, 3); |
---|
1601 | | -static SENSOR_DEVICE_ATTR(fan5_input, S_IRUGO, show_fan, NULL, 4); |
---|
1602 | | -static SENSOR_DEVICE_ATTR(fan6_input, S_IRUGO, show_fan, NULL, 5); |
---|
1603 | | -static SENSOR_DEVICE_ATTR(fan7_input, S_IRUGO, show_fan, NULL, 6); |
---|
1604 | | -static SENSOR_DEVICE_ATTR(fan8_input, S_IRUGO, show_fan, NULL, 7); |
---|
| 1517 | +static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0); |
---|
| 1518 | +static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1); |
---|
| 1519 | +static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 2); |
---|
| 1520 | +static SENSOR_DEVICE_ATTR_RO(fan4_input, fan, 3); |
---|
| 1521 | +static SENSOR_DEVICE_ATTR_RO(fan5_input, fan, 4); |
---|
| 1522 | +static SENSOR_DEVICE_ATTR_RO(fan6_input, fan, 5); |
---|
| 1523 | +static SENSOR_DEVICE_ATTR_RO(fan7_input, fan, 6); |
---|
| 1524 | +static SENSOR_DEVICE_ATTR_RO(fan8_input, fan, 7); |
---|
1605 | 1525 | |
---|
1606 | | -static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, |
---|
1607 | | - ADT7462_ALARM4 | ADT7462_F0_ALARM); |
---|
1608 | | -static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, |
---|
1609 | | - ADT7462_ALARM4 | ADT7462_F1_ALARM); |
---|
1610 | | -static SENSOR_DEVICE_ATTR(fan3_alarm, S_IRUGO, show_alarm, NULL, |
---|
1611 | | - ADT7462_ALARM4 | ADT7462_F2_ALARM); |
---|
1612 | | -static SENSOR_DEVICE_ATTR(fan4_alarm, S_IRUGO, show_alarm, NULL, |
---|
1613 | | - ADT7462_ALARM4 | ADT7462_F3_ALARM); |
---|
1614 | | -static SENSOR_DEVICE_ATTR(fan5_alarm, S_IRUGO, show_alarm, NULL, |
---|
1615 | | - ADT7462_ALARM4 | ADT7462_F4_ALARM); |
---|
1616 | | -static SENSOR_DEVICE_ATTR(fan6_alarm, S_IRUGO, show_alarm, NULL, |
---|
1617 | | - ADT7462_ALARM4 | ADT7462_F5_ALARM); |
---|
1618 | | -static SENSOR_DEVICE_ATTR(fan7_alarm, S_IRUGO, show_alarm, NULL, |
---|
1619 | | - ADT7462_ALARM4 | ADT7462_F6_ALARM); |
---|
1620 | | -static SENSOR_DEVICE_ATTR(fan8_alarm, S_IRUGO, show_alarm, NULL, |
---|
1621 | | - ADT7462_ALARM4 | ADT7462_F7_ALARM); |
---|
| 1526 | +static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm, |
---|
| 1527 | + ADT7462_ALARM4 | ADT7462_F0_ALARM); |
---|
| 1528 | +static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm, |
---|
| 1529 | + ADT7462_ALARM4 | ADT7462_F1_ALARM); |
---|
| 1530 | +static SENSOR_DEVICE_ATTR_RO(fan3_alarm, alarm, |
---|
| 1531 | + ADT7462_ALARM4 | ADT7462_F2_ALARM); |
---|
| 1532 | +static SENSOR_DEVICE_ATTR_RO(fan4_alarm, alarm, |
---|
| 1533 | + ADT7462_ALARM4 | ADT7462_F3_ALARM); |
---|
| 1534 | +static SENSOR_DEVICE_ATTR_RO(fan5_alarm, alarm, |
---|
| 1535 | + ADT7462_ALARM4 | ADT7462_F4_ALARM); |
---|
| 1536 | +static SENSOR_DEVICE_ATTR_RO(fan6_alarm, alarm, |
---|
| 1537 | + ADT7462_ALARM4 | ADT7462_F5_ALARM); |
---|
| 1538 | +static SENSOR_DEVICE_ATTR_RO(fan7_alarm, alarm, |
---|
| 1539 | + ADT7462_ALARM4 | ADT7462_F6_ALARM); |
---|
| 1540 | +static SENSOR_DEVICE_ATTR_RO(fan8_alarm, alarm, |
---|
| 1541 | + ADT7462_ALARM4 | ADT7462_F7_ALARM); |
---|
1622 | 1542 | |
---|
1623 | | -static SENSOR_DEVICE_ATTR(force_pwm_max, S_IWUSR | S_IRUGO, |
---|
1624 | | - show_force_pwm_max, set_force_pwm_max, 0); |
---|
| 1543 | +static SENSOR_DEVICE_ATTR_RW(force_pwm_max, force_pwm_max, 0); |
---|
1625 | 1544 | |
---|
1626 | | -static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 0); |
---|
1627 | | -static SENSOR_DEVICE_ATTR(pwm2, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 1); |
---|
1628 | | -static SENSOR_DEVICE_ATTR(pwm3, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 2); |
---|
1629 | | -static SENSOR_DEVICE_ATTR(pwm4, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 3); |
---|
| 1545 | +static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, 0); |
---|
| 1546 | +static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, 1); |
---|
| 1547 | +static SENSOR_DEVICE_ATTR_RW(pwm3, pwm, 2); |
---|
| 1548 | +static SENSOR_DEVICE_ATTR_RW(pwm4, pwm, 3); |
---|
1630 | 1549 | |
---|
1631 | | -static SENSOR_DEVICE_ATTR(pwm1_auto_point1_pwm, S_IWUSR | S_IRUGO, |
---|
1632 | | - show_pwm_min, set_pwm_min, 0); |
---|
1633 | | -static SENSOR_DEVICE_ATTR(pwm2_auto_point1_pwm, S_IWUSR | S_IRUGO, |
---|
1634 | | - show_pwm_min, set_pwm_min, 1); |
---|
1635 | | -static SENSOR_DEVICE_ATTR(pwm3_auto_point1_pwm, S_IWUSR | S_IRUGO, |
---|
1636 | | - show_pwm_min, set_pwm_min, 2); |
---|
1637 | | -static SENSOR_DEVICE_ATTR(pwm4_auto_point1_pwm, S_IWUSR | S_IRUGO, |
---|
1638 | | - show_pwm_min, set_pwm_min, 3); |
---|
| 1550 | +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point1_pwm, pwm_min, 0); |
---|
| 1551 | +static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point1_pwm, pwm_min, 1); |
---|
| 1552 | +static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point1_pwm, pwm_min, 2); |
---|
| 1553 | +static SENSOR_DEVICE_ATTR_RW(pwm4_auto_point1_pwm, pwm_min, 3); |
---|
1639 | 1554 | |
---|
1640 | | -static SENSOR_DEVICE_ATTR(pwm1_auto_point2_pwm, S_IWUSR | S_IRUGO, |
---|
1641 | | - show_pwm_max, set_pwm_max, 0); |
---|
1642 | | -static SENSOR_DEVICE_ATTR(pwm2_auto_point2_pwm, S_IWUSR | S_IRUGO, |
---|
1643 | | - show_pwm_max, set_pwm_max, 1); |
---|
1644 | | -static SENSOR_DEVICE_ATTR(pwm3_auto_point2_pwm, S_IWUSR | S_IRUGO, |
---|
1645 | | - show_pwm_max, set_pwm_max, 2); |
---|
1646 | | -static SENSOR_DEVICE_ATTR(pwm4_auto_point2_pwm, S_IWUSR | S_IRUGO, |
---|
1647 | | - show_pwm_max, set_pwm_max, 3); |
---|
| 1555 | +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point2_pwm, pwm_max, 0); |
---|
| 1556 | +static SENSOR_DEVICE_ATTR_RW(pwm2_auto_point2_pwm, pwm_max, 1); |
---|
| 1557 | +static SENSOR_DEVICE_ATTR_RW(pwm3_auto_point2_pwm, pwm_max, 2); |
---|
| 1558 | +static SENSOR_DEVICE_ATTR_RW(pwm4_auto_point2_pwm, pwm_max, 3); |
---|
1648 | 1559 | |
---|
1649 | | -static SENSOR_DEVICE_ATTR(temp1_auto_point1_hyst, S_IWUSR | S_IRUGO, |
---|
1650 | | - show_pwm_hyst, set_pwm_hyst, 0); |
---|
1651 | | -static SENSOR_DEVICE_ATTR(temp2_auto_point1_hyst, S_IWUSR | S_IRUGO, |
---|
1652 | | - show_pwm_hyst, set_pwm_hyst, 1); |
---|
1653 | | -static SENSOR_DEVICE_ATTR(temp3_auto_point1_hyst, S_IWUSR | S_IRUGO, |
---|
1654 | | - show_pwm_hyst, set_pwm_hyst, 2); |
---|
1655 | | -static SENSOR_DEVICE_ATTR(temp4_auto_point1_hyst, S_IWUSR | S_IRUGO, |
---|
1656 | | - show_pwm_hyst, set_pwm_hyst, 3); |
---|
| 1560 | +static SENSOR_DEVICE_ATTR_RW(temp1_auto_point1_hyst, pwm_hyst, 0); |
---|
| 1561 | +static SENSOR_DEVICE_ATTR_RW(temp2_auto_point1_hyst, pwm_hyst, 1); |
---|
| 1562 | +static SENSOR_DEVICE_ATTR_RW(temp3_auto_point1_hyst, pwm_hyst, 2); |
---|
| 1563 | +static SENSOR_DEVICE_ATTR_RW(temp4_auto_point1_hyst, pwm_hyst, 3); |
---|
1657 | 1564 | |
---|
1658 | | -static SENSOR_DEVICE_ATTR(temp1_auto_point2_hyst, S_IWUSR | S_IRUGO, |
---|
1659 | | - show_pwm_hyst, set_pwm_hyst, 0); |
---|
1660 | | -static SENSOR_DEVICE_ATTR(temp2_auto_point2_hyst, S_IWUSR | S_IRUGO, |
---|
1661 | | - show_pwm_hyst, set_pwm_hyst, 1); |
---|
1662 | | -static SENSOR_DEVICE_ATTR(temp3_auto_point2_hyst, S_IWUSR | S_IRUGO, |
---|
1663 | | - show_pwm_hyst, set_pwm_hyst, 2); |
---|
1664 | | -static SENSOR_DEVICE_ATTR(temp4_auto_point2_hyst, S_IWUSR | S_IRUGO, |
---|
1665 | | - show_pwm_hyst, set_pwm_hyst, 3); |
---|
| 1565 | +static SENSOR_DEVICE_ATTR_RW(temp1_auto_point2_hyst, pwm_hyst, 0); |
---|
| 1566 | +static SENSOR_DEVICE_ATTR_RW(temp2_auto_point2_hyst, pwm_hyst, 1); |
---|
| 1567 | +static SENSOR_DEVICE_ATTR_RW(temp3_auto_point2_hyst, pwm_hyst, 2); |
---|
| 1568 | +static SENSOR_DEVICE_ATTR_RW(temp4_auto_point2_hyst, pwm_hyst, 3); |
---|
1666 | 1569 | |
---|
1667 | | -static SENSOR_DEVICE_ATTR(temp1_auto_point1_temp, S_IWUSR | S_IRUGO, |
---|
1668 | | - show_pwm_tmin, set_pwm_tmin, 0); |
---|
1669 | | -static SENSOR_DEVICE_ATTR(temp2_auto_point1_temp, S_IWUSR | S_IRUGO, |
---|
1670 | | - show_pwm_tmin, set_pwm_tmin, 1); |
---|
1671 | | -static SENSOR_DEVICE_ATTR(temp3_auto_point1_temp, S_IWUSR | S_IRUGO, |
---|
1672 | | - show_pwm_tmin, set_pwm_tmin, 2); |
---|
1673 | | -static SENSOR_DEVICE_ATTR(temp4_auto_point1_temp, S_IWUSR | S_IRUGO, |
---|
1674 | | - show_pwm_tmin, set_pwm_tmin, 3); |
---|
| 1570 | +static SENSOR_DEVICE_ATTR_RW(temp1_auto_point1_temp, pwm_tmin, 0); |
---|
| 1571 | +static SENSOR_DEVICE_ATTR_RW(temp2_auto_point1_temp, pwm_tmin, 1); |
---|
| 1572 | +static SENSOR_DEVICE_ATTR_RW(temp3_auto_point1_temp, pwm_tmin, 2); |
---|
| 1573 | +static SENSOR_DEVICE_ATTR_RW(temp4_auto_point1_temp, pwm_tmin, 3); |
---|
1675 | 1574 | |
---|
1676 | | -static SENSOR_DEVICE_ATTR(temp1_auto_point2_temp, S_IWUSR | S_IRUGO, |
---|
1677 | | - show_pwm_tmax, set_pwm_tmax, 0); |
---|
1678 | | -static SENSOR_DEVICE_ATTR(temp2_auto_point2_temp, S_IWUSR | S_IRUGO, |
---|
1679 | | - show_pwm_tmax, set_pwm_tmax, 1); |
---|
1680 | | -static SENSOR_DEVICE_ATTR(temp3_auto_point2_temp, S_IWUSR | S_IRUGO, |
---|
1681 | | - show_pwm_tmax, set_pwm_tmax, 2); |
---|
1682 | | -static SENSOR_DEVICE_ATTR(temp4_auto_point2_temp, S_IWUSR | S_IRUGO, |
---|
1683 | | - show_pwm_tmax, set_pwm_tmax, 3); |
---|
| 1575 | +static SENSOR_DEVICE_ATTR_RW(temp1_auto_point2_temp, pwm_tmax, 0); |
---|
| 1576 | +static SENSOR_DEVICE_ATTR_RW(temp2_auto_point2_temp, pwm_tmax, 1); |
---|
| 1577 | +static SENSOR_DEVICE_ATTR_RW(temp3_auto_point2_temp, pwm_tmax, 2); |
---|
| 1578 | +static SENSOR_DEVICE_ATTR_RW(temp4_auto_point2_temp, pwm_tmax, 3); |
---|
1684 | 1579 | |
---|
1685 | | -static SENSOR_DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO, show_pwm_auto, |
---|
1686 | | - set_pwm_auto, 0); |
---|
1687 | | -static SENSOR_DEVICE_ATTR(pwm2_enable, S_IWUSR | S_IRUGO, show_pwm_auto, |
---|
1688 | | - set_pwm_auto, 1); |
---|
1689 | | -static SENSOR_DEVICE_ATTR(pwm3_enable, S_IWUSR | S_IRUGO, show_pwm_auto, |
---|
1690 | | - set_pwm_auto, 2); |
---|
1691 | | -static SENSOR_DEVICE_ATTR(pwm4_enable, S_IWUSR | S_IRUGO, show_pwm_auto, |
---|
1692 | | - set_pwm_auto, 3); |
---|
| 1580 | +static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_auto, 0); |
---|
| 1581 | +static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_auto, 1); |
---|
| 1582 | +static SENSOR_DEVICE_ATTR_RW(pwm3_enable, pwm_auto, 2); |
---|
| 1583 | +static SENSOR_DEVICE_ATTR_RW(pwm4_enable, pwm_auto, 3); |
---|
1693 | 1584 | |
---|
1694 | | -static SENSOR_DEVICE_ATTR(pwm1_auto_channels_temp, S_IWUSR | S_IRUGO, |
---|
1695 | | - show_pwm_auto_temp, set_pwm_auto_temp, 0); |
---|
1696 | | -static SENSOR_DEVICE_ATTR(pwm2_auto_channels_temp, S_IWUSR | S_IRUGO, |
---|
1697 | | - show_pwm_auto_temp, set_pwm_auto_temp, 1); |
---|
1698 | | -static SENSOR_DEVICE_ATTR(pwm3_auto_channels_temp, S_IWUSR | S_IRUGO, |
---|
1699 | | - show_pwm_auto_temp, set_pwm_auto_temp, 2); |
---|
1700 | | -static SENSOR_DEVICE_ATTR(pwm4_auto_channels_temp, S_IWUSR | S_IRUGO, |
---|
1701 | | - show_pwm_auto_temp, set_pwm_auto_temp, 3); |
---|
| 1585 | +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_channels_temp, pwm_auto_temp, 0); |
---|
| 1586 | +static SENSOR_DEVICE_ATTR_RW(pwm2_auto_channels_temp, pwm_auto_temp, 1); |
---|
| 1587 | +static SENSOR_DEVICE_ATTR_RW(pwm3_auto_channels_temp, pwm_auto_temp, 2); |
---|
| 1588 | +static SENSOR_DEVICE_ATTR_RW(pwm4_auto_channels_temp, pwm_auto_temp, 3); |
---|
1702 | 1589 | |
---|
1703 | 1590 | static struct attribute *adt7462_attrs[] = { |
---|
1704 | 1591 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
---|
.. | .. |
---|
1900 | 1787 | return 0; |
---|
1901 | 1788 | } |
---|
1902 | 1789 | |
---|
1903 | | -static int adt7462_probe(struct i2c_client *client, |
---|
1904 | | - const struct i2c_device_id *id) |
---|
| 1790 | +static int adt7462_probe(struct i2c_client *client) |
---|
1905 | 1791 | { |
---|
1906 | 1792 | struct device *dev = &client->dev; |
---|
1907 | 1793 | struct adt7462_data *data; |
---|
.. | .. |
---|
1933 | 1819 | .driver = { |
---|
1934 | 1820 | .name = "adt7462", |
---|
1935 | 1821 | }, |
---|
1936 | | - .probe = adt7462_probe, |
---|
| 1822 | + .probe_new = adt7462_probe, |
---|
1937 | 1823 | .id_table = adt7462_id, |
---|
1938 | 1824 | .detect = adt7462_detect, |
---|
1939 | 1825 | .address_list = normal_i2c, |
---|