Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'acpi-button' and 'acpi-tools'

* acpi-button:
Revert "ACPI / button: Remove lid_init_state=method mode"

* acpi-tools:
tools/power/acpi: Add .gitignore file

+25 -4
+12 -4
Documentation/acpi/acpi-lid.txt
··· 59 59 If the userspace hasn't been prepared to ignore the unreliable "opened" 60 60 events and the unreliable initial state notification, Linux users can use 61 61 the following kernel parameters to handle the possible issues: 62 - A. button.lid_init_state=open: 62 + A. button.lid_init_state=method: 63 + When this option is specified, the ACPI button driver reports the 64 + initial lid state using the returning value of the _LID control method 65 + and whether the "opened"/"closed" events are paired fully relies on the 66 + firmware implementation. 67 + This option can be used to fix some platforms where the returning value 68 + of the _LID control method is reliable but the initial lid state 69 + notification is missing. 70 + This option is the default behavior during the period the userspace 71 + isn't ready to handle the buggy AML tables. 72 + B. button.lid_init_state=open: 63 73 When this option is specified, the ACPI button driver always reports the 64 74 initial lid state as "opened" and whether the "opened"/"closed" events 65 75 are paired fully relies on the firmware implementation. 66 76 This may fix some platforms where the returning value of the _LID 67 77 control method is not reliable and the initial lid state notification is 68 78 missing. 69 - This option is the default behavior during the period the userspace 70 - isn't ready to handle the buggy AML tables. 71 79 72 80 If the userspace has been prepared to ignore the unreliable "opened" events 73 81 and the unreliable initial state notification, Linux users should always 74 82 use the following kernel parameter: 75 - B. button.lid_init_state=ignore: 83 + C. button.lid_init_state=ignore: 76 84 When this option is specified, the ACPI button driver never reports the 77 85 initial lid state and there is a compensation mechanism implemented to 78 86 ensure that the reliable "closed" notifications can always be delievered
+9
drivers/acpi/button.c
··· 57 57 58 58 #define ACPI_BUTTON_LID_INIT_IGNORE 0x00 59 59 #define ACPI_BUTTON_LID_INIT_OPEN 0x01 60 + #define ACPI_BUTTON_LID_INIT_METHOD 0x02 60 61 61 62 #define _COMPONENT ACPI_BUTTON_COMPONENT 62 63 ACPI_MODULE_NAME("button"); ··· 377 376 case ACPI_BUTTON_LID_INIT_OPEN: 378 377 (void)acpi_lid_notify_state(device, 1); 379 378 break; 379 + case ACPI_BUTTON_LID_INIT_METHOD: 380 + (void)acpi_lid_update_state(device); 381 + break; 380 382 case ACPI_BUTTON_LID_INIT_IGNORE: 381 383 default: 382 384 break; ··· 564 560 if (!strncmp(val, "open", sizeof("open") - 1)) { 565 561 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN; 566 562 pr_info("Notify initial lid state as open\n"); 563 + } else if (!strncmp(val, "method", sizeof("method") - 1)) { 564 + lid_init_state = ACPI_BUTTON_LID_INIT_METHOD; 565 + pr_info("Notify initial lid state with _LID return value\n"); 567 566 } else if (!strncmp(val, "ignore", sizeof("ignore") - 1)) { 568 567 lid_init_state = ACPI_BUTTON_LID_INIT_IGNORE; 569 568 pr_info("Do not notify initial lid state\n"); ··· 580 573 switch (lid_init_state) { 581 574 case ACPI_BUTTON_LID_INIT_OPEN: 582 575 return sprintf(buffer, "open"); 576 + case ACPI_BUTTON_LID_INIT_METHOD: 577 + return sprintf(buffer, "method"); 583 578 case ACPI_BUTTON_LID_INIT_IGNORE: 584 579 return sprintf(buffer, "ignore"); 585 580 default:
+4
tools/power/acpi/.gitignore
··· 1 + acpidbg 2 + acpidump 3 + ec 4 + include