···5959If the userspace hasn't been prepared to ignore the unreliable "opened"6060events and the unreliable initial state notification, Linux users can use6161the following kernel parameters to handle the possible issues:6262-A. button.lid_init_state=open:6262+A. button.lid_init_state=method:6363+ When this option is specified, the ACPI button driver reports the6464+ initial lid state using the returning value of the _LID control method6565+ and whether the "opened"/"closed" events are paired fully relies on the6666+ firmware implementation.6767+ This option can be used to fix some platforms where the returning value6868+ of the _LID control method is reliable but the initial lid state6969+ notification is missing.7070+ This option is the default behavior during the period the userspace7171+ isn't ready to handle the buggy AML tables.7272+B. button.lid_init_state=open:6373 When this option is specified, the ACPI button driver always reports the6474 initial lid state as "opened" and whether the "opened"/"closed" events6575 are paired fully relies on the firmware implementation.6676 This may fix some platforms where the returning value of the _LID6777 control method is not reliable and the initial lid state notification is6878 missing.6969- This option is the default behavior during the period the userspace7070- isn't ready to handle the buggy AML tables.71797280If the userspace has been prepared to ignore the unreliable "opened" events7381and the unreliable initial state notification, Linux users should always7482use the following kernel parameter:7575-B. button.lid_init_state=ignore:8383+C. button.lid_init_state=ignore:7684 When this option is specified, the ACPI button driver never reports the7785 initial lid state and there is a compensation mechanism implemented to7886 ensure that the reliable "closed" notifications can always be delievered
+9
drivers/acpi/button.c
···57575858#define ACPI_BUTTON_LID_INIT_IGNORE 0x005959#define ACPI_BUTTON_LID_INIT_OPEN 0x016060+#define ACPI_BUTTON_LID_INIT_METHOD 0x0260616162#define _COMPONENT ACPI_BUTTON_COMPONENT6263ACPI_MODULE_NAME("button");···377376 case ACPI_BUTTON_LID_INIT_OPEN:378377 (void)acpi_lid_notify_state(device, 1);379378 break;379379+ case ACPI_BUTTON_LID_INIT_METHOD:380380+ (void)acpi_lid_update_state(device);381381+ break;380382 case ACPI_BUTTON_LID_INIT_IGNORE:381383 default:382384 break;···564560 if (!strncmp(val, "open", sizeof("open") - 1)) {565561 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;566562 pr_info("Notify initial lid state as open\n");563563+ } else if (!strncmp(val, "method", sizeof("method") - 1)) {564564+ lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;565565+ pr_info("Notify initial lid state with _LID return value\n");567566 } else if (!strncmp(val, "ignore", sizeof("ignore") - 1)) {568567 lid_init_state = ACPI_BUTTON_LID_INIT_IGNORE;569568 pr_info("Do not notify initial lid state\n");···580573 switch (lid_init_state) {581574 case ACPI_BUTTON_LID_INIT_OPEN:582575 return sprintf(buffer, "open");576576+ case ACPI_BUTTON_LID_INIT_METHOD:577577+ return sprintf(buffer, "method");583578 case ACPI_BUTTON_LID_INIT_IGNORE:584579 return sprintf(buffer, "ignore");585580 default: