Pull now into release branch

Len Brown fcf75356 f285e3d3

+126 -113
+11 -14
Documentation/thinkpad-acpi.txt
··· 138 138 -------- 139 139 140 140 procfs: /proc/acpi/ibm/hotkey 141 - sysfs device attribute: hotkey/* 141 + sysfs device attribute: hotkey_* 142 142 143 143 Without this driver, only the Fn-F4 key (sleep button) generates an 144 144 ACPI event. With the driver loaded, the hotkey feature enabled and the ··· 196 196 197 197 sysfs notes: 198 198 199 - The hot keys attributes are in a hotkey/ subdirectory off the 200 - thinkpad device. 201 - 202 - bios_enabled: 199 + hotkey_bios_enabled: 203 200 Returns the status of the hot keys feature when 204 201 thinkpad-acpi was loaded. Upon module unload, the hot 205 202 key feature status will be restored to this value. ··· 204 207 0: hot keys were disabled 205 208 1: hot keys were enabled 206 209 207 - bios_mask: 210 + hotkey_bios_mask: 208 211 Returns the hot keys mask when thinkpad-acpi was loaded. 209 212 Upon module unload, the hot keys mask will be restored 210 213 to this value. 211 214 212 - enable: 215 + hotkey_enable: 213 216 Enables/disables the hot keys feature, and reports 214 217 current status of the hot keys feature. 215 218 216 219 0: disables the hot keys feature / feature disabled 217 220 1: enables the hot keys feature / feature enabled 218 221 219 - mask: 222 + hotkey_mask: 220 223 bit mask to enable ACPI event generation for each hot 221 224 key (see above). Returns the current status of the hot 222 225 keys mask, and allows one to modify it. ··· 226 229 --------- 227 230 228 231 procfs: /proc/acpi/ibm/bluetooth 229 - sysfs device attribute: bluetooth/enable 232 + sysfs device attribute: bluetooth_enable 230 233 231 234 This feature shows the presence and current state of a ThinkPad 232 235 Bluetooth device in the internal ThinkPad CDC slot. ··· 241 244 Sysfs notes: 242 245 243 246 If the Bluetooth CDC card is installed, it can be enabled / 244 - disabled through the "bluetooth/enable" thinkpad-acpi device 247 + disabled through the "bluetooth_enable" thinkpad-acpi device 245 248 attribute, and its current status can also be queried. 246 249 247 250 enable: ··· 249 252 1: enables Bluetooth / Bluetooth is enabled. 250 253 251 254 Note: this interface will be probably be superseeded by the 252 - generic rfkill class. 255 + generic rfkill class, so it is NOT to be considered stable yet. 253 256 254 257 Video output control -- /proc/acpi/ibm/video 255 258 -------------------------------------------- ··· 895 898 ----------------- 896 899 897 900 procfs: /proc/acpi/ibm/wan 898 - sysfs device attribute: wwan/enable 901 + sysfs device attribute: wwan_enable 899 902 900 903 This feature is marked EXPERIMENTAL because the implementation 901 904 directly accesses hardware registers and may not work as expected. USE ··· 918 921 Sysfs notes: 919 922 920 923 If the W-WAN card is installed, it can be enabled / 921 - disabled through the "wwan/enable" thinkpad-acpi device 924 + disabled through the "wwan_enable" thinkpad-acpi device 922 925 attribute, and its current status can also be queried. 923 926 924 927 enable: ··· 926 929 1: enables WWAN card / WWAN card is enabled. 927 930 928 931 Note: this interface will be probably be superseeded by the 929 - generic rfkill class. 932 + generic rfkill class, so it is NOT to be considered stable yet. 930 933 931 934 Multiple Commands, Module Parameters 932 935 ------------------------------------
+1 -1
drivers/acpi/numa.c
··· 59 59 return node_to_pxm_map[node]; 60 60 } 61 61 62 - int __cpuinit acpi_map_pxm_to_node(int pxm) 62 + int acpi_map_pxm_to_node(int pxm) 63 63 { 64 64 int node = pxm_to_node_map[pxm]; 65 65
+4 -4
drivers/acpi/tables/tbinstal.c
··· 123 123 } 124 124 } 125 125 126 - /* The table must be either an SSDT or a PSDT */ 126 + /* The table must be either an SSDT or a PSDT or an OEMx */ 127 127 128 128 if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)) 129 129 && 130 - (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))) 131 - { 130 + (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) 131 + && (strncmp(table_desc->pointer->signature, "OEM", 3))) { 132 132 ACPI_ERROR((AE_INFO, 133 - "Table has invalid signature [%4.4s], must be SSDT or PSDT", 133 + "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx", 134 134 table_desc->pointer->signature)); 135 135 return_ACPI_STATUS(AE_BAD_SIGNATURE); 136 136 }
+7 -6
drivers/acpi/thermal.c
··· 827 827 static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) 828 828 { 829 829 struct acpi_thermal *tz = seq->private; 830 + struct acpi_device *device; 830 831 int i = 0; 831 832 int j = 0; 832 833 ··· 850 849 tz->trips.passive.tc1, tz->trips.passive.tc2, 851 850 tz->trips.passive.tsp); 852 851 for (j = 0; j < tz->trips.passive.devices.count; j++) { 853 - 854 - seq_printf(seq, "0x%p ", 855 - tz->trips.passive.devices.handles[j]); 852 + acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device); 853 + seq_printf(seq, "%4.4s ", acpi_device_bid(device)); 856 854 } 857 855 seq_puts(seq, "\n"); 858 856 } ··· 862 862 seq_printf(seq, "active[%d]: %ld C: devices=", 863 863 i, 864 864 KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); 865 - for (j = 0; j < tz->trips.active[i].devices.count; j++) 866 - seq_printf(seq, "0x%p ", 867 - tz->trips.active[i].devices.handles[j]); 865 + for (j = 0; j < tz->trips.active[i].devices.count; j++){ 866 + acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device); 867 + seq_printf(seq, "%4.4s ", acpi_device_bid(device)); 868 + } 868 869 seq_puts(seq, "\n"); 869 870 } 870 871
+51 -71
drivers/acpi/utilities/utcopy.c
··· 68 68 union acpi_operand_object **return_obj); 69 69 70 70 static acpi_status 71 + acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, 72 + union acpi_operand_object **internal_object); 73 + 74 + static acpi_status 71 75 acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, 72 76 union acpi_operand_object *dest_desc); 73 77 ··· 522 518 return_ACPI_STATUS(AE_NO_MEMORY); 523 519 } 524 520 525 - #ifdef ACPI_FUTURE_IMPLEMENTATION 526 - /* Code to convert packages that are parameters to control methods */ 527 - 528 521 /******************************************************************************* 529 522 * 530 523 * FUNCTION: acpi_ut_copy_epackage_to_ipackage 531 524 * 532 - * PARAMETERS: *internal_object - Pointer to the object we are returning 533 - * *Buffer - Where the object is returned 534 - * *space_used - Where the length of the object is returned 525 + * PARAMETERS: external_object - The external object to be converted 526 + * internal_object - Where the internal object is returned 535 527 * 536 528 * RETURN: Status 537 529 * 538 - * DESCRIPTION: This function is called to place a package object in a user 539 - * buffer. A package object by definition contains other objects. 540 - * 541 - * The buffer is assumed to have sufficient space for the object. 542 - * The caller must have verified the buffer length needed using the 543 - * acpi_ut_get_object_size function before calling this function. 530 + * DESCRIPTION: Copy an external package object to an internal package. 531 + * Handles nested packages. 544 532 * 545 533 ******************************************************************************/ 546 534 547 535 static acpi_status 548 - acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object, 549 - u8 * buffer, u32 * space_used) 536 + acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, 537 + union acpi_operand_object **internal_object) 550 538 { 551 - u8 *free_space; 552 - union acpi_object *external_object; 553 - u32 length = 0; 554 - u32 this_index; 555 - u32 object_space = 0; 556 - union acpi_operand_object *this_internal_obj; 557 - union acpi_object *this_external_obj; 539 + acpi_status status = AE_OK; 540 + union acpi_operand_object *package_object; 541 + union acpi_operand_object **package_elements; 542 + acpi_native_uint i; 558 543 559 544 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); 560 545 561 - /* 562 - * First package at head of the buffer 563 - */ 564 - external_object = (union acpi_object *)buffer; 546 + /* Create the package object */ 547 + 548 + package_object = 549 + acpi_ut_create_package_object(external_object->package.count); 550 + if (!package_object) { 551 + return_ACPI_STATUS(AE_NO_MEMORY); 552 + } 553 + 554 + package_elements = package_object->package.elements; 565 555 566 556 /* 567 - * Free space begins right after the first package 557 + * Recursive implementation. Probably ok, since nested external packages 558 + * as parameters should be very rare. 568 559 */ 569 - free_space = buffer + sizeof(union acpi_object); 560 + for (i = 0; i < external_object->package.count; i++) { 561 + status = 562 + acpi_ut_copy_eobject_to_iobject(&external_object->package. 563 + elements[i], 564 + &package_elements[i]); 565 + if (ACPI_FAILURE(status)) { 570 566 571 - external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); 572 - external_object->package.count = internal_object->package.count; 573 - external_object->package.elements = (union acpi_object *)free_space; 567 + /* Truncate package and delete it */ 574 568 575 - /* 576 - * Build an array of ACPI_OBJECTS in the buffer 577 - * and move the free space past it 578 - */ 579 - free_space += 580 - external_object->package.count * sizeof(union acpi_object); 569 + package_object->package.count = i; 570 + package_elements[i] = NULL; 571 + acpi_ut_remove_reference(package_object); 572 + return_ACPI_STATUS(status); 573 + } 574 + } 581 575 582 - /* Call walk_package */ 583 - 576 + *internal_object = package_object; 577 + return_ACPI_STATUS(status); 584 578 } 585 - 586 - #endif /* Future implementation */ 587 579 588 580 /******************************************************************************* 589 581 * 590 582 * FUNCTION: acpi_ut_copy_eobject_to_iobject 591 583 * 592 - * PARAMETERS: *internal_object - The external object to be converted 593 - * *buffer_ptr - Where the internal object is returned 584 + * PARAMETERS: external_object - The external object to be converted 585 + * internal_object - Where the internal object is returned 594 586 * 595 - * RETURN: Status - the status of the call 587 + * RETURN: Status - the status of the call 596 588 * 597 589 * DESCRIPTION: Converts an external object to an internal object. 598 590 * ··· 603 603 ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject); 604 604 605 605 if (external_object->type == ACPI_TYPE_PACKAGE) { 606 - /* 607 - * Packages as external input to control methods are not supported, 608 - */ 609 - ACPI_ERROR((AE_INFO, 610 - "Packages as parameters not implemented!")); 611 - 612 - return_ACPI_STATUS(AE_NOT_IMPLEMENTED); 613 - } 614 - 615 - else { 606 + status = 607 + acpi_ut_copy_epackage_to_ipackage(external_object, 608 + internal_object); 609 + } else { 616 610 /* 617 611 * Build a simple object (no nested objects) 618 612 */ ··· 797 803 * Create and build the package object 798 804 */ 799 805 target_object = 800 - acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); 806 + acpi_ut_create_package_object(source_object->package.count); 801 807 if (!target_object) { 802 808 return (AE_NO_MEMORY); 803 809 } 804 810 805 - target_object->package.count = source_object->package.count; 806 811 target_object->common.flags = source_object->common.flags; 807 812 808 - /* 809 - * Create the object array 810 - */ 811 - target_object->package.elements = 812 - ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package. 813 - count + 1) * sizeof(void *)); 814 - if (!target_object->package.elements) { 815 - status = AE_NO_MEMORY; 816 - goto error_exit; 817 - } 813 + /* Pass the new package object back to the package walk routine */ 818 814 819 - /* 820 - * Pass the new package object back to the package walk routine 821 - */ 822 815 state->pkg.this_target_obj = target_object; 823 816 824 - /* 825 - * Store the object pointer in the parent package object 826 - */ 817 + /* Store the object pointer in the parent package object */ 818 + 827 819 *this_target_ptr = target_object; 828 820 break; 829 821
+42
drivers/acpi/utilities/utobject.c
··· 146 146 147 147 /******************************************************************************* 148 148 * 149 + * FUNCTION: acpi_ut_create_package_object 150 + * 151 + * PARAMETERS: Count - Number of package elements 152 + * 153 + * RETURN: Pointer to a new Package object, null on failure 154 + * 155 + * DESCRIPTION: Create a fully initialized package object 156 + * 157 + ******************************************************************************/ 158 + 159 + union acpi_operand_object *acpi_ut_create_package_object(u32 count) 160 + { 161 + union acpi_operand_object *package_desc; 162 + union acpi_operand_object **package_elements; 163 + 164 + ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count); 165 + 166 + /* Create a new Package object */ 167 + 168 + package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); 169 + if (!package_desc) { 170 + return_PTR(NULL); 171 + } 172 + 173 + /* 174 + * Create the element array. Count+1 allows the array to be null 175 + * terminated. 176 + */ 177 + package_elements = ACPI_ALLOCATE_ZEROED((acpi_size) 178 + (count + 1) * sizeof(void *)); 179 + if (!package_elements) { 180 + ACPI_FREE(package_desc); 181 + return_PTR(NULL); 182 + } 183 + 184 + package_desc->package.count = count; 185 + package_desc->package.elements = package_elements; 186 + return_PTR(package_desc); 187 + } 188 + 189 + /******************************************************************************* 190 + * 149 191 * FUNCTION: acpi_ut_create_buffer_object 150 192 * 151 193 * PARAMETERS: buffer_size - Size of buffer to be created
+7 -10
drivers/misc/thinkpad_acpi.c
··· 740 740 } 741 741 742 742 static struct device_attribute dev_attr_hotkey_enable = 743 - __ATTR(enable, S_IWUSR | S_IRUGO, 743 + __ATTR(hotkey_enable, S_IWUSR | S_IRUGO, 744 744 hotkey_enable_show, hotkey_enable_store); 745 745 746 746 /* sysfs hotkey mask --------------------------------------------------- */ ··· 775 775 } 776 776 777 777 static struct device_attribute dev_attr_hotkey_mask = 778 - __ATTR(mask, S_IWUSR | S_IRUGO, 778 + __ATTR(hotkey_mask, S_IWUSR | S_IRUGO, 779 779 hotkey_mask_show, hotkey_mask_store); 780 780 781 781 /* sysfs hotkey bios_enabled ------------------------------------------- */ ··· 787 787 } 788 788 789 789 static struct device_attribute dev_attr_hotkey_bios_enabled = 790 - __ATTR(bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); 790 + __ATTR(hotkey_bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); 791 791 792 792 /* sysfs hotkey bios_mask ---------------------------------------------- */ 793 793 static ssize_t hotkey_bios_mask_show(struct device *dev, ··· 798 798 } 799 799 800 800 static struct device_attribute dev_attr_hotkey_bios_mask = 801 - __ATTR(bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); 801 + __ATTR(hotkey_bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); 802 802 803 803 /* --------------------------------------------------------------------- */ 804 804 ··· 824 824 str_supported(tp_features.hotkey)); 825 825 826 826 if (tp_features.hotkey) { 827 - hotkey_dev_attributes = create_attr_set(4, 828 - TPACPI_HOTKEY_SYSFS_GROUP); 827 + hotkey_dev_attributes = create_attr_set(4, NULL); 829 828 if (!hotkey_dev_attributes) 830 829 return -ENOMEM; 831 830 res = add_to_attr_set(hotkey_dev_attributes, ··· 1049 1050 } 1050 1051 1051 1052 static struct device_attribute dev_attr_bluetooth_enable = 1052 - __ATTR(enable, S_IWUSR | S_IRUGO, 1053 + __ATTR(bluetooth_enable, S_IWUSR | S_IRUGO, 1053 1054 bluetooth_enable_show, bluetooth_enable_store); 1054 1055 1055 1056 /* --------------------------------------------------------------------- */ ··· 1060 1061 }; 1061 1062 1062 1063 static const struct attribute_group bluetooth_attr_group = { 1063 - .name = TPACPI_BLUETH_SYSFS_GROUP, 1064 1064 .attrs = bluetooth_attributes, 1065 1065 }; 1066 1066 ··· 1213 1215 } 1214 1216 1215 1217 static struct device_attribute dev_attr_wan_enable = 1216 - __ATTR(enable, S_IWUSR | S_IRUGO, 1218 + __ATTR(wwan_enable, S_IWUSR | S_IRUGO, 1217 1219 wan_enable_show, wan_enable_store); 1218 1220 1219 1221 /* --------------------------------------------------------------------- */ ··· 1224 1226 }; 1225 1227 1226 1228 static const struct attribute_group wan_attr_group = { 1227 - .name = TPACPI_WAN_SYSFS_GROUP, 1228 1229 .attrs = wan_attributes, 1229 1230 }; 1230 1231
-6
drivers/misc/thinkpad_acpi.h
··· 278 278 * Bluetooth subdriver 279 279 */ 280 280 281 - #define TPACPI_BLUETH_SYSFS_GROUP "bluetooth" 282 - 283 281 enum { 284 282 /* ACPI GBDC/SBDC bits */ 285 283 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ ··· 414 416 * Hotkey subdriver 415 417 */ 416 418 417 - #define TPACPI_HOTKEY_SYSFS_GROUP "hotkey" 418 - 419 419 static int hotkey_orig_status; 420 420 static int hotkey_orig_mask; 421 421 ··· 548 552 /* 549 553 * Wan subdriver 550 554 */ 551 - 552 - #define TPACPI_WAN_SYSFS_GROUP "wwan" 553 555 554 556 enum { 555 557 /* ACPI GWAN/SWAN bits */
+1 -1
include/acpi/acpi_numa.h
··· 13 13 14 14 extern int pxm_to_node(int); 15 15 extern int node_to_pxm(int); 16 - extern int __cpuinit acpi_map_pxm_to_node(int); 16 + extern int acpi_map_pxm_to_node(int); 17 17 extern void __cpuinit acpi_unmap_pxm_to_node(int); 18 18 19 19 #endif /* CONFIG_ACPI_NUMA */
+2
include/acpi/acutils.h
··· 390 390 391 391 u8 acpi_ut_valid_internal_object(void *object); 392 392 393 + union acpi_operand_object *acpi_ut_create_package_object(u32 count); 394 + 393 395 union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); 394 396 395 397 union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);