diff options
Diffstat (limited to 'usr')
| -rw-r--r-- | usr/src/dkms_source_tree/applesmc.c | 145 | ||||
| -rw-r--r-- | usr/src/dkms_source_tree/dkms.conf | 2 |
2 files changed, 145 insertions, 2 deletions
diff --git a/usr/src/dkms_source_tree/applesmc.c b/usr/src/dkms_source_tree/applesmc.c index 36a0d62..7af6fe0 100644 --- a/usr/src/dkms_source_tree/applesmc.c +++ b/usr/src/dkms_source_tree/applesmc.c | |||
| @@ -657,6 +657,17 @@ out: | |||
| 657 | return snprintf(sysfsbuf, PAGE_SIZE, "(%d,%d)\n", left, right); | 657 | return snprintf(sysfsbuf, PAGE_SIZE, "(%d,%d)\n", left, right); |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | /* Displays sensor key as label */ | ||
| 661 | static ssize_t applesmc_show_sensor_label(struct device *dev, | ||
| 662 | struct device_attribute *devattr, char *sysfsbuf) | ||
| 663 | { | ||
| 664 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | ||
| 665 | const char *key = | ||
| 666 | temperature_sensors_sets[applesmc_temperature_set][attr->index]; | ||
| 667 | |||
| 668 | return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", key); | ||
| 669 | } | ||
| 670 | |||
| 660 | /* Displays degree Celsius * 1000 */ | 671 | /* Displays degree Celsius * 1000 */ |
| 661 | static ssize_t applesmc_show_temperature(struct device *dev, | 672 | static ssize_t applesmc_show_temperature(struct device *dev, |
| 662 | struct device_attribute *devattr, char *sysfsbuf) | 673 | struct device_attribute *devattr, char *sysfsbuf) |
| @@ -1124,6 +1135,86 @@ static const struct attribute_group fan_attribute_groups[] = { | |||
| 1124 | /* | 1135 | /* |
| 1125 | * Temperature sensors sysfs entries. | 1136 | * Temperature sensors sysfs entries. |
| 1126 | */ | 1137 | */ |
| 1138 | static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, | ||
| 1139 | applesmc_show_sensor_label, NULL, 0); | ||
| 1140 | static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, | ||
| 1141 | applesmc_show_sensor_label, NULL, 1); | ||
| 1142 | static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, | ||
| 1143 | applesmc_show_sensor_label, NULL, 2); | ||
| 1144 | static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, | ||
| 1145 | applesmc_show_sensor_label, NULL, 3); | ||
| 1146 | static SENSOR_DEVICE_ATTR(temp5_label, S_IRUGO, | ||
| 1147 | applesmc_show_sensor_label, NULL, 4); | ||
| 1148 | static SENSOR_DEVICE_ATTR(temp6_label, S_IRUGO, | ||
| 1149 | applesmc_show_sensor_label, NULL, 5); | ||
| 1150 | static SENSOR_DEVICE_ATTR(temp7_label, S_IRUGO, | ||
| 1151 | applesmc_show_sensor_label, NULL, 6); | ||
| 1152 | static SENSOR_DEVICE_ATTR(temp8_label, S_IRUGO, | ||
| 1153 | applesmc_show_sensor_label, NULL, 7); | ||
| 1154 | static SENSOR_DEVICE_ATTR(temp9_label, S_IRUGO, | ||
| 1155 | applesmc_show_sensor_label, NULL, 8); | ||
| 1156 | static SENSOR_DEVICE_ATTR(temp10_label, S_IRUGO, | ||
| 1157 | applesmc_show_sensor_label, NULL, 9); | ||
| 1158 | static SENSOR_DEVICE_ATTR(temp11_label, S_IRUGO, | ||
| 1159 | applesmc_show_sensor_label, NULL, 10); | ||
| 1160 | static SENSOR_DEVICE_ATTR(temp12_label, S_IRUGO, | ||
| 1161 | applesmc_show_sensor_label, NULL, 11); | ||
| 1162 | static SENSOR_DEVICE_ATTR(temp13_label, S_IRUGO, | ||
| 1163 | applesmc_show_sensor_label, NULL, 12); | ||
| 1164 | static SENSOR_DEVICE_ATTR(temp14_label, S_IRUGO, | ||
| 1165 | applesmc_show_sensor_label, NULL, 13); | ||
| 1166 | static SENSOR_DEVICE_ATTR(temp15_label, S_IRUGO, | ||
| 1167 | applesmc_show_sensor_label, NULL, 14); | ||
| 1168 | static SENSOR_DEVICE_ATTR(temp16_label, S_IRUGO, | ||
| 1169 | applesmc_show_sensor_label, NULL, 15); | ||
| 1170 | static SENSOR_DEVICE_ATTR(temp17_label, S_IRUGO, | ||
| 1171 | applesmc_show_sensor_label, NULL, 16); | ||
| 1172 | static SENSOR_DEVICE_ATTR(temp18_label, S_IRUGO, | ||
| 1173 | applesmc_show_sensor_label, NULL, 17); | ||
| 1174 | static SENSOR_DEVICE_ATTR(temp19_label, S_IRUGO, | ||
| 1175 | applesmc_show_sensor_label, NULL, 18); | ||
| 1176 | static SENSOR_DEVICE_ATTR(temp20_label, S_IRUGO, | ||
| 1177 | applesmc_show_sensor_label, NULL, 19); | ||
| 1178 | static SENSOR_DEVICE_ATTR(temp21_label, S_IRUGO, | ||
| 1179 | applesmc_show_sensor_label, NULL, 20); | ||
| 1180 | static SENSOR_DEVICE_ATTR(temp22_label, S_IRUGO, | ||
| 1181 | applesmc_show_sensor_label, NULL, 21); | ||
| 1182 | static SENSOR_DEVICE_ATTR(temp23_label, S_IRUGO, | ||
| 1183 | applesmc_show_sensor_label, NULL, 22); | ||
| 1184 | static SENSOR_DEVICE_ATTR(temp24_label, S_IRUGO, | ||
| 1185 | applesmc_show_sensor_label, NULL, 23); | ||
| 1186 | static SENSOR_DEVICE_ATTR(temp25_label, S_IRUGO, | ||
| 1187 | applesmc_show_sensor_label, NULL, 24); | ||
| 1188 | static SENSOR_DEVICE_ATTR(temp26_label, S_IRUGO, | ||
| 1189 | applesmc_show_sensor_label, NULL, 25); | ||
| 1190 | static SENSOR_DEVICE_ATTR(temp27_label, S_IRUGO, | ||
| 1191 | applesmc_show_sensor_label, NULL, 26); | ||
| 1192 | static SENSOR_DEVICE_ATTR(temp28_label, S_IRUGO, | ||
| 1193 | applesmc_show_sensor_label, NULL, 27); | ||
| 1194 | static SENSOR_DEVICE_ATTR(temp29_label, S_IRUGO, | ||
| 1195 | applesmc_show_sensor_label, NULL, 28); | ||
| 1196 | static SENSOR_DEVICE_ATTR(temp30_label, S_IRUGO, | ||
| 1197 | applesmc_show_sensor_label, NULL, 29); | ||
| 1198 | static SENSOR_DEVICE_ATTR(temp31_label, S_IRUGO, | ||
| 1199 | applesmc_show_sensor_label, NULL, 30); | ||
| 1200 | static SENSOR_DEVICE_ATTR(temp32_label, S_IRUGO, | ||
| 1201 | applesmc_show_sensor_label, NULL, 31); | ||
| 1202 | static SENSOR_DEVICE_ATTR(temp33_label, S_IRUGO, | ||
| 1203 | applesmc_show_sensor_label, NULL, 32); | ||
| 1204 | static SENSOR_DEVICE_ATTR(temp34_label, S_IRUGO, | ||
| 1205 | applesmc_show_sensor_label, NULL, 33); | ||
| 1206 | static SENSOR_DEVICE_ATTR(temp35_label, S_IRUGO, | ||
| 1207 | applesmc_show_sensor_label, NULL, 34); | ||
| 1208 | static SENSOR_DEVICE_ATTR(temp36_label, S_IRUGO, | ||
| 1209 | applesmc_show_sensor_label, NULL, 35); | ||
| 1210 | static SENSOR_DEVICE_ATTR(temp37_label, S_IRUGO, | ||
| 1211 | applesmc_show_sensor_label, NULL, 36); | ||
| 1212 | static SENSOR_DEVICE_ATTR(temp38_label, S_IRUGO, | ||
| 1213 | applesmc_show_sensor_label, NULL, 37); | ||
| 1214 | static SENSOR_DEVICE_ATTR(temp39_label, S_IRUGO, | ||
| 1215 | applesmc_show_sensor_label, NULL, 38); | ||
| 1216 | static SENSOR_DEVICE_ATTR(temp40_label, S_IRUGO, | ||
| 1217 | applesmc_show_sensor_label, NULL, 39); | ||
| 1127 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, | 1218 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, |
| 1128 | applesmc_show_temperature, NULL, 0); | 1219 | applesmc_show_temperature, NULL, 0); |
| 1129 | static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, | 1220 | static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, |
| @@ -1205,6 +1296,50 @@ static SENSOR_DEVICE_ATTR(temp39_input, S_IRUGO, | |||
| 1205 | static SENSOR_DEVICE_ATTR(temp40_input, S_IRUGO, | 1296 | static SENSOR_DEVICE_ATTR(temp40_input, S_IRUGO, |
| 1206 | applesmc_show_temperature, NULL, 39); | 1297 | applesmc_show_temperature, NULL, 39); |
| 1207 | 1298 | ||
| 1299 | static struct attribute *label_attributes[] = { | ||
| 1300 | &sensor_dev_attr_temp1_label.dev_attr.attr, | ||
| 1301 | &sensor_dev_attr_temp2_label.dev_attr.attr, | ||
| 1302 | &sensor_dev_attr_temp3_label.dev_attr.attr, | ||
| 1303 | &sensor_dev_attr_temp4_label.dev_attr.attr, | ||
| 1304 | &sensor_dev_attr_temp5_label.dev_attr.attr, | ||
| 1305 | &sensor_dev_attr_temp6_label.dev_attr.attr, | ||
| 1306 | &sensor_dev_attr_temp7_label.dev_attr.attr, | ||
| 1307 | &sensor_dev_attr_temp8_label.dev_attr.attr, | ||
| 1308 | &sensor_dev_attr_temp9_label.dev_attr.attr, | ||
| 1309 | &sensor_dev_attr_temp10_label.dev_attr.attr, | ||
| 1310 | &sensor_dev_attr_temp11_label.dev_attr.attr, | ||
| 1311 | &sensor_dev_attr_temp12_label.dev_attr.attr, | ||
| 1312 | &sensor_dev_attr_temp13_label.dev_attr.attr, | ||
| 1313 | &sensor_dev_attr_temp14_label.dev_attr.attr, | ||
| 1314 | &sensor_dev_attr_temp15_label.dev_attr.attr, | ||
| 1315 | &sensor_dev_attr_temp16_label.dev_attr.attr, | ||
| 1316 | &sensor_dev_attr_temp17_label.dev_attr.attr, | ||
| 1317 | &sensor_dev_attr_temp18_label.dev_attr.attr, | ||
| 1318 | &sensor_dev_attr_temp19_label.dev_attr.attr, | ||
| 1319 | &sensor_dev_attr_temp20_label.dev_attr.attr, | ||
| 1320 | &sensor_dev_attr_temp21_label.dev_attr.attr, | ||
| 1321 | &sensor_dev_attr_temp22_label.dev_attr.attr, | ||
| 1322 | &sensor_dev_attr_temp23_label.dev_attr.attr, | ||
| 1323 | &sensor_dev_attr_temp24_label.dev_attr.attr, | ||
| 1324 | &sensor_dev_attr_temp25_label.dev_attr.attr, | ||
| 1325 | &sensor_dev_attr_temp26_label.dev_attr.attr, | ||
| 1326 | &sensor_dev_attr_temp27_label.dev_attr.attr, | ||
| 1327 | &sensor_dev_attr_temp28_label.dev_attr.attr, | ||
| 1328 | &sensor_dev_attr_temp29_label.dev_attr.attr, | ||
| 1329 | &sensor_dev_attr_temp30_label.dev_attr.attr, | ||
| 1330 | &sensor_dev_attr_temp31_label.dev_attr.attr, | ||
| 1331 | &sensor_dev_attr_temp32_label.dev_attr.attr, | ||
| 1332 | &sensor_dev_attr_temp33_label.dev_attr.attr, | ||
| 1333 | &sensor_dev_attr_temp34_label.dev_attr.attr, | ||
| 1334 | &sensor_dev_attr_temp35_label.dev_attr.attr, | ||
| 1335 | &sensor_dev_attr_temp36_label.dev_attr.attr, | ||
| 1336 | &sensor_dev_attr_temp37_label.dev_attr.attr, | ||
| 1337 | &sensor_dev_attr_temp38_label.dev_attr.attr, | ||
| 1338 | &sensor_dev_attr_temp39_label.dev_attr.attr, | ||
| 1339 | &sensor_dev_attr_temp40_label.dev_attr.attr, | ||
| 1340 | NULL | ||
| 1341 | }; | ||
| 1342 | |||
| 1208 | static struct attribute *temperature_attributes[] = { | 1343 | static struct attribute *temperature_attributes[] = { |
| 1209 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 1344 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
| 1210 | &sensor_dev_attr_temp2_input.dev_attr.attr, | 1345 | &sensor_dev_attr_temp2_input.dev_attr.attr, |
| @@ -1252,6 +1387,9 @@ static struct attribute *temperature_attributes[] = { | |||
| 1252 | static const struct attribute_group temperature_attributes_group = | 1387 | static const struct attribute_group temperature_attributes_group = |
| 1253 | { .attrs = temperature_attributes }; | 1388 | { .attrs = temperature_attributes }; |
| 1254 | 1389 | ||
| 1390 | static const struct attribute_group label_attributes_group = | ||
| 1391 | { .attrs = label_attributes }; | ||
| 1392 | |||
| 1255 | /* Module stuff */ | 1393 | /* Module stuff */ |
| 1256 | 1394 | ||
| 1257 | /* | 1395 | /* |
| @@ -1568,7 +1706,8 @@ static int __init applesmc_init(void) | |||
| 1568 | for (i = 0; | 1706 | for (i = 0; |
| 1569 | temperature_sensors_sets[applesmc_temperature_set][i] != NULL; | 1707 | temperature_sensors_sets[applesmc_temperature_set][i] != NULL; |
| 1570 | i++) { | 1708 | i++) { |
| 1571 | if (temperature_attributes[i] == NULL) { | 1709 | if (temperature_attributes[i] == NULL || |
| 1710 | label_attributes[i] == NULL) { | ||
| 1572 | printk(KERN_ERR "applesmc: More temperature sensors " | 1711 | printk(KERN_ERR "applesmc: More temperature sensors " |
| 1573 | "in temperature_sensors_sets (at least %i)" | 1712 | "in temperature_sensors_sets (at least %i)" |
| 1574 | "than available sysfs files in " | 1713 | "than available sysfs files in " |
| @@ -1578,6 +1717,8 @@ static int __init applesmc_init(void) | |||
| 1578 | } | 1717 | } |
| 1579 | ret = sysfs_create_file(&pdev->dev.kobj, | 1718 | ret = sysfs_create_file(&pdev->dev.kobj, |
| 1580 | temperature_attributes[i]); | 1719 | temperature_attributes[i]); |
| 1720 | ret = sysfs_create_file(&pdev->dev.kobj, | ||
| 1721 | label_attributes[i]); | ||
| 1581 | if (ret) | 1722 | if (ret) |
| 1582 | goto out_temperature; | 1723 | goto out_temperature; |
| 1583 | } | 1724 | } |
| @@ -1630,6 +1771,7 @@ out_accelerometer: | |||
| 1630 | if (applesmc_accelerometer) | 1771 | if (applesmc_accelerometer) |
| 1631 | applesmc_release_accelerometer(); | 1772 | applesmc_release_accelerometer(); |
| 1632 | out_temperature: | 1773 | out_temperature: |
| 1774 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); | ||
| 1633 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); | 1775 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); |
| 1634 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); | 1776 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); |
| 1635 | out_fan_1: | 1777 | out_fan_1: |
| @@ -1659,6 +1801,7 @@ static void __exit applesmc_exit(void) | |||
| 1659 | } | 1801 | } |
| 1660 | if (applesmc_accelerometer) | 1802 | if (applesmc_accelerometer) |
| 1661 | applesmc_release_accelerometer(); | 1803 | applesmc_release_accelerometer(); |
| 1804 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); | ||
| 1662 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); | 1805 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); |
| 1663 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); | 1806 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); |
| 1664 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); | 1807 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); |
diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf index df2247d..141298a 100644 --- a/usr/src/dkms_source_tree/dkms.conf +++ b/usr/src/dkms_source_tree/dkms.conf | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | NAME=applesmc | 1 | NAME=applesmc |
| 2 | VERSION=0.15.2 | 2 | VERSION=0.16.0 |
| 3 | PACKAGE_NAME="$NAME" | 3 | PACKAGE_NAME="$NAME" |
| 4 | PACKAGE_VERSION="$VERSION" | 4 | PACKAGE_VERSION="$VERSION" |
| 5 | MAKE[0]="make -C ${kernel_source_dir} | 5 | MAKE[0]="make -C ${kernel_source_dir} |
