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
244 * apm=on/off enable/disable APM
251 * [no-]smp Use apm even on an SMP box
255 * make APM BIOS idle calls. Set it to
264 * U: TI 4000M TravelMate: BIOS is *NOT* APM compliant
266 * ?: ACER 486DX4/75: uses dseg 0040, in violation of APM specification
272 * ?: AcerNote-950: oops on reading /proc/apm - workaround is a WIP
275 * Legend: U = unusable with APM patches
276 * P = partially usable with APM patches
280 * Define as 1 to make the driver always call the APM BIOS busy
287 * Define to make the APM BIOS calls zero all data segment registers (so
293 #include <asm/apm.h>
309 * Need to poll the APM BIOS every second
324 * The per-file APM data
366 { /* entry 1 is for APM idle */
367 .name = "APM",
368 .desc = "APM idle",
431 * APM event names taken from the APM 1.2 specification. These are
477 { APM_NOT_PRESENT, "No APM present" }
482 * apm_error - display an APM error
484 * @err: APM BIOS return code
487 * an APM error. Note that this also handles (negative) kernel errors.
575 * __apm_bios_call - Make an APM BIOS 32bit call
578 * Make an APM call using the 32bit protected mode interface. The
579 * caller is responsible for knowing if APM BIOS is configured and
646 * apm_bios_call - Make an APM BIOS 32bit call (on CPU 0)
657 * __apm_bios_call_simple - Make an APM BIOS 32bit call (on CPU 0)
701 * apm_bios_call_simple - make a simple APM BIOS 32bit call
702 * @func: APM function to invoke
731 * apm_driver_version - APM driver version
732 * @val: loaded with the APM version on return
734 * Retrieve the APM version supported by the BIOS. This is only
735 * supported for APM 1.1 or higher. An error indicates APM 1.0 is
738 * On entry val should point to a value indicating the APM driver
758 * apm_get_event - get an APM event from the BIOS
762 * The APM BIOS provides a polled information for event
770 * that APM 1.2 is in use. If no messages are pending the value 0x80
796 * Request an APM change of state for one or more system devices. The
819 * Transition the entire system into a new APM power state.
894 * apm_cpu_idle - cpu idling for APM capable Linux
896 * This is the idling function the kernel executes when APM is available. It
976 * bugs we support real mode APM BIOS power off calls. We also make
995 * apm_enable_power_management - enable BIOS APM power management
998 * Enable or disable the APM BIOS power services.
1025 * Obtain the current power status from the APM BIOS. We return a
1301 printk(KERN_DEBUG "apm: received %s notify\n", in check_events()
1304 printk(KERN_DEBUG "apm: received unknown " in check_events()
1391 printk(KERN_DEBUG "apm: setting state busy\n"); in apm_event_handler()
1402 * This is the APM thread main loop.
1639 1) APM BIOS Version. Usually 1.0, 1.1 or 1.2. in proc_apm_show()
1640 2) APM flags from APM Installation Check (0x00): in proc_apm_show()
1688 static int apm(void *unused) in apm() function
1699 * on SMP systems in case of "apm=power-off" mode. Seen on ASUS A7M266D. in apm()
1717 /* Fall back to an APM 1.0 connection. */ in apm()
1724 printk(KERN_INFO "apm: Connection version %d.%d\n", in apm()
1755 printk(KERN_INFO "apm: power status not available\n"); in apm()
1789 "apm: AC %s, battery status %s, battery life ", in apm()
1797 "apm: battery flag 0x%02x, battery life ", in apm()
1874 __setup("apm=", apm_setup);
1923 /* Some laptops require interrupts to be enabled during APM calls */
1929 "Enabling interrupts during APM calls.\n", d->ident); in set_apm_ints()
1934 /* Some APM bioses corrupt memory or just plain do not work */
1940 "Disabling APM.\n", d->ident); in apm_is_horked()
1950 "Disabling APM.\n", d->ident); in apm_is_horked_d850md()
1957 /* Some APM bioses hang on APM idle calls */
1963 "Disabling APM idle calls.\n", d->ident); in apm_likes_to_melt()
1986 printk(KERN_WARNING "BIOS strings suggest APM bugs, " in broken_apm_power()
1992 * This bios swaps the APM minute reporting bytes over (Many sony laptops
1998 printk(KERN_WARNING "BIOS strings suggest APM reports battery life " in swab_apm_power_in_minutes()
2006 KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",
2010 { /* Handle problems with APM on the C600 */
2020 { /* APM crashes */
2032 { /* Handle problems with APM on Inspiron 5000e */
2038 { /* Handle problems with APM on Inspiron 2500 */
2044 { /* APM crashes */
2058 { /* Allow interrupts during APM or the clock goes slow */
2063 { /* APM blows on shutdown */
2068 { /* APM crashes */
2073 { /* APM crashes */
2078 { /* APM crashes */
2083 { /* APM crashes */
2088 { /* APM crashes */
2094 { /* APM crashes */
2101 { /* APM crashes */
2108 { /* APM idle hangs */
2113 { /* APM idle hangs */
2118 { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
2124 { /* Handle problems with APM on Sony Vaio PCG-N505VX */
2130 { /* Handle problems with APM on Sony Vaio PCG-XG29 */
2136 { /* Handle problems with APM on Sony Vaio PCG-Z600NE */
2142 { /* Handle problems with APM on Sony Vaio PCG-Z600NE */
2148 { /* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
2154 { /* Handle problems with APM on Sony Vaio PCG-Z505LS */
2160 { /* Handle problems with APM on Sony Vaio PCG-Z505LS */
2166 { /* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */
2172 { /* Handle problems with APM on Sony Vaio PCG-F104K */
2179 { /* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
2185 { /* Handle problems with APM on Sony Vaio PCG-C1VE */
2191 { /* Handle problems with APM on Sony Vaio PCG-C1VE */
2204 /* Generic per vendor APM settings */
2215 * Just start the APM thread. We do NOT want to do APM BIOS
2216 * calls from anything but the APM thread, if for no other reason
2217 * than the fact that we don't trust the APM BIOS. This way,
2218 * most common APM BIOS problems that lead to protection errors
2222 * of just killing the apm thread..
2232 printk(KERN_INFO "apm: BIOS not found.\n"); in apm_init()
2236 "apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n", in apm_init()
2242 printk(KERN_INFO "apm: no 32 bit BIOS support\n"); in apm_init()
2268 printk(KERN_INFO "apm: entry %x:%x cseg16 %x dseg %x", in apm_init()
2285 pr_notice("disabled - APM is not SMP safe.\n"); in apm_init()
2296 * Set up the long jump entry point to the APM BIOS, which is called in apm_init()
2303 * The APM 1.1 BIOS is supposed to provide limit information that it in apm_init()
2309 * Note we only set APM segments on CPU zero, since we pin the APM in apm_init()
2320 proc_create_single("apm", 0, NULL, proc_apm_show); in apm_init()
2322 kapmd_task = kthread_create(apm, NULL, "kapmd"); in apm_init()
2327 remove_proc_entry("apm", NULL); in apm_init()
2334 "apm: disabled - APM is not SMP safe (power off active).\n"); in apm_init()
2344 printk(KERN_WARNING "apm: Could not register misc device.\n"); in apm_init()
2372 remove_proc_entry("apm", NULL); in apm_exit()
2403 "System idle percentage above which to make APM BIOS idle calls");
2409 "Set this to enable APM use on an SMP platform. Use with caution on older systems");