Lines Matching full:apm
3 * APM BIOS driver for Linux
13 * Make /proc/apm easy to format (bump driver version)
15 * Prohibit APM BIOS calls unless apm_enabled.
38 * 0.7: changed /proc/apm format, Linux 1.3.58
41 * 1.0: use fixed device number, consolidate /proc/apm into this file,
50 * levels to the printk calls. APM is not defined for SMP machines.
54 * 1.4: Upgraded to support APM 1.2. Integrated ThinkPad suspend patch by
62 * Fix OOPS at power off with no APM BIOS by Jan Echternach
66 * to reflect current state of APM BIOS.
72 * Allow boot time disabling of APM
94 * Remove APM dependencies in arch/i386/kernel/process.c
95 * Remove APM dependencies in drivers/char/sysrq.c
102 * 1.11: Remove APM dependencies in drivers/char/console.c
121 * "apm=power-off" on the kernel command line. Suggested
124 * Register the /proc/apm entry even on SMP so that
154 * broken APM (Alan Cox <alan@lxorguk.ukuu.org.uk>).
157 * If an APM idle fails log it and idle sensibly
171 * Change name of kernel apm daemon (as it no longer idles) (sfr).
173 * make _all_ APM calls on the CPU#0. Fix unsafe sign bug.
176 * APM 1.1 Reference:
179 * (APM) BIOS Interface Specification, Revision 1.1, September 1993.
187 * APM 1.2 Reference:
189 * (APM) BIOS Interface Specification, Revision 1.2, February 1996.
195 #define pr_fmt(fmt) "apm: " fmt
250 * apm=on/off enable/disable APM
257 * [no-]smp Use apm even on an SMP box
261 * make APM BIOS idle calls. Set it to
270 * U: TI 4000M TravelMate: BIOS is *NOT* APM compliant
272 * ?: ACER 486DX4/75: uses dseg 0040, in violation of APM specification
278 * ?: AcerNote-950: oops on reading /proc/apm - workaround is a WIP
281 * Legend: U = unusable with APM patches
282 * P = partially usable with APM patches
286 * Define as 1 to make the driver always call the APM BIOS busy
293 * Define to make the APM BIOS calls zero all data segment registers (so
299 #include <asm/apm.h>
315 * Need to poll the APM BIOS every second
330 * The per-file APM data
372 { /* entry 1 is for APM idle */
373 .name = "APM",
374 .desc = "APM idle",
437 * APM event names taken from the APM 1.2 specification. These are
483 { APM_NOT_PRESENT, "No APM present" }
488 * apm_error - display an APM error
490 * @err: APM BIOS return code
493 * an APM error. Note that this also handles (negative) kernel errors.
581 * __apm_bios_call - Make an APM BIOS 32bit call
584 * Make an APM call using the 32bit protected mode interface. The
585 * caller is responsible for knowing if APM BIOS is configured and
652 * apm_bios_call - Make an APM BIOS 32bit call (on CPU 0)
663 * __apm_bios_call_simple - Make an APM BIOS 32bit call (on CPU 0)
707 * apm_bios_call_simple - make a simple APM BIOS 32bit call
708 * @func: APM function to invoke
737 * apm_driver_version - APM driver version
738 * @val: loaded with the APM version on return
740 * Retrieve the APM version supported by the BIOS. This is only
741 * supported for APM 1.1 or higher. An error indicates APM 1.0 is
744 * On entry val should point to a value indicating the APM driver
764 * apm_get_event - get an APM event from the BIOS
768 * The APM BIOS provides a polled information for event
776 * that APM 1.2 is in use. If no messages are pending the value 0x80
802 * Request an APM change of state for one or more system devices. The
825 * Transition the entire system into a new APM power state.
900 * apm_cpu_idle - cpu idling for APM capable Linux
902 * This is the idling function the kernel executes when APM is available. It
982 * bugs we support real mode APM BIOS power off calls. We also make
1001 * apm_enable_power_management - enable BIOS APM power management
1004 * Enable or disable the APM BIOS power services.
1031 * Obtain the current power status from the APM BIOS. We return a
1336 printk(KERN_DEBUG "apm: received %s notify\n", in check_events()
1339 printk(KERN_DEBUG "apm: received unknown " in check_events()
1426 printk(KERN_DEBUG "apm: setting state busy\n"); in apm_event_handler()
1437 * This is the APM thread main loop.
1674 1) APM BIOS Version. Usually 1.0, 1.1 or 1.2. in proc_apm_show()
1675 2) APM flags from APM Installation Check (0x00): in proc_apm_show()
1723 static int apm(void *unused) in apm() function
1734 * on SMP systems in case of "apm=power-off" mode. Seen on ASUS A7M266D. in apm()
1752 /* Fall back to an APM 1.0 connection. */ in apm()
1759 printk(KERN_INFO "apm: Connection version %d.%d\n", in apm()
1790 printk(KERN_INFO "apm: power status not available\n"); in apm()
1824 "apm: AC %s, battery status %s, battery life ", in apm()
1832 "apm: battery flag 0x%02x, battery life ", in apm()
1909 __setup("apm=", apm_setup);
1958 /* Some laptops require interrupts to be enabled during APM calls */
1964 "Enabling interrupts during APM calls.\n", d->ident); in set_apm_ints()
1969 /* Some APM bioses corrupt memory or just plain do not work */
1975 "Disabling APM.\n", d->ident); in apm_is_horked()
1985 "Disabling APM.\n", d->ident); in apm_is_horked_d850md()
1992 /* Some APM bioses hang on APM idle calls */
1998 "Disabling APM idle calls.\n", d->ident); in apm_likes_to_melt()
2021 printk(KERN_WARNING "BIOS strings suggest APM bugs, " in broken_apm_power()
2027 * This bios swaps the APM minute reporting bytes over (Many sony laptops
2033 printk(KERN_WARNING "BIOS strings suggest APM reports battery life " in swab_apm_power_in_minutes()
2041 KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",
2045 { /* Handle problems with APM on the C600 */
2055 { /* APM crashes */
2067 { /* Handle problems with APM on Inspiron 5000e */
2073 { /* Handle problems with APM on Inspiron 2500 */
2079 { /* APM crashes */
2093 { /* Allow interrupts during APM or the clock goes slow */
2098 { /* APM blows on shutdown */
2103 { /* APM crashes */
2108 { /* APM crashes */
2113 { /* APM crashes */
2118 { /* APM crashes */
2123 { /* APM crashes */
2129 { /* APM crashes */
2136 { /* APM crashes */
2143 { /* APM idle hangs */
2148 { /* APM idle hangs */
2153 { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
2159 { /* Handle problems with APM on Sony Vaio PCG-N505VX */
2165 { /* Handle problems with APM on Sony Vaio PCG-XG29 */
2171 { /* Handle problems with APM on Sony Vaio PCG-Z600NE */
2177 { /* Handle problems with APM on Sony Vaio PCG-Z600NE */
2183 { /* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
2189 { /* Handle problems with APM on Sony Vaio PCG-Z505LS */
2195 { /* Handle problems with APM on Sony Vaio PCG-Z505LS */
2201 { /* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */
2207 { /* Handle problems with APM on Sony Vaio PCG-F104K */
2214 { /* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
2220 { /* Handle problems with APM on Sony Vaio PCG-C1VE */
2226 { /* Handle problems with APM on Sony Vaio PCG-C1VE */
2239 /* Generic per vendor APM settings */
2250 * Just start the APM thread. We do NOT want to do APM BIOS
2251 * calls from anything but the APM thread, if for no other reason
2252 * than the fact that we don't trust the APM BIOS. This way,
2253 * most common APM BIOS problems that lead to protection errors
2257 * of just killing the apm thread..
2267 printk(KERN_INFO "apm: BIOS not found.\n"); in apm_init()
2271 "apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n", in apm_init()
2277 printk(KERN_INFO "apm: no 32 bit BIOS support\n"); in apm_init()
2303 printk(KERN_INFO "apm: entry %x:%x cseg16 %x dseg %x", in apm_init()
2320 pr_notice("disabled - APM is not SMP safe.\n"); in apm_init()
2331 * Set up the long jump entry point to the APM BIOS, which is called in apm_init()
2338 * The APM 1.1 BIOS is supposed to provide limit information that it in apm_init()
2344 * Note we only set APM segments on CPU zero, since we pin the APM in apm_init()
2355 proc_create_single("apm", 0, NULL, proc_apm_show); in apm_init()
2357 kapmd_task = kthread_create(apm, NULL, "kapmd"); in apm_init()
2362 remove_proc_entry("apm", NULL); in apm_init()
2369 "apm: disabled - APM is not SMP safe (power off active).\n"); in apm_init()
2379 printk(KERN_WARNING "apm: Could not register misc device.\n"); in apm_init()
2407 remove_proc_entry("apm", NULL); in apm_exit()
2438 "System idle percentage above which to make APM BIOS idle calls");
2444 "Set this to enable APM use on an SMP platform. Use with caution on older systems");