[PATCH] allow acpi to be turned off at boot

Peter T. Breuer (ptb@it.uc3m.es)
Mon, 21 May 2001 14:23:45 +0200 (MET DST)


ACPI seemed a fine thing until I found that it doesn't allow for
hibernation or suspension of my laptop, and there is no way
(apparently) to turn it off at boot and let APM take over. Here's
a patch to allow "acpi=off" at boot. There's room for more parsing
in the code.

I didn't notice the problem until ACPI actually started working :-) for
my laptop (tosh portege) in recent kernels. Previously I'd always
compiled it in anyway, but it never loaded itself.

Have this until the code gets modularized.

Peter

--- linux-2.4.4/drivers/acpi/driver.c.pre-ptb Sat May 19 21:00:00 2001
+++ linux-2.4.4/drivers/acpi/driver.c Mon May 21 14:15:02 2001
@@ -24,6 +24,8 @@
* - Fix interruptible_sleep_on() races
* Andrew Grover <andrew.grover@intel.com> 2001-2-28
* - Major revamping
+ * Peter Breuer <ptb@it.uc3m.es> 2001-5-20
+ * - parse boot time params.
*/

#include <linux/config.h>
@@ -59,6 +61,23 @@

FADT_DESCRIPTOR acpi_fadt;

+static int acpi_disabled;
+#ifndef MODULE
+static int __init acpi_setup(char *str) {
+ while (str && *str) {
+ if (strncmp(str, "off", 3) == 0)
+ acpi_disabled = 1;
+ str = strchr(str, ',');
+ if (str)
+ str += strspn(str, ", \t");
+ }
+ return 1;
+}
+
+__setup("acpi=", acpi_setup);
+#endif
+
+
/*
* Start the interpreter
*/
@@ -73,6 +92,11 @@
printk(KERN_NOTICE "ACPI: APM is already active, exiting\n");
return -ENODEV;
}
+
+ if (acpi_disabled) {
+ printk(KERN_NOTICE "ACPI: disabled on user request.\n");
+ return -ENODEV;
+ }

if (!ACPI_SUCCESS(acpi_initialize_subsystem())) {
printk(KERN_ERR "ACPI: Driver initialization failed\n");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/