aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sysfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 23:15:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 23:15:35 -0500
commit52cfd503ad7176d23a5dd7af3981744feb60622f (patch)
tree0a8aeaaf4acbc86ac682f18632b8070c1c6b7ba1 /drivers/acpi/sysfs.c
parentdc8e7e3ec60bd5ef7868aa88755e9d4c948dc5cc (diff)
parent4263d9a3ae4d15785897d0543bb59316c84ee605 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (59 commits) ACPI / PM: Fix build problems for !CONFIG_ACPI related to NVS rework ACPI: fix resource check message ACPI / Battery: Update information on info notification and resume ACPI: Drop device flag wake_capable ACPI: Always check if _PRW is present before trying to evaluate it ACPI / PM: Check status of power resources under mutexes ACPI / PM: Rename acpi_power_off_device() ACPI / PM: Drop acpi_power_nocheck ACPI / PM: Drop acpi_bus_get_power() Platform / x86: Make fujitsu_laptop use acpi_bus_update_power() ACPI / Fan: Rework the handling of power resources ACPI / PM: Register power resource devices as soon as they are needed ACPI / PM: Register acpi_power_driver early ACPI / PM: Add function for updating device power state consistently ACPI / PM: Add function for device power state initialization ACPI / PM: Introduce __acpi_bus_get_power() ACPI / PM: Introduce function for refcounting device power resources ACPI / PM: Add functions for manipulating lists of power resources ACPI / PM: Prevent acpi_power_get_inferred_state() from making changes ACPICA: Update version to 20101209 ...
Diffstat (limited to 'drivers/acpi/sysfs.c')
-rw-r--r--drivers/acpi/sysfs.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index f8588f81048a..61891e75583d 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -438,7 +438,7 @@ static void delete_gpe_attr_array(void)
438 return; 438 return;
439} 439}
440 440
441void acpi_os_gpe_count(u32 gpe_number) 441static void gpe_count(u32 gpe_number)
442{ 442{
443 acpi_gpe_count++; 443 acpi_gpe_count++;
444 444
@@ -454,7 +454,7 @@ void acpi_os_gpe_count(u32 gpe_number)
454 return; 454 return;
455} 455}
456 456
457void acpi_os_fixed_event_count(u32 event_number) 457static void fixed_event_count(u32 event_number)
458{ 458{
459 if (!all_counters) 459 if (!all_counters)
460 return; 460 return;
@@ -468,6 +468,16 @@ void acpi_os_fixed_event_count(u32 event_number)
468 return; 468 return;
469} 469}
470 470
471static void acpi_gbl_event_handler(u32 event_type, acpi_handle device,
472 u32 event_number, void *context)
473{
474 if (event_type == ACPI_EVENT_TYPE_GPE)
475 gpe_count(event_number);
476
477 if (event_type == ACPI_EVENT_TYPE_FIXED)
478 fixed_event_count(event_number);
479}
480
471static int get_status(u32 index, acpi_event_status *status, 481static int get_status(u32 index, acpi_event_status *status,
472 acpi_handle *handle) 482 acpi_handle *handle)
473{ 483{
@@ -601,6 +611,7 @@ end:
601 611
602void acpi_irq_stats_init(void) 612void acpi_irq_stats_init(void)
603{ 613{
614 acpi_status status;
604 int i; 615 int i;
605 616
606 if (all_counters) 617 if (all_counters)
@@ -619,6 +630,10 @@ void acpi_irq_stats_init(void)
619 if (all_counters == NULL) 630 if (all_counters == NULL)
620 goto fail; 631 goto fail;
621 632
633 status = acpi_install_global_event_handler(acpi_gbl_event_handler, NULL);
634 if (ACPI_FAILURE(status))
635 goto fail;
636
622 counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters), 637 counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters),
623 GFP_KERNEL); 638 GFP_KERNEL);
624 if (counter_attrs == NULL) 639 if (counter_attrs == NULL)