#define ACPI_BUTTON_LID_INIT_IGNORE 0x00
#define ACPI_BUTTON_LID_INIT_OPEN 0x01
++#define ACPI_BUTTON_LID_INIT_METHOD 0x02
#define _COMPONENT ACPI_BUTTON_COMPONENT
ACPI_MODULE_NAME("button");
static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);
static struct acpi_device *lid_device;
- --static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
+ ++static u8 lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
static unsigned long lid_report_interval __read_mostly = 500;
module_param(lid_report_interval, ulong, 0644);
}
if (state)
--- pm_wakeup_event(&device->dev, 0);
+++ pm_wakeup_hard_event(&device->dev);
ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);
if (ret == NOTIFY_DONE)
case ACPI_BUTTON_LID_INIT_OPEN:
(void)acpi_lid_notify_state(device, 1);
break;
++ case ACPI_BUTTON_LID_INIT_METHOD:
++ (void)acpi_lid_update_state(device);
++ break;
case ACPI_BUTTON_LID_INIT_IGNORE:
default:
break;
} else {
int keycode;
--- pm_wakeup_event(&device->dev, 0);
+++ pm_wakeup_hard_event(&device->dev);
if (button->suspended)
break;
lid_device = device;
}
+++ device_init_wakeup(&device->dev, true);
printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
return 0;
if (!strncmp(val, "open", sizeof("open") - 1)) {
lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
pr_info("Notify initial lid state as open\n");
++ } else if (!strncmp(val, "method", sizeof("method") - 1)) {
++ lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
++ pr_info("Notify initial lid state with _LID return value\n");
} else if (!strncmp(val, "ignore", sizeof("ignore") - 1)) {
lid_init_state = ACPI_BUTTON_LID_INIT_IGNORE;
pr_info("Do not notify initial lid state\n");
switch (lid_init_state) {
case ACPI_BUTTON_LID_INIT_OPEN:
return sprintf(buffer, "open");
++ case ACPI_BUTTON_LID_INIT_METHOD:
++ return sprintf(buffer, "method");
case ACPI_BUTTON_LID_INIT_IGNORE:
return sprintf(buffer, "ignore");
default:
container_of(bin_attr, struct acpi_table_attr, attr);
struct acpi_table_header *table_header = NULL;
acpi_status status;
+++ ssize_t rc;
status = acpi_get_table(table_attr->name, table_attr->instance,
&table_header);
if (ACPI_FAILURE(status))
return -ENODEV;
--- return memory_read_from_buffer(buf, count, &offset,
--- table_header, table_header->length);
+++ rc = memory_read_from_buffer(buf, count, &offset, table_header,
+++ table_header->length);
+++ acpi_put_table(table_header);
+++ return rc;
}
static int acpi_table_attr_init(struct kobject *tables_obj,
static ssize_t force_remove_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
--- return sprintf(buf, "%d\n", !!acpi_force_hot_remove);
+++ return sprintf(buf, "%d\n", 0);
}
static ssize_t force_remove_store(struct kobject *kobj,
if (ret < 0)
return ret;
--- lock_device_hotplug();
--- acpi_force_hot_remove = val;
--- unlock_device_hotplug();
+++ if (val) {
+++ pr_err("Enabling force_remove is not supported anymore. Please report to linux-acpi@vger.kernel.org if you depend on this functionality\n");
+++ return -EINVAL;
+++ }
return size;
}