|
@@ -167,7 +167,6 @@ static int acpi_system_sysfs_init(void)
|
|
#define COUNT_ERROR 2 /* other */
|
|
#define COUNT_ERROR 2 /* other */
|
|
#define NUM_COUNTERS_EXTRA 3
|
|
#define NUM_COUNTERS_EXTRA 3
|
|
|
|
|
|
-#define ACPI_EVENT_VALID 0x01
|
|
|
|
struct event_counter {
|
|
struct event_counter {
|
|
u32 count;
|
|
u32 count;
|
|
u32 flags;
|
|
u32 flags;
|
|
@@ -312,12 +311,6 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
|
|
} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
|
|
} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
|
|
result = acpi_get_event_status(index - num_gpes, status);
|
|
result = acpi_get_event_status(index - num_gpes, status);
|
|
|
|
|
|
- /*
|
|
|
|
- * sleep/power button GPE/Fixed Event is enabled after acpi_system_init,
|
|
|
|
- * check the status at runtime and mark it as valid once it's enabled
|
|
|
|
- */
|
|
|
|
- if (!result && (*status & ACPI_EVENT_FLAG_ENABLED))
|
|
|
|
- all_counters[index].flags |= ACPI_EVENT_VALID;
|
|
|
|
end:
|
|
end:
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -346,12 +339,14 @@ static ssize_t counter_show(struct kobject *kobj,
|
|
if (result)
|
|
if (result)
|
|
goto end;
|
|
goto end;
|
|
|
|
|
|
- if (!(all_counters[index].flags & ACPI_EVENT_VALID))
|
|
|
|
- size += sprintf(buf + size, " invalid");
|
|
|
|
|
|
+ if (!(status & ACPI_EVENT_FLAG_HANDLE))
|
|
|
|
+ size += sprintf(buf + size, " invalid");
|
|
else if (status & ACPI_EVENT_FLAG_ENABLED)
|
|
else if (status & ACPI_EVENT_FLAG_ENABLED)
|
|
- size += sprintf(buf + size, " enable");
|
|
|
|
|
|
+ size += sprintf(buf + size, " enabled");
|
|
|
|
+ else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED)
|
|
|
|
+ size += sprintf(buf + size, " wake_enabled");
|
|
else
|
|
else
|
|
- size += sprintf(buf + size, " disable");
|
|
|
|
|
|
+ size += sprintf(buf + size, " disabled");
|
|
|
|
|
|
end:
|
|
end:
|
|
size += sprintf(buf + size, "\n");
|
|
size += sprintf(buf + size, "\n");
|
|
@@ -385,7 +380,7 @@ static ssize_t counter_set(struct kobject *kobj,
|
|
if (result)
|
|
if (result)
|
|
goto end;
|
|
goto end;
|
|
|
|
|
|
- if (!(all_counters[index].flags & ACPI_EVENT_VALID)) {
|
|
|
|
|
|
+ if (!(status & ACPI_EVENT_FLAG_HANDLE)) {
|
|
printk(KERN_WARNING PREFIX
|
|
printk(KERN_WARNING PREFIX
|
|
"Can not change Invalid GPE/Fixed Event status\n");
|
|
"Can not change Invalid GPE/Fixed Event status\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|