From e60cc7a6f02598fc23c68a656fe9c263d6531ca0 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 13 Mar 2009 12:08:26 -0600 Subject: ACPI: move private declarations to internal.h A number of things that shouldn't be exposed outside the ACPI core were declared in include/acpi/acpi_drivers.h, where anybody can see them. This patch moves those declarations to a new "internal.h" inside drivers/acpi. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 765fd1c56cd6..2e90410a3035 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -39,6 +39,8 @@ #include #include +#include "internal.h" + #define _COMPONENT ACPI_BUS_COMPONENT ACPI_MODULE_NAME("bus"); -- cgit v1.2.3 From 81d0273df20edff275e2eefe6b50436af3bdf9e8 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:49:38 -0600 Subject: ACPI: skip DMI power state check when ACPI disabled This patch makes acpi_init() exit early when ACPI is disabled. This skips a DMI check that affects ACPI power management. The DMI check prints a notice that is misleading when ACPI is disabled. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 2e90410a3035..bdeed39c3d38 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -869,6 +869,10 @@ static int __init acpi_init(void) } } else disable_acpi(); + + if (acpi_disabled) + return result; + /* * If the laptop falls into the DMI check table, the power state check * will be disabled in the course of device power transistion. -- cgit v1.2.3 From e747f274951507b5a0850155c3d709e26d20de5b Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:49:43 -0600 Subject: ACPI: call acpi_scan_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_scan_init() directly. Previously, both acpi_init() and acpi_scan_init() were subsys_initcalls, and acpi_init() was called first based on the link order from the makefile (bus.o before scan.o). acpi_scan_init() registers the ACPI bus type, creates the root device, and enumerates fixed-feature and namespace devices. All of this must be done after acpi_init(), and it's better to call acpi_scan_init() explicitly rather than rely on the link ordering. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index bdeed39c3d38..cdd11fda5036 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -878,6 +878,8 @@ static int __init acpi_init(void) * will be disabled in the course of device power transistion. */ dmi_check_system(power_nocheck_dmi_table); + + acpi_scan_init(); return result; } -- cgit v1.2.3 From a5f820feb54a59fcdaf4a67a6381ea1ddb36cc6e Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:49:48 -0600 Subject: ACPI: call acpi_ec_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_ec_init() directly. Previously, both were subsys_initcalls. acpi_ec_init() must happen after acpi_init(), and it's better to call it explicitly rather than rely on link ordering. Signed-off-by: Bjorn Helgaas CC: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index cdd11fda5036..9ca683794370 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -880,6 +880,7 @@ static int __init acpi_init(void) dmi_check_system(power_nocheck_dmi_table); acpi_scan_init(); + acpi_ec_init(); return result; } -- cgit v1.2.3 From 44515374cba9e46d5622256b43eb06b9c349cee1 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:49:53 -0600 Subject: ACPI: call acpi_power_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_power_init() directly. Previously, both were subsys_initcalls. acpi_power_init() must happen after acpi_init(), and it's better to call it explicitly rather than rely on link ordering. Signed-off-by: Bjorn Helgaas CC: Zhao Yakui Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 9ca683794370..946610f00aa1 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -881,6 +881,7 @@ static int __init acpi_init(void) acpi_scan_init(); acpi_ec_init(); + acpi_power_init(); return result; } -- cgit v1.2.3 From 141a0af3cab7de690816b17aad1682050219f774 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:49:58 -0600 Subject: ACPI: call acpi_system_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_system_init() directly. Previously, both were subsys_initcalls. acpi_system_init() must happen after acpi_init(), and it's better to call it explicitly rather than rely on link ordering. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 946610f00aa1..c13307279f7e 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -882,6 +882,7 @@ static int __init acpi_init(void) acpi_scan_init(); acpi_ec_init(); acpi_power_init(); + acpi_system_init(); return result; } -- cgit v1.2.3 From 84f810c33f695e020776ce66c903e0b41872f1b2 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:50:03 -0600 Subject: ACPI: call acpi_debug_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_debug_init() directly. Previously, both were subsys_initcalls. acpi_debug_init() must happen after acpi_init(), and it's better to call it explicitly rather than rely on link ordering. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c13307279f7e..f32cfd64c999 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -883,6 +883,7 @@ static int __init acpi_init(void) acpi_ec_init(); acpi_power_init(); acpi_system_init(); + acpi_debug_init(); return result; } -- cgit v1.2.3 From 0e46517d9660ee6ae0a0c5d8a4e50451bc84d61d Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:50:09 -0600 Subject: ACPI: call init_acpi_device_notify() explicitly rather than as initcall This patch makes acpi_init() call init_acpi_device_notify() directly. Previously, init_acpi_device_notify() was an arch_initcall (sequence 3), so it was called before acpi_init() (a subsys_initcall at sequence 4). init_acpi_device_notify() sets the platform_notify and platform_notify_remove function pointers. These pointers are not used until acpi_init() enumerates ACPI devices in this path: acpi_init() acpi_scan_init() acpi_bus_scan() acpi_add_single_object() acpi_device_register() device_add() So it is sufficient to have acpi_init() call init_acpi_device_notify() directly before it enumerates devices. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f32cfd64c999..db9eca8d3cf2 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -855,6 +855,7 @@ static int __init acpi_init(void) acpi_kobj = NULL; } + init_acpi_device_notify(); result = acpi_bus_init(); if (!result) { -- cgit v1.2.3 From 9cee43e07940bee13462e63bd75ce4430b155886 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:50:14 -0600 Subject: ACPI: call acpi_sleep_proc_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_sleep_proc_init() directly. Previously, acpi_sleep_proc_init() was a late_initcall (sequence 7), apparently to make sure that the /proc hierarchy already exists: 2003/02/13 12:38:03-06:00 mochel acpi sleep: demote sleep proc file creation. - Make acpi_sleep_proc_init() a late_initcall(), and not called from acpi_sleep_init(). This guarantees that the acpi proc hierarchy is at least there when we create the dang file. This should no longer be an issue because acpi_bus_init() (called early in acpi_init()) creates acpi_root_dir (/proc/acpi). Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index db9eca8d3cf2..a812e841cb64 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -885,6 +885,7 @@ static int __init acpi_init(void) acpi_power_init(); acpi_system_init(); acpi_debug_init(); + acpi_sleep_proc_init(); return result; } -- cgit v1.2.3 From 201b8c655f7a48563f6a0b66f9e388460a1ea611 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 24 Mar 2009 16:50:19 -0600 Subject: ACPI: call acpi_wakeup_device_init() explicitly rather than as initcall This patch makes acpi_init() call acpi_wakeup_device_init() directly. Previously, acpi_wakeup_device_init() was a late_initcall (sequence 7). acpi_wakeup_device_init() depends on acpi_wakeup_device_list, which is populated when ACPI devices are enumerated by acpi_init() -> acpi_scan_init(). Using late_initcall is certainly enough to make sure acpi_wakeup_device_list is populated, but it is more than necessary. We can just as easily call acpi_wakeup_device_init() directly from acpi_init(), which avoids the initcall magic. Signed-off-by: Bjorn Helgaas CC: Li Shaohua Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index a812e841cb64..7fe0945f7bcf 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -886,6 +886,7 @@ static int __init acpi_init(void) acpi_system_init(); acpi_debug_init(); acpi_sleep_proc_init(); + acpi_wakeup_device_init(); return result; } -- cgit v1.2.3