- Update to 3.3-rc2.
[linux-flexiantxendom0-3.2.10.git] / arch / x86 / kernel / apm_32.c
index f76623c..69c8841 100644 (file)
@@ -373,10 +373,12 @@ static struct {
        unsigned long   offset;
        unsigned short  segment;
 } apm_bios_entry;
+#ifdef CONFIG_APM_CPU_IDLE
 static int clock_slowed;
 static int idle_threshold __read_mostly = DEFAULT_IDLE_THRESHOLD;
 static int idle_period __read_mostly = DEFAULT_IDLE_PERIOD;
 static int set_pm_idle;
+#endif
 static int suspends_pending;
 static int standbys_pending;
 static int ignore_sys_suspend;
@@ -805,6 +807,7 @@ static int set_system_power_state(u_short state)
        return set_power_state(APM_DEVICE_ALL, state);
 }
 
+#ifdef CONFIG_APM_CPU_IDLE
 /**
  *     apm_do_idle     -       perform power saving
  *
@@ -964,6 +967,7 @@ recalc:
 
        local_irq_enable();
 }
+#endif
 
 /**
  *     apm_power_off   -       ask the BIOS to power off
@@ -1873,12 +1877,14 @@ static int __init apm_setup(char *str)
                if ((strncmp(str, "bounce-interval=", 16) == 0) ||
                    (strncmp(str, "bounce_interval=", 16) == 0))
                        bounce_interval = simple_strtol(str + 16, NULL, 0);
+#ifdef CONFIG_APM_CPU_IDLE
                if ((strncmp(str, "idle-threshold=", 15) == 0) ||
                    (strncmp(str, "idle_threshold=", 15) == 0))
                        idle_threshold = simple_strtol(str + 15, NULL, 0);
                if ((strncmp(str, "idle-period=", 12) == 0) ||
                    (strncmp(str, "idle_period=", 12) == 0))
                        idle_period = simple_strtol(str + 12, NULL, 0);
+#endif
                invert = (strncmp(str, "no-", 3) == 0) ||
                        (strncmp(str, "no_", 3) == 0);
                if (invert)
@@ -2381,6 +2387,7 @@ static int __init apm_init(void)
        if (misc_register(&apm_device))
                printk(KERN_WARNING "apm: Could not register misc device.\n");
 
+#ifdef CONFIG_APM_CPU_IDLE
        if (HZ != 100)
                idle_period = (idle_period * HZ) / 100;
        if (idle_threshold < 100) {
@@ -2388,6 +2395,7 @@ static int __init apm_init(void)
                pm_idle  = apm_cpu_idle;
                set_pm_idle = 1;
        }
+#endif
 
        return 0;
 }
@@ -2396,6 +2404,7 @@ static void __exit apm_exit(void)
 {
        int error;
 
+#ifdef CONFIG_APM_CPU_IDLE
        if (set_pm_idle) {
                pm_idle = original_pm_idle;
                /*
@@ -2405,6 +2414,7 @@ static void __exit apm_exit(void)
                 */
                cpu_idle_wait();
        }
+#endif
        if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0)
            && (apm_info.connection_version > 0x0100)) {
                error = apm_engage_power_management(APM_DEVICE_ALL, 0);
@@ -2441,12 +2451,14 @@ MODULE_PARM_DESC(broken_psr, "BIOS has a broken GetPowerStatus call");
 module_param(realmode_power_off, bool, 0444);
 MODULE_PARM_DESC(realmode_power_off,
                "Switch to real mode before powering off");
+#ifdef CONFIG_APM_CPU_IDLE
 module_param(idle_threshold, int, 0444);
 MODULE_PARM_DESC(idle_threshold,
        "System idle percentage above which to make APM BIOS idle calls");
 module_param(idle_period, int, 0444);
 MODULE_PARM_DESC(idle_period,
        "Period (in sec/100) over which to caculate the idle percentage");
+#endif
 module_param(smp, bool, 0444);
 MODULE_PARM_DESC(smp,
        "Set this to enable APM use on an SMP platform. Use with caution on older systems");