Merge linux-2.6 into linux-acpi-2.6 test
Len Brown [Sat, 3 Sep 2005 06:44:09 +0000 (02:44 -0400)]
249 files changed:
Documentation/acpi-hotkey.txt
Documentation/ibm-acpi.txt
arch/i386/Kconfig
arch/i386/defconfig
arch/i386/kernel/Makefile
arch/i386/kernel/acpi/Makefile
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/earlyquirk.c
arch/i386/kernel/acpi/sleep.c
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/setup.c
arch/i386/mach-es7000/es7000plat.c
arch/i386/pci/Makefile
arch/i386/pci/irq.c
arch/ia64/Kconfig
arch/ia64/configs/bigsur_defconfig
arch/ia64/configs/sn2_defconfig
arch/ia64/configs/tiger_defconfig
arch/ia64/configs/zx1_defconfig
arch/ia64/defconfig
arch/ia64/kernel/acpi-ext.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/topology.c
arch/ia64/sn/kernel/irq.c
arch/ia64/sn/kernel/sn2/sn_proc_fs.c
arch/x86_64/Kconfig
arch/x86_64/defconfig
arch/x86_64/kernel/Makefile
arch/x86_64/kernel/acpi/Makefile
arch/x86_64/kernel/acpi/sleep.c
arch/x86_64/kernel/genapic.c
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/mpparse.c
arch/x86_64/kernel/setup.c
arch/x86_64/pci/Makefile
arch/x86_64/pci/Makefile-BUS
drivers/Makefile
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/blacklist.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/container.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/dsfield.c
drivers/acpi/dispatcher/dsinit.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dsmthdat.c
drivers/acpi/dispatcher/dsobject.c
drivers/acpi/dispatcher/dsopcode.c
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswload.c
drivers/acpi/dispatcher/dswscope.c
drivers/acpi/dispatcher/dswstate.c
drivers/acpi/ec.c
drivers/acpi/event.c
drivers/acpi/events/evevent.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evgpeblk.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evregion.c
drivers/acpi/events/evrgnini.c
drivers/acpi/events/evsci.c
drivers/acpi/events/evxface.c
drivers/acpi/events/evxfevnt.c
drivers/acpi/events/evxfregn.c
drivers/acpi/executer/exconfig.c
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exfield.c
drivers/acpi/executer/exfldio.c
drivers/acpi/executer/exmisc.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exnames.c
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exoparg2.c
drivers/acpi/executer/exoparg3.c
drivers/acpi/executer/exoparg6.c
drivers/acpi/executer/exprep.c
drivers/acpi/executer/exregion.c
drivers/acpi/executer/exresnte.c
drivers/acpi/executer/exresolv.c
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exstore.c
drivers/acpi/executer/exstoren.c
drivers/acpi/executer/exstorob.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/fan.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwacpi.c
drivers/acpi/hardware/hwgpe.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hardware/hwtimer.c
drivers/acpi/hotkey.c
drivers/acpi/ibm_acpi.c
drivers/acpi/motherboard.c
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsalloc.c
drivers/acpi/namespace/nsdump.c
drivers/acpi/namespace/nsdumpdv.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsload.c
drivers/acpi/namespace/nsnames.c
drivers/acpi/namespace/nsobject.c
drivers/acpi/namespace/nsparse.c
drivers/acpi/namespace/nssearch.c
drivers/acpi/namespace/nsutils.c
drivers/acpi/namespace/nswalk.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/namespace/nsxfname.c
drivers/acpi/namespace/nsxfobj.c
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/parser/Makefile
drivers/acpi/parser/psargs.c
drivers/acpi/parser/psloop.c [new file with mode: 0644]
drivers/acpi/parser/psopcode.c
drivers/acpi/parser/psparse.c
drivers/acpi/parser/psscope.c
drivers/acpi/parser/pstree.c
drivers/acpi/parser/psutils.c
drivers/acpi/parser/pswalk.c
drivers/acpi/parser/psxface.c
drivers/acpi/pci_bind.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/processor_thermal.c
drivers/acpi/processor_throttling.c
drivers/acpi/resources/rsaddr.c
drivers/acpi/resources/rscalc.c
drivers/acpi/resources/rscreate.c
drivers/acpi/resources/rsdump.c
drivers/acpi/resources/rsio.c
drivers/acpi/resources/rsirq.c
drivers/acpi/resources/rslist.c
drivers/acpi/resources/rsmemory.c
drivers/acpi/resources/rsmisc.c
drivers/acpi/resources/rsutils.c
drivers/acpi/resources/rsxface.c
drivers/acpi/scan.c
drivers/acpi/sleep/poweroff.c
drivers/acpi/sleep/proc.c
drivers/acpi/sleep/wakeup.c
drivers/acpi/system.c
drivers/acpi/tables.c
drivers/acpi/tables/tbconvrt.c
drivers/acpi/tables/tbget.c
drivers/acpi/tables/tbgetall.c
drivers/acpi/tables/tbinstal.c
drivers/acpi/tables/tbrsdt.c
drivers/acpi/tables/tbutils.c
drivers/acpi/tables/tbxface.c
drivers/acpi/tables/tbxfroot.c
drivers/acpi/thermal.c
drivers/acpi/toshiba_acpi.c
drivers/acpi/utilities/Makefile
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utcache.c [new file with mode: 0644]
drivers/acpi/utilities/utcopy.c
drivers/acpi/utilities/utdebug.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utilities/uteval.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utinit.c
drivers/acpi/utilities/utmath.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utmutex.c [new file with mode: 0644]
drivers/acpi/utilities/utobject.c
drivers/acpi/utilities/utstate.c [new file with mode: 0644]
drivers/acpi/utilities/utxface.c
drivers/acpi/utils.c
drivers/acpi/video.c
drivers/char/hpet.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/tpm/Kconfig
drivers/pci/hotplug/Kconfig
drivers/pci/hotplug/Makefile
drivers/pnp/Kconfig
drivers/pnp/pnpacpi/Kconfig
drivers/pnp/pnpacpi/rsparser.c
drivers/serial/8250_acpi.c
drivers/serial/Kconfig
include/acpi/acconfig.h
include/acpi/acdebug.h
include/acpi/acdisasm.h
include/acpi/acdispat.h
include/acpi/acevents.h
include/acpi/acexcep.h
include/acpi/acglobal.h
include/acpi/achware.h
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acmacros.h
include/acpi/acnames.h
include/acpi/acnamesp.h
include/acpi/acobject.h
include/acpi/acopcode.h
include/acpi/acoutput.h
include/acpi/acparser.h
include/acpi/acpi.h
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acresrc.h
include/acpi/acstruct.h
include/acpi/actables.h
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actbl2.h
include/acpi/actbl71.h
include/acpi/actypes.h
include/acpi/acutils.h
include/acpi/amlcode.h
include/acpi/amlresrc.h
include/acpi/container.h
include/acpi/pdc_intel.h
include/acpi/platform/acenv.h
include/acpi/platform/acgcc.h
include/acpi/platform/aclinux.h
include/acpi/processor.h
include/asm-i386/acpi.h
include/asm-i386/fixmap.h
include/asm-i386/io_apic.h
include/asm-i386/mpspec.h
include/asm-ia64/acpi-ext.h
include/asm-x86_64/acpi.h
include/asm-x86_64/io_apic.h
include/asm-x86_64/mpspec.h
include/linux/acpi.h
kernel/power/Kconfig

index 0acdc80..744f1ae 100644 (file)
@@ -35,4 +35,4 @@ created.  Please use command "cat /proc/acpi/hotkey/polling_method"
 to retrieve it.
 
 Note: Use cmdline "acpi_generic_hotkey" to over-ride
-loading any platform specific drivers.
+platform-specific with generic driver.
index c437b1a..8b3fd82 100644 (file)
@@ -1,16 +1,16 @@
                    IBM ThinkPad ACPI Extras Driver
 
-                            Version 0.8
-                          8 November 2004
+                            Version 0.12
+                           17 August 2005
 
                Borislav Deianov <borislav@users.sf.net>
                      http://ibm-acpi.sf.net/
 
 
-This is a Linux ACPI driver for the IBM ThinkPad laptops. It aims to
-support various features of these laptops which are accessible through
-the ACPI framework but not otherwise supported by the generic Linux
-ACPI drivers.
+This is a Linux ACPI driver for the IBM ThinkPad laptops. It supports
+various features of these laptops which are accessible through the
+ACPI framework but not otherwise supported by the generic Linux ACPI
+drivers.
 
 
 Status
@@ -25,9 +25,14 @@ detailed description):
        - ThinkLight on and off
        - limited docking and undocking
        - UltraBay eject
-       - Experimental: CMOS control
-       - Experimental: LED control
-       - Experimental: ACPI sounds
+       - CMOS control
+       - LED control
+       - ACPI sounds
+       - temperature sensors
+       - Experimental: embedded controller register dump
+       - Experimental: LCD brightness control
+       - Experimental: volume control
+       - Experimental: fan speed, fan enable/disable
 
 A compatibility table by model and feature is maintained on the web
 site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -91,12 +96,12 @@ driver is still in the alpha stage, the exact proc file format and
 commands supported by the various features is guaranteed to change
 frequently.
 
-Driver Version -- /proc/acpi/ibm/driver
---------------------------------------
+Driver version -- /proc/acpi/ibm/driver
+---------------------------------------
 
 The driver name and version. No commands can be written to this file.
 
-Hot Keys -- /proc/acpi/ibm/hotkey
+Hot keys -- /proc/acpi/ibm/hotkey
 ---------------------------------
 
 Without this driver, only the Fn-F4 key (sleep button) generates an
@@ -188,7 +193,7 @@ and, on the X40, video corruption. By disabling automatic switching,
 the flickering or video corruption can be avoided.
 
 The video_switch command cycles through the available video outputs
-(it sumulates the behavior of Fn-F7).
+(it simulates the behavior of Fn-F7).
 
 Video expansion can be toggled through this feature. This controls
 whether the display is expanded to fill the entire LCD screen when a
@@ -201,6 +206,12 @@ Fn-F7 from working. This also disables the video output switching
 features of this driver, as it uses the same ACPI methods as
 Fn-F7. Video switching on the console should still work.
 
+UPDATE: There's now a patch for the X.org Radeon driver which
+addresses this issue. Some people are reporting success with the patch
+while others are still having problems. For more information:
+
+https://bugs.freedesktop.org/show_bug.cgi?id=2000
+
 ThinkLight control -- /proc/acpi/ibm/light
 ------------------------------------------
 
@@ -211,7 +222,7 @@ models which do not make the status available will show it as
        echo on  > /proc/acpi/ibm/light
        echo off > /proc/acpi/ibm/light
 
-Docking / Undocking -- /proc/acpi/ibm/dock
+Docking / undocking -- /proc/acpi/ibm/dock
 ------------------------------------------
 
 Docking and undocking (e.g. with the X4 UltraBase) requires some
@@ -228,11 +239,15 @@ NOTE: These events will only be generated if the laptop was docked
 when originally booted. This is due to the current lack of support for
 hot plugging of devices in the Linux ACPI framework. If the laptop was
 booted while not in the dock, the following message is shown in the
-logs: "ibm_acpi: dock device not present". No dock-related events are
-generated but the dock and undock commands described below still
-work. They can be executed manually or triggered by Fn key
-combinations (see the example acpid configuration files included in
-the driver tarball package available on the web site).
+logs:
+
+       Mar 17 01:42:34 aero kernel: ibm_acpi: dock device not present
+
+In this case, no dock-related events are generated but the dock and
+undock commands described below still work. They can be executed
+manually or triggered by Fn key combinations (see the example acpid
+configuration files included in the driver tarball package available
+on the web site).
 
 When the eject request button on the dock is pressed, the first event
 above is generated. The handler for this event should issue the
@@ -267,7 +282,7 @@ the only docking stations currently supported are the X-series
 UltraBase docks and "dumb" port replicators like the Mini Dock (the
 latter don't need any ACPI support, actually).
 
-UltraBay Eject -- /proc/acpi/ibm/bay
+UltraBay eject -- /proc/acpi/ibm/bay
 ------------------------------------
 
 Inserting or ejecting an UltraBay device requires some actions to be
@@ -284,8 +299,11 @@ when the laptop was originally booted (on the X series, the UltraBay
 is in the dock, so it may not be present if the laptop was undocked).
 This is due to the current lack of support for hot plugging of devices
 in the Linux ACPI framework. If the laptop was booted without the
-UltraBay, the following message is shown in the logs: "ibm_acpi: bay
-device not present". No bay-related events are generated but the eject
+UltraBay, the following message is shown in the logs:
+
+       Mar 17 01:42:34 aero kernel: ibm_acpi: bay device not present
+
+In this case, no bay-related events are generated but the eject
 command described below still works. It can be executed manually or
 triggered by a hot key combination.
 
@@ -306,22 +324,33 @@ necessary to enable the UltraBay device (e.g. call idectl).
 The contents of the /proc/acpi/ibm/bay file shows the current status
 of the UltraBay, as provided by the ACPI framework.
 
-Experimental Features
----------------------
+EXPERIMENTAL warm eject support on the 600e/x, A22p and A3x (To use
+this feature, you need to supply the experimental=1 parameter when
+loading the module):
+
+These models do not have a button near the UltraBay device to request
+a hot eject but rather require the laptop to be put to sleep
+(suspend-to-ram) before the bay device is ejected or inserted).
+The sequence of steps to eject the device is as follows:
+
+       echo eject > /proc/acpi/ibm/bay
+       put the ThinkPad to sleep
+       remove the drive
+       resume from sleep
+       cat /proc/acpi/ibm/bay should show that the drive was removed
+
+On the A3x, both the UltraBay 2000 and UltraBay Plus devices are
+supported. Use "eject2" instead of "eject" for the second bay.
 
-The following features are marked experimental because using them
-involves guessing the correct values of some parameters. Guessing
-incorrectly may have undesirable effects like crashing your
-ThinkPad. USE THESE WITH CAUTION! To activate them, you'll need to
-supply the experimental=1 parameter when loading the module.
+Note: the UltraBay eject support on the 600e/x, A22p and A3x is
+EXPERIMENTAL and may not work as expected. USE WITH CAUTION!
 
-Experimental: CMOS control - /proc/acpi/ibm/cmos
-------------------------------------------------
+CMOS control -- /proc/acpi/ibm/cmos
+-----------------------------------
 
 This feature is used internally by the ACPI firmware to control the
-ThinkLight on most newer ThinkPad models. It appears that it can also
-control LCD brightness, sounds volume and more, but only on some
-models.
+ThinkLight on most newer ThinkPad models. It may also control LCD
+brightness, sounds volume and more, but only on some models.
 
 The commands are non-negative integer numbers:
 
@@ -330,10 +359,9 @@ The commands are non-negative integer numbers:
        echo 2 >/proc/acpi/ibm/cmos
        ...
 
-The range of numbers which are used internally by various models is 0
-to 21, but it's possible that numbers outside this range have
-interesting behavior. Here is the behavior on the X40 (tpb is the
-ThinkPad Buttons utility):
+The range of valid numbers is 0 to 21, but not all have an effect and
+the behavior varies from model to model. Here is the behavior on the
+X40 (tpb is the ThinkPad Buttons utility):
 
        0 - no effect but tpb reports "Volume down"
        1 - no effect but tpb reports "Volume up"
@@ -346,26 +374,18 @@ ThinkPad Buttons utility):
        13 - ThinkLight off
        14 - no effect but tpb reports ThinkLight status change
 
-If you try this feature, please send me a report similar to the
-above. On models which allow control of LCD brightness or sound
-volume, I'd like to provide this functionality in an user-friendly
-way, but first I need a way to identify the models which this is
-possible.
-
-Experimental: LED control - /proc/acpi/ibm/LED
-----------------------------------------------
+LED control -- /proc/acpi/ibm/led
+---------------------------------
 
 Some of the LED indicators can be controlled through this feature. The
 available commands are:
 
-       echo <led number> on >/proc/acpi/ibm/led
-       echo <led number> off >/proc/acpi/ibm/led
-       echo <led number> blink >/proc/acpi/ibm/led
+       echo '<led number> on' >/proc/acpi/ibm/led
+       echo '<led number> off' >/proc/acpi/ibm/led
+       echo '<led number> blink' >/proc/acpi/ibm/led
 
-The <led number> parameter is a non-negative integer. The range of LED
-numbers used internally by various models is 0 to 7 but it's possible
-that numbers outside this range are also valid. Here is the mapping on
-the X40:
+The <led number> range is 0 to 7. The set of LEDs that can be
+controlled varies from model to model. Here is the mapping on the X40:
 
        0 - power
        1 - battery (orange)
@@ -376,49 +396,224 @@ the X40:
 
 All of the above can be turned on and off and can be made to blink.
 
-If you try this feature, please send me a report similar to the
-above. I'd like to provide this functionality in an user-friendly way,
-but first I need to identify the which numbers correspond to which
-LEDs on various models.
-
-Experimental: ACPI sounds - /proc/acpi/ibm/beep
------------------------------------------------
+ACPI sounds -- /proc/acpi/ibm/beep
+----------------------------------
 
 The BEEP method is used internally by the ACPI firmware to provide
-audible alerts in various situtation. This feature allows the same
+audible alerts in various situations. This feature allows the same
 sounds to be triggered manually.
 
 The commands are non-negative integer numbers:
 
-       echo 0 >/proc/acpi/ibm/beep
-       echo 1 >/proc/acpi/ibm/beep
-       echo 2 >/proc/acpi/ibm/beep
-       ...
+       echo <number> >/proc/acpi/ibm/beep
 
-The range of numbers which are used internally by various models is 0
-to 17, but it's possible that numbers outside this range are also
-valid. Here is the behavior on the X40:
+The valid <number> range is 0 to 17. Not all numbers trigger sounds
+and the sounds vary from model to model. Here is the behavior on the
+X40:
 
-       2 - two beeps, pause, third beep
+       0 - stop a sound in progress (but use 17 to stop 16)
+       2 - two beeps, pause, third beep ("low battery")
        3 - single beep
-       4 - "unable"    
+       4 - high, followed by low-pitched beep ("unable")
        5 - single beep
-       6 - "AC/DC"
+       6 - very high, followed by high-pitched beep ("AC/DC")
        7 - high-pitched beep
        9 - three short beeps
        10 - very long beep
        12 - low-pitched beep
+       15 - three high-pitched beeps repeating constantly, stop with 0
+       16 - one medium-pitched beep repeating constantly, stop with 17
+       17 - stop 16
+
+Temperature sensors -- /proc/acpi/ibm/thermal
+---------------------------------------------
+
+Most ThinkPads include six or more separate temperature sensors but
+only expose the CPU temperature through the standard ACPI methods.
+This feature shows readings from up to eight different sensors. Some
+readings may not be valid, e.g. may show large negative values. For
+example, on the X40, a typical output may be:
+
+temperatures:   42 42 45 41 36 -128 33 -128
+
+Thomas Gruber took his R51 apart and traced all six active sensors in
+his laptop (the location of sensors may vary on other models):
+
+1:  CPU
+2:  Mini PCI Module
+3:  HDD
+4:  GPU
+5:  Battery
+6:  N/A
+7:  Battery
+8:  N/A
+
+No commands can be written to this file.
+
+EXPERIMENTAL: Embedded controller reigster dump -- /proc/acpi/ibm/ecdump
+------------------------------------------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature dumps the values of 256 embedded controller
+registers. Values which have changed since the last time the registers
+were dumped are marked with a star:
+
+[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump 
+EC       +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
+EC 0x00:  a7  47  87  01  fe  96  00  08  01  00  cb  00  00  00  40  00
+EC 0x10:  00  00  ff  ff  f4  3c  87  09  01  ff  42  01  ff  ff  0d  00
+EC 0x20:  00  00  00  00  00  00  00  00  00  00  00  03  43  00  00  80
+EC 0x30:  01  07  1a  00  30  04  00  00 *85  00  00  10  00  50  00  00
+EC 0x40:  00  00  00  00  00  00  14  01  00  04  00  00  00  00  00  00
+EC 0x50:  00  c0  02  0d  00  01  01  02  02  03  03  03  03 *bc *02 *bc
+EC 0x60: *02 *bc *02  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0x70:  00  00  00  00  00  12  30  40 *24 *26 *2c *27 *20  80 *1f  80
+EC 0x80:  00  00  00  06 *37 *0e  03  00  00  00  0e  07  00  00  00  00
+EC 0x90:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xa0: *ff  09  ff  09  ff  ff *64  00 *00 *00 *a2  41 *ff *ff *e0  00
+EC 0xb0:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xc0:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xd0:  03  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xe0:  00  00  00  00  00  00  00  00  11  20  49  04  24  06  55  03
+EC 0xf0:  31  55  48  54  35  38  57  57  08  2f  45  73  07  65  6c  1a
+
+This feature can be used to determine the register holding the fan
+speed on some models. To do that, do the following:
+
+       - make sure the battery is fully charged
+       - make sure the fan is running
+       - run 'cat /proc/acpi/ibm/ecdump' several times, once per second or so
+
+The first step makes sure various charging-related values don't
+vary. The second ensures that the fan-related values do vary, since
+the fan speed fluctuates a bit. The third will (hopefully) mark the
+fan register with a star:
+
+[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump 
+EC       +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
+EC 0x00:  a7  47  87  01  fe  96  00  08  01  00  cb  00  00  00  40  00
+EC 0x10:  00  00  ff  ff  f4  3c  87  09  01  ff  42  01  ff  ff  0d  00
+EC 0x20:  00  00  00  00  00  00  00  00  00  00  00  03  43  00  00  80
+EC 0x30:  01  07  1a  00  30  04  00  00  85  00  00  10  00  50  00  00
+EC 0x40:  00  00  00  00  00  00  14  01  00  04  00  00  00  00  00  00
+EC 0x50:  00  c0  02  0d  00  01  01  02  02  03  03  03  03  bc  02  bc
+EC 0x60:  02  bc  02  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0x70:  00  00  00  00  00  12  30  40  24  27  2c  27  21  80  1f  80
+EC 0x80:  00  00  00  06 *be  0d  03  00  00  00  0e  07  00  00  00  00
+EC 0x90:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xa0:  ff  09  ff  09  ff  ff  64  00  00  00  a2  41  ff  ff  e0  00
+EC 0xb0:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xc0:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xd0:  03  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
+EC 0xe0:  00  00  00  00  00  00  00  00  11  20  49  04  24  06  55  03
+EC 0xf0:  31  55  48  54  35  38  57  57  08  2f  45  73  07  65  6c  1a
+
+Another set of values that varies often is the temperature
+readings. Since temperatures don't change vary fast, you can take
+several quick dumps to eliminate them.
+
+You can use a similar method to figure out the meaning of other
+embedded controller registers - e.g. make sure nothing else changes
+except the charging or discharging battery to determine which
+registers contain the current battery capacity, etc. If you experiment
+with this, do send me your results (including some complete dumps with
+a description of the conditions when they were taken.)
+
+EXPERIMENTAL: LCD brightness control -- /proc/acpi/ibm/brightness
+-----------------------------------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature allows software control of the LCD brightness on ThinkPad
+models which don't have a hardware brightness slider. The available
+commands are:
+
+       echo up   >/proc/acpi/ibm/brightness
+       echo down >/proc/acpi/ibm/brightness
+       echo 'level <level>' >/proc/acpi/ibm/brightness
+
+The <level> number range is 0 to 7, although not all of them may be
+distinct. The current brightness level is shown in the file.
+
+EXPERIMENTAL: Volume control -- /proc/acpi/ibm/volume
+-----------------------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature allows volume control on ThinkPad models which don't have
+a hardware volume knob. The available commands are:
+
+       echo up   >/proc/acpi/ibm/volume
+       echo down >/proc/acpi/ibm/volume
+       echo mute >/proc/acpi/ibm/volume
+       echo 'level <level>' >/proc/acpi/ibm/volume
+
+The <level> number range is 0 to 15 although not all of them may be
+distinct. The unmute the volume after the mute command, use either the
+up or down command (the level command will not unmute the volume).
+The current volume level and mute state is shown in the file.
+
+EXPERIMENTAL: fan speed, fan enable/disable -- /proc/acpi/ibm/fan
+-----------------------------------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature attempts to show the current fan speed. The speed is read
+directly from the hardware registers of the embedded controller. This
+is known to work on later R, T and X series ThinkPads but may show a
+bogus value on other models.
+
+The fan may be enabled or disabled with the following commands:
+
+       echo enable  >/proc/acpi/ibm/fan
+       echo disable >/proc/acpi/ibm/fan
+
+WARNING WARNING WARNING: do not leave the fan disabled unless you are
+monitoring the temperature sensor readings and you are ready to enable
+it if necessary to avoid overheating.
+
+The fan only runs if it's enabled *and* the various temperature
+sensors which control it read high enough. On the X40, this seems to
+depend on the CPU and HDD temperatures. Specifically, the fan is
+turned on when either the CPU temperature climbs to 56 degrees or the
+HDD temperature climbs to 46 degrees. The fan is turned off when the
+CPU temperature drops to 49 degrees and the HDD temperature drops to
+41 degrees. These thresholds cannot currently be controlled.
+
+On the X31 and X40 (and ONLY on those models), the fan speed can be
+controlled to a certain degree. Once the fan is running, it can be
+forced to run faster or slower with the following command:
+
+       echo 'speed <speed>' > /proc/acpi/ibm/thermal
+
+The sustainable range of fan speeds on the X40 appears to be from
+about 3700 to about 7350. Values outside this range either do not have
+any effect or the fan speed eventually settles somewhere in that
+range. The fan cannot be stopped or started with this command.
+
+On the 570, temperature readings are not available through this
+feature and the fan control works a little differently. The fan speed
+is reported in levels from 0 (off) to 7 (max) and can be controlled
+with the following command:
 
-(I've only been able to identify a couple of them).
-
-If you try this feature, please send me a report similar to the
-above. I'd like to provide this functionality in an user-friendly way,
-but first I need to identify the which numbers correspond to which
-sounds on various models.
+       echo 'level <level>' > /proc/acpi/ibm/thermal
 
 
-Multiple Command, Module Parameters
------------------------------------
+Multiple Commands, Module Parameters
+------------------------------------
 
 Multiple commands can be written to the proc files in one shot by
 separating them with commas, for example:
@@ -451,24 +646,19 @@ scripts (included with ibm-acpi for completeness):
        /usr/local/sbin/laptop_mode -- from the Linux kernel source
                distribution, see Documentation/laptop-mode.txt
        /sbin/service -- comes with Redhat/Fedora distributions
+       /usr/sbin/hibernate -- from the Software Suspend 2 distribution,
+               see http://softwaresuspend.berlios.de/
 
-Toan T Nguyen <ntt@control.uchicago.edu> has written a SuSE powersave
-script for the X20, included in config/usr/sbin/ibm_hotkeys_X20
+Toan T Nguyen <ntt@physics.ucla.edu> notes that Suse uses the
+powersave program to suspend ('powersave --suspend-to-ram') or
+hibernate ('powersave --suspend-to-disk'). This means that the
+hibernate script is not needed on that distribution.
 
 Henrik Brix Andersen <brix@gentoo.org> has written a Gentoo ACPI event
 handler script for the X31. You can get the latest version from
 http://dev.gentoo.org/~brix/files/x31.sh
 
 David Schweikert <dws@ee.eth.ch> has written an alternative blank.sh
-script which works on Debian systems, included in
-configs/etc/acpi/actions/blank-debian.sh
-
-
-TODO
-----
-
-I'd like to implement the following features but haven't yet found the
-time and/or I don't yet know how to implement them:
-
-- UltraBay floppy drive support
-
+script which works on Debian systems. This scripts has now been
+extended to also work on Fedora systems and included as the default
+blank.sh in the distribution.
index 619d843..9ba3349 100644 (file)
@@ -1203,7 +1203,6 @@ config PCI_DIRECT
 config PCI_MMCONFIG
        bool
        depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
-       select ACPI_BOOT
        default y
 
 source "drivers/pci/pcie/Kconfig"
index ca07b95..6a431b9 100644 (file)
@@ -131,8 +131,6 @@ CONFIG_SOFTWARE_SUSPEND=y
 # ACPI (Advanced Configuration and Power Interface) Support
 #
 CONFIG_ACPI=y
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_SLEEP_PROC_FS=y
 CONFIG_ACPI_AC=y
@@ -144,10 +142,8 @@ CONFIG_ACPI_THERMAL=y
 # CONFIG_ACPI_ASUS is not set
 # CONFIG_ACPI_TOSHIBA is not set
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_X86_PM_TIMER is not set
 
index 4cc83b3..c52b4fa 100644 (file)
@@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
 
 obj-y                          += cpu/
 obj-y                          += timers/
-obj-$(CONFIG_ACPI_BOOT)                += acpi/
+obj-$(CONFIG_ACPI)             += acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)  += reboot.o
 obj-$(CONFIG_MCA)              += mca.o
 obj-$(CONFIG_X86_MSR)          += msr.o
index 5e291a2..267ca48 100644 (file)
@@ -1,4 +1,4 @@
-obj-$(CONFIG_ACPI_BOOT)                := boot.o
+obj-y                          := boot.o
 obj-$(CONFIG_X86_IO_APIC)      += earlyquirk.o
 obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
 
index b7808a8..0fb23c3 100644 (file)
 
 #ifdef CONFIG_X86_64
 
-static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
+static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+}
 extern void __init clustered_apic_check(void);
-static inline int ioapic_setup_disabled(void) { return 0; }
+static inline int ioapic_setup_disabled(void)
+{
+       return 0;
+}
+
 #include <asm/proto.h>
 
-#else  /* X86 */
+#else                          /* X86 */
 
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <mach_apic.h>
 #include <mach_mpparse.h>
-#endif /* CONFIG_X86_LOCAL_APIC */
+#endif                         /* CONFIG_X86_LOCAL_APIC */
 
-#endif /* X86 */
+#endif                         /* X86 */
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
@@ -60,13 +66,8 @@ static inline int ioapic_setup_disabled(void) { return 0; }
 
 #define PREFIX                 "ACPI: "
 
-#ifdef CONFIG_ACPI_PCI
 int acpi_noirq __initdata;     /* skip ACPI IRQ initialization */
-int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */
-#else
-int acpi_noirq __initdata = 1;
-int acpi_pci_disabled __initdata = 1;
-#endif
+int acpi_pci_disabled __initdata;      /* skip ACPI PCI scan and IRQ initialization */
 int acpi_ht __initdata = 1;    /* enable HT */
 
 int acpi_lapic;
@@ -88,7 +89,7 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 
 #define MAX_MADT_ENTRIES       256
 u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
-                       { [0 ... MAX_MADT_ENTRIES-1] = 0xff };
+    {[0 ... MAX_MADT_ENTRIES - 1] = 0xff };
 EXPORT_SYMBOL(x86_acpiid_to_apicid);
 
 /* --------------------------------------------------------------------------
@@ -99,7 +100,7 @@ EXPORT_SYMBOL(x86_acpiid_to_apicid);
  * The default interrupt routing model is PIC (8259).  This gets
  * overriden if IOAPICs are enumerated (below).
  */
-enum acpi_irq_model_id         acpi_irq_model = ACPI_IRQ_MODEL_PIC;
+enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
 
 #ifdef CONFIG_X86_64
 
@@ -107,7 +108,7 @@ enum acpi_irq_model_id              acpi_irq_model = ACPI_IRQ_MODEL_PIC;
 char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
 {
        if (!phys_addr || !size)
-       return NULL;
+               return NULL;
 
        if (phys_addr < (end_pfn_map << PAGE_SHIFT))
                return __va(phys_addr);
@@ -134,8 +135,8 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
        unsigned long base, offset, mapped_size;
        int idx;
 
-       if (phys + size < 8*1024*1024) 
-               return __va(phys); 
+       if (phys + size < 8 * 1024 * 1024)
+               return __va(phys);
 
        offset = phys & (PAGE_SIZE - 1);
        mapped_size = PAGE_SIZE - offset;
@@ -154,7 +155,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
                mapped_size += PAGE_SIZE;
        }
 
-       return ((unsigned char *) base + offset);
+       return ((unsigned char *)base + offset);
 }
 #endif
 
@@ -172,7 +173,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
        if (!phys_addr || !size)
                return -EINVAL;
 
-       mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size);
+       mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
        if (!mcfg) {
                printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
                return -ENODEV;
@@ -209,20 +210,17 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
 
        return 0;
 }
-#endif /* CONFIG_PCI_MMCONFIG */
+#endif                         /* CONFIG_PCI_MMCONFIG */
 
 #ifdef CONFIG_X86_LOCAL_APIC
-static int __init
-acpi_parse_madt (
-       unsigned long           phys_addr,
-       unsigned long           size)
+static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 {
-       struct acpi_table_madt  *madt = NULL;
+       struct acpi_table_madt *madt = NULL;
 
        if (!phys_addr || !size)
                return -EINVAL;
 
-       madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size);
+       madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
        if (!madt) {
                printk(KERN_WARNING PREFIX "Unable to map MADT\n");
                return -ENODEV;
@@ -232,22 +230,20 @@ acpi_parse_madt (
                acpi_lapic_addr = (u64) madt->lapic_address;
 
                printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
-                       madt->lapic_address);
+                      madt->lapic_address);
        }
 
        acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
-       
+
        return 0;
 }
 
-
 static int __init
-acpi_parse_lapic (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
 {
-       struct acpi_table_lapic *processor = NULL;
+       struct acpi_table_lapic *processor = NULL;
 
-       processor = (struct acpi_table_lapic*) header;
+       processor = (struct acpi_table_lapic *)header;
 
        if (BAD_MADT_ENTRY(processor, end))
                return -EINVAL;
@@ -260,20 +256,19 @@ acpi_parse_lapic (
 
        x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
 
-       mp_register_lapic (
-               processor->id,                                     /* APIC ID */
-               processor->flags.enabled);                        /* Enabled? */
+       mp_register_lapic(processor->id,        /* APIC ID */
+                         processor->flags.enabled);    /* Enabled? */
 
        return 0;
 }
 
 static int __init
-acpi_parse_lapic_addr_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+                         const unsigned long end)
 {
        struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
 
-       lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header;
+       lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header;
 
        if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
                return -EINVAL;
@@ -284,12 +279,11 @@ acpi_parse_lapic_addr_ovr (
 }
 
 static int __init
-acpi_parse_lapic_nmi (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lapic_nmi *lapic_nmi = NULL;
 
-       lapic_nmi = (struct acpi_table_lapic_nmi*) header;
+       lapic_nmi = (struct acpi_table_lapic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lapic_nmi, end))
                return -EINVAL;
@@ -302,37 +296,32 @@ acpi_parse_lapic_nmi (
        return 0;
 }
 
+#endif                         /*CONFIG_X86_LOCAL_APIC */
 
-#endif /*CONFIG_X86_LOCAL_APIC*/
-
-#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
+#ifdef CONFIG_X86_IO_APIC
 
 static int __init
-acpi_parse_ioapic (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_ioapic *ioapic = NULL;
 
-       ioapic = (struct acpi_table_ioapic*) header;
+       ioapic = (struct acpi_table_ioapic *)header;
 
        if (BAD_MADT_ENTRY(ioapic, end))
                return -EINVAL;
+
        acpi_table_print_madt_entry(header);
 
-       mp_register_ioapic (
-               ioapic->id,
-               ioapic->address,
-               ioapic->global_irq_base);
+       mp_register_ioapic(ioapic->id,
+                          ioapic->address, ioapic->global_irq_base);
+
        return 0;
 }
 
 /*
  * Parse Interrupt Source Override for the ACPI SCI
  */
-static void
-acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
+static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 {
        if (trigger == 0)       /* compatible SCI trigger is level */
                trigger = 3;
@@ -348,7 +337,7 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
                polarity = acpi_sci_flags.polarity;
 
        /*
-        * mp_config_acpi_legacy_irqs() already setup IRQs < 16
+        * mp_config_acpi_legacy_irqs() already setup IRQs < 16
         * If GSI is < 16, this will update its flags,
         * else it will create a new mp_irqs[] entry.
         */
@@ -363,12 +352,12 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 }
 
 static int __init
-acpi_parse_int_src_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+                      const unsigned long end)
 {
        struct acpi_table_int_src_ovr *intsrc = NULL;
 
-       intsrc = (struct acpi_table_int_src_ovr*) header;
+       intsrc = (struct acpi_table_int_src_ovr *)header;
 
        if (BAD_MADT_ENTRY(intsrc, end))
                return -EINVAL;
@@ -377,33 +366,30 @@ acpi_parse_int_src_ovr (
 
        if (intsrc->bus_irq == acpi_fadt.sci_int) {
                acpi_sci_ioapic_setup(intsrc->global_irq,
-                       intsrc->flags.polarity, intsrc->flags.trigger);
+                                     intsrc->flags.polarity,
+                                     intsrc->flags.trigger);
                return 0;
        }
 
        if (acpi_skip_timer_override &&
-               intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
-                       printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
-                       return 0;
+           intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
+               printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
+               return 0;
        }
 
-       mp_override_legacy_irq (
-               intsrc->bus_irq,
-               intsrc->flags.polarity,
-               intsrc->flags.trigger,
-               intsrc->global_irq);
+       mp_override_legacy_irq(intsrc->bus_irq,
+                              intsrc->flags.polarity,
+                              intsrc->flags.trigger, intsrc->global_irq);
 
        return 0;
 }
 
-
 static int __init
-acpi_parse_nmi_src (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_nmi_src *nmi_src = NULL;
 
-       nmi_src = (struct acpi_table_nmi_src*) header;
+       nmi_src = (struct acpi_table_nmi_src *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -415,9 +401,7 @@ acpi_parse_nmi_src (
        return 0;
 }
 
-#endif /* CONFIG_X86_IO_APIC */
-
-#ifdef CONFIG_ACPI_BUS
+#endif                         /* CONFIG_X86_IO_APIC */
 
 /*
  * acpi_pic_sci_set_trigger()
@@ -433,8 +417,7 @@ acpi_parse_nmi_src (
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
  */
 
-void __init
-acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
+void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 {
        unsigned int mask = 1 << irq;
        unsigned int old, new;
@@ -454,10 +437,10 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
         * routing tables..
         */
        switch (trigger) {
-       case 1: /* Edge - clear */
+       case 1:         /* Edge - clear */
                new &= ~mask;
                break;
-       case 3: /* Level - set */
+       case 3:         /* Level - set */
                new |= mask;
                break;
        }
@@ -470,21 +453,22 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
        outb(new >> 8, 0x4d1);
 }
 
-
-#endif /* CONFIG_ACPI_BUS */
-
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
 #ifdef CONFIG_X86_IO_APIC
        if (use_pci_vector() && !platform_legacy_irq(gsi))
-               *irq = IO_APIC_VECTOR(gsi);
+               *irq = IO_APIC_VECTOR(gsi);
        else
 #endif
                *irq = gsi;
        return 0;
 }
 
-unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
 {
        unsigned int irq;
        unsigned int plat_gsi = gsi;
@@ -497,7 +481,7 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
                extern void eisa_set_level_irq(unsigned int irq);
 
                if (edge_level == ACPI_LEVEL_SENSITIVE)
-                               eisa_set_level_irq(gsi);
+                       eisa_set_level_irq(gsi);
        }
 #endif
 
@@ -509,60 +493,58 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
        acpi_gsi_to_irq(plat_gsi, &irq);
        return irq;
 }
+
 EXPORT_SYMBOL(acpi_register_gsi);
 
 /*
  *  ACPI based hotplug support for CPU
  */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
-int
-acpi_map_lsapic(acpi_handle handle, int *pcpu)
+int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
        /* TBD */
        return -EINVAL;
 }
-EXPORT_SYMBOL(acpi_map_lsapic);
 
+EXPORT_SYMBOL(acpi_map_lsapic);
 
-int
-acpi_unmap_lsapic(int cpu)
+int acpi_unmap_lsapic(int cpu)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_unmap_lsapic);
-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+#endif                         /* CONFIG_ACPI_HOTPLUG_CPU */
 
-int
-acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
+int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_register_ioapic);
 
-int
-acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
+int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
 static unsigned long __init
-acpi_scan_rsdp (
-       unsigned long           start,
-       unsigned long           length)
+acpi_scan_rsdp(unsigned long start, unsigned long length)
 {
-       unsigned long           offset = 0;
-       unsigned long           sig_len = sizeof("RSD PTR ") - 1;
+       unsigned long offset = 0;
+       unsigned long sig_len = sizeof("RSD PTR ") - 1;
 
        /*
         * Scan all 16-byte boundaries of the physical memory region for the
         * RSDP signature.
         */
        for (offset = 0; offset < length; offset += 16) {
-               if (strncmp((char *) (start + offset), "RSD PTR ", sig_len))
+               if (strncmp((char *)(start + offset), "RSD PTR ", sig_len))
                        continue;
                return (start + offset);
        }
@@ -575,20 +557,19 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
        struct acpi_table_sbf *sb;
 
        if (!phys_addr || !size)
-       return -EINVAL;
+               return -EINVAL;
 
-       sb = (struct acpi_table_sbf *) __acpi_map_table(phys_addr, size);
+       sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size);
        if (!sb) {
                printk(KERN_WARNING PREFIX "Unable to map SBF\n");
                return -ENODEV;
        }
 
-       sbf_port = sb->sbf_cmos; /* Save CMOS port */
+       sbf_port = sb->sbf_cmos;        /* Save CMOS port */
 
        return 0;
 }
 
-
 #ifdef CONFIG_HPET_TIMER
 
 static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
@@ -598,7 +579,7 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
        if (!phys || !size)
                return -EINVAL;
 
-       hpet_tbl = (struct acpi_table_hpet *) __acpi_map_table(phys, size);
+       hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size);
        if (!hpet_tbl) {
                printk(KERN_WARNING PREFIX "Unable to map HPET\n");
                return -ENODEV;
@@ -609,22 +590,21 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
                       "memory.\n");
                return -1;
        }
-
 #ifdef CONFIG_X86_64
-        vxtime.hpet_address = hpet_tbl->addr.addrl |
-                ((long) hpet_tbl->addr.addrh << 32);
+       vxtime.hpet_address = hpet_tbl->addr.addrl |
+           ((long)hpet_tbl->addr.addrh << 32);
 
-        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-               hpet_tbl->id, vxtime.hpet_address);
-#else  /* X86 */
+       printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
+              hpet_tbl->id, vxtime.hpet_address);
+#else                          /* X86 */
        {
                extern unsigned long hpet_address;
 
                hpet_address = hpet_tbl->addr.addrl;
                printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-                       hpet_tbl->id, hpet_address);
+                      hpet_tbl->id, hpet_address);
        }
-#endif /* X86 */
+#endif                         /* X86 */
 
        return 0;
 }
@@ -640,28 +620,25 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
 {
        struct fadt_descriptor_rev2 *fadt = NULL;
 
-       fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
-       if(!fadt) {
+       fadt = (struct fadt_descriptor_rev2 *)__acpi_map_table(phys, size);
+       if (!fadt) {
                printk(KERN_WARNING PREFIX "Unable to map FADT\n");
                return 0;
        }
-
-#ifdef CONFIG_ACPI_INTERPRETER
        /* initialize sci_int early for INT_SRC_OVR MADT parsing */
        acpi_fadt.sci_int = fadt->sci_int;
-#endif
 
-#ifdef CONFIG_ACPI_BUS
        /* initialize rev and apic_phys_dest_mode for x86_64 genapic */
        acpi_fadt.revision = fadt->revision;
-       acpi_fadt.force_apic_physical_destination_mode = fadt->force_apic_physical_destination_mode;
-#endif
+       acpi_fadt.force_apic_physical_destination_mode =
+           fadt->force_apic_physical_destination_mode;
 
 #ifdef CONFIG_X86_PM_TIMER
        /* detect the location of the ACPI PM Timer */
        if (fadt->revision >= FADT2_REVISION_ID) {
                /* FADT rev. 2 */
-               if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
+               if (fadt->xpm_tmr_blk.address_space_id !=
+                   ACPI_ADR_SPACE_SYSTEM_IO)
                        return 0;
 
                pmtmr_ioport = fadt->xpm_tmr_blk.address;
@@ -670,16 +647,15 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
                pmtmr_ioport = fadt->V1_pm_tmr_blk;
        }
        if (pmtmr_ioport)
-               printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
+               printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
+                      pmtmr_ioport);
 #endif
        return 0;
 }
 
-
-unsigned long __init
-acpi_find_rsdp (void)
+unsigned long __init acpi_find_rsdp(void)
 {
-       unsigned long           rsdp_phys = 0;
+       unsigned long rsdp_phys = 0;
 
        if (efi_enabled) {
                if (efi.acpi20)
@@ -691,9 +667,9 @@ acpi_find_rsdp (void)
         * Scan memory looking for the RSDP signature. First search EBDA (low
         * memory) paragraphs and then search upper memory (E0000-FFFFF).
         */
-       rsdp_phys = acpi_scan_rsdp (0, 0x400);
+       rsdp_phys = acpi_scan_rsdp(0, 0x400);
        if (!rsdp_phys)
-               rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
+               rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000);
 
        return rsdp_phys;
 }
@@ -703,8 +679,7 @@ acpi_find_rsdp (void)
  * Parse LAPIC entries in MADT
  * returns 0 on success, < 0 on error
  */
-static int __init
-acpi_parse_madt_lapic_entries(void)
+static int __init acpi_parse_madt_lapic_entries(void)
 {
        int count;
 
@@ -713,28 +688,31 @@ acpi_parse_madt_lapic_entries(void)
         * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
         */
 
-       count = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR,
+                                 acpi_parse_lapic_addr_ovr, 0);
        if (count < 0) {
-               printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
+               printk(KERN_ERR PREFIX
+                      "Error parsing LAPIC address override entry\n");
                return count;
        }
 
        mp_register_lapic_address(acpi_lapic_addr);
 
        count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
-                                      MAX_APICS);
-       if (!count) { 
+                                     MAX_APICS);
+       if (!count) {
                printk(KERN_ERR PREFIX "No LAPIC entries present\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return -ENODEV;
-       }
-       else if (count < 0) {
+       } else if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return count;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
@@ -742,15 +720,14 @@ acpi_parse_madt_lapic_entries(void)
        }
        return 0;
 }
-#endif /* CONFIG_X86_LOCAL_APIC */
+#endif                         /* CONFIG_X86_LOCAL_APIC */
 
-#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
+#ifdef CONFIG_X86_IO_APIC
 /*
  * Parse IOAPIC related entries in MADT
  * returns 0 on success, < 0 on error
  */
-static int __init
-acpi_parse_madt_ioapic_entries(void)
+static int __init acpi_parse_madt_ioapic_entries(void)
 {
        int count;
 
@@ -762,30 +739,34 @@ acpi_parse_madt_ioapic_entries(void)
         */
        if (acpi_disabled || acpi_noirq) {
                return -ENODEV;
-        }
+       }
 
        /*
-        * if "noapic" boot option, don't look for IO-APICs
+        * if "noapic" boot option, don't look for IO-APICs
         */
        if (skip_ioapic_setup) {
                printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
-                       "due to 'noapic' option.\n");
+                      "due to 'noapic' option.\n");
                return -ENODEV;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic,
+                                 MAX_IO_APICS);
        if (!count) {
                printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
                return -ENODEV;
-       }
-       else if (count < 0) {
+       } else if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
                return count;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr,
+                                 NR_IRQ_VECTORS);
        if (count < 0) {
-               printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
+               printk(KERN_ERR PREFIX
+                      "Error parsing interrupt source overrides entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return count;
        }
@@ -800,7 +781,9 @@ acpi_parse_madt_ioapic_entries(void)
        /* Fill in identity legacy mapings where no override */
        mp_config_acpi_legacy_irqs();
 
-       count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
+                                 NR_IRQ_VECTORS);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
@@ -814,11 +797,9 @@ static inline int acpi_parse_madt_ioapic_entries(void)
 {
        return -1;
 }
-#endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */
+#endif /* !CONFIG_X86_IO_APIC */
 
-
-static void __init
-acpi_process_madt(void)
+static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
        int count, error;
@@ -850,7 +831,8 @@ acpi_process_madt(void)
                        /*
                         * Dell Precision Workstation 410, 610 come here.
                         */
-                       printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n");
+                       printk(KERN_ERR PREFIX
+                              "Invalid BIOS MADT, disabling ACPI\n");
                        disable_acpi();
                }
        }
@@ -862,7 +844,6 @@ extern int acpi_force;
 
 #ifdef __i386__
 
-#ifdef CONFIG_ACPI_PCI
 static int __init disable_acpi_irq(struct dmi_system_id *d)
 {
        if (!acpi_force) {
@@ -882,12 +863,11 @@ static int __init disable_acpi_pci(struct dmi_system_id *d)
        }
        return 0;
 }
-#endif
 
 static int __init dmi_disable_acpi(struct dmi_system_id *d)
 {
        if (!acpi_force) {
-               printk(KERN_NOTICE "%s detected: acpi off\n",d->ident);
+               printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
                disable_acpi();
        } else {
                printk(KERN_NOTICE
@@ -902,7 +882,8 @@ static int __init dmi_disable_acpi(struct dmi_system_id *d)
 static int __init force_acpi_ht(struct dmi_system_id *d)
 {
        if (!acpi_force) {
-               printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident);
+               printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
+                      d->ident);
                disable_acpi();
                acpi_ht = 1;
        } else {
@@ -921,155 +902,155 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
         * Boxes that need ACPI disabled
         */
        {
-               .callback = dmi_disable_acpi,
-               .ident = "IBM Thinkpad",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
-               },
-       },
+        .callback = dmi_disable_acpi,
+        .ident = "IBM Thinkpad",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
+                    },
+        },
 
        /*
         * Boxes that need acpi=ht
         */
        {
-               .callback = force_acpi_ht,
-               .ident = "FSC Primergy T850",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "FSC Primergy T850",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "DELL GX240",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
-                       DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "DELL GX240",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
+                    DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "HP VISUALIZE NT Workstation",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "HP VISUALIZE NT Workstation",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "Compaq Workstation W8000",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "Compaq Workstation W8000",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS P4B266",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS P4B266",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS P2B-DS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS P2B-DS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS CUR-DLS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS CUR-DLS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ABIT i440BX-W83977",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
-                       DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ABIT i440BX-W83977",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
+                    DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM Bladecenter",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM Bladecenter",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eServer xSeries 360",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM eServer xSeries 360",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eserver xSeries 330",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM eserver xSeries 330",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eserver xSeries 440",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
-               },
-       },
-
-#ifdef CONFIG_ACPI_PCI
+        .callback = force_acpi_ht,
+        .ident = "IBM eserver xSeries 440",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
+                    },
+        },
+
        /*
         * Boxes that need ACPI PCI IRQ routing disabled
         */
        {
-               .callback = disable_acpi_irq,
-               .ident = "ASUS A7V",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-                       DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
-                       /* newer BIOS, Revision 1011, does work */
-                       DMI_MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
-               },
-       },
+        .callback = disable_acpi_irq,
+        .ident = "ASUS A7V",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
+                    DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
+                    /* newer BIOS, Revision 1011, does work */
+                    DMI_MATCH(DMI_BIOS_VERSION,
+                              "ASUS A7V ACPI BIOS Revision 1007"),
+                    },
+        },
 
        /*
         * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
         */
-       {       /* _BBN 0 bug */
-               .callback = disable_acpi_pci,
-               .ident = "ASUS PR-DLS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
-                       DMI_MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS Revision 1010"),
-                       DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
-               },
-       },
+       {                       /* _BBN 0 bug */
+        .callback = disable_acpi_pci,
+        .ident = "ASUS PR-DLS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
+                    DMI_MATCH(DMI_BIOS_VERSION,
+                              "ASUS PR-DLS ACPI BIOS Revision 1010"),
+                    DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
+                    },
+        },
        {
-               .callback = disable_acpi_pci,
-               .ident = "Acer TravelMate 36x Laptop",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
-               },
-       },
-#endif
-       { }
+        .callback = disable_acpi_pci,
+        .ident = "Acer TravelMate 36x Laptop",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+                    },
+        },
+       {}
 };
 
-#endif /* __i386__ */
+#endif                         /* __i386__ */
 
 /*
  * acpi_boot_table_init() and acpi_boot_init()
@@ -1094,8 +1075,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
  *     !0: failure
  */
 
-int __init
-acpi_boot_table_init(void)
+int __init acpi_boot_table_init(void)
 {
        int error;
 
@@ -1108,7 +1088,7 @@ acpi_boot_table_init(void)
         * One exception: acpi=ht continues far enough to enumerate LAPICs
         */
        if (acpi_disabled && !acpi_ht)
-                return 1;
+               return 1;
 
        /* 
         * Initialize the ACPI boot-time table parser.
@@ -1118,7 +1098,6 @@ acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-
 #ifdef __i386__
        check_acpi_pci();
 #endif
@@ -1142,7 +1121,6 @@ acpi_boot_table_init(void)
        return 0;
 }
 
-
 int __init acpi_boot_init(void)
 {
        /*
@@ -1150,7 +1128,7 @@ int __init acpi_boot_init(void)
         * One exception: acpi=ht continues far enough to enumerate LAPICs
         */
        if (acpi_disabled && !acpi_ht)
-                return 1;
+               return 1;
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
 
@@ -1168,4 +1146,3 @@ int __init acpi_boot_init(void)
 
        return 0;
 }
-
index 726a5ca..f1b9d2a 100644 (file)
@@ -8,44 +8,44 @@
 #include <asm/pci-direct.h>
 #include <asm/acpi.h>
 
-static int __init check_bridge(int vendor, int device) 
+static int __init check_bridge(int vendor, int device)
 {
        /* According to Nvidia all timer overrides are bogus. Just ignore
           them all. */
-       if (vendor == PCI_VENDOR_ID_NVIDIA) { 
-               acpi_skip_timer_override = 1;           
+       if (vendor == PCI_VENDOR_ID_NVIDIA) {
+               acpi_skip_timer_override = 1;
        }
        return 0;
 }
-   
-void __init check_acpi_pci(void) 
-{ 
-       int num,slot,func; 
+
+void __init check_acpi_pci(void)
+{
+       int num, slot, func;
 
        /* Assume the machine supports type 1. If not it will 
           always read ffffffff and should not have any side effect. */
 
        /* Poor man's PCI discovery */
-       for (num = 0; num < 32; num++) { 
-               for (slot = 0; slot < 32; slot++) { 
-                       for (func = 0; func < 8; func++) { 
+       for (num = 0; num < 32; num++) {
+               for (slot = 0; slot < 32; slot++) {
+                       for (func = 0; func < 8; func++) {
                                u32 class;
                                u32 vendor;
-                               class = read_pci_config(num,slot,func,
+                               class = read_pci_config(num, slot, func,
                                                        PCI_CLASS_REVISION);
                                if (class == 0xffffffff)
-                                       break; 
+                                       break;
 
                                if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
-                                       continue; 
-                               
-                               vendor = read_pci_config(num, slot, func, 
+                                       continue;
+
+                               vendor = read_pci_config(num, slot, func,
                                                         PCI_VENDOR_ID);
-                               
-                               if (check_bridge(vendor&0xffff, vendor >> 16))
-                                       return; 
-                       } 
-                       
+
+                               if (check_bridge(vendor & 0xffff, vendor >> 16))
+                                       return;
+                       }
+
                }
        }
 }
index c1af930..1cb2b18 100644 (file)
@@ -20,12 +20,13 @@ extern void zap_low_mappings(void);
 
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
 
-static void init_low_mapping(pgd_t *pgd, int pgd_limit)
+static void init_low_mapping(pgd_t * pgd, int pgd_limit)
 {
        int pgd_ofs = 0;
 
-       while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
-               set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
+       while ((pgd_ofs < pgd_limit)
+              && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
+               set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
                pgd_ofs++, pgd++;
        }
        flush_tlb_all();
@@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  */
-int acpi_save_state_mem (void)
+int acpi_save_state_mem(void)
 {
        if (!acpi_wakeup_address)
                return 1;
        init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
-       memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
+       memcpy((void *)acpi_wakeup_address, &wakeup_start,
+              &wakeup_end - &wakeup_start);
        acpi_copy_wakeup_routine(acpi_wakeup_address);
 
        return 0;
@@ -51,7 +53,7 @@ int acpi_save_state_mem (void)
 /*
  * acpi_restore_state - undo effects of acpi_save_state_mem
  */
-void acpi_restore_state_mem (void)
+void acpi_restore_state_mem(void)
 {
        zap_low_mappings();
 }
@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void)
 void __init acpi_reserve_bootmem(void)
 {
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
-               printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n");
+               printk(KERN_ERR
+                      "ACPI: Wakeup code way too big, S3 disabled.\n");
                return;
        }
 
@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str)
        return 1;
 }
 
-
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-
 static __init int reset_videomode_after_s3(struct dmi_system_id *d)
 {
        acpi_video_flags |= 2;
@@ -101,14 +102,14 @@ static __init int reset_videomode_after_s3(struct dmi_system_id *d)
 }
 
 static __initdata struct dmi_system_id acpisleep_dmi_table[] = {
-       {       /* Reset video mode after returning from ACPI S3 sleep */
-               .callback = reset_videomode_after_s3,
-               .ident = "Toshiba Satellite 4030cdt",
-               .matches = {
-                       DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
-               },
-       },
-       { }
+       {                       /* Reset video mode after returning from ACPI S3 sleep */
+        .callback = reset_videomode_after_s3,
+        .ident = "Toshiba Satellite 4030cdt",
+        .matches = {
+                    DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
+                    },
+        },
+       {}
 };
 
 static int __init acpisleep_dmi_init(void)
index 60a9e54..822c8ce 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/cpufreq.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/compiler.h>
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <asm/uaccess.h>
@@ -57,6 +58,8 @@ static struct cpufreq_acpi_io *acpi_io_data[NR_CPUS];
 
 static struct cpufreq_driver acpi_cpufreq_driver;
 
+static unsigned int acpi_pstate_strict;
+
 static int
 acpi_processor_write_port(
        u16     port,
@@ -163,34 +166,44 @@ acpi_processor_set_performance (
        }
 
        /*
-        * Then we read the 'status_register' and compare the value with the
-        * target state's 'status' to make sure the transition was successful.
-        * Note that we'll poll for up to 1ms (100 cycles of 10us) before
-        * giving up.
+        * Assume the write went through when acpi_pstate_strict is not used.
+        * As read status_register is an expensive operation and there 
+        * are no specific error cases where an IO port write will fail.
         */
-
-       port = data->acpi_data.status_register.address;
-       bit_width = data->acpi_data.status_register.bit_width;
-
-       dprintk("Looking for 0x%08x from port 0x%04x\n",
-               (u32) data->acpi_data.states[state].status, port);
-
-       for (i=0; i<100; i++) {
-               ret = acpi_processor_read_port(port, bit_width, &value);
-               if (ret) {      
-                       dprintk("Invalid port width 0x%04x\n", bit_width);
-                       retval = ret;
-                       goto migrate_end;
+       if (acpi_pstate_strict) {
+               /* Then we read the 'status_register' and compare the value 
+                * with the target state's 'status' to make sure the 
+                * transition was successful.
+                * Note that we'll poll for up to 1ms (100 cycles of 10us) 
+                * before giving up.
+                */
+
+               port = data->acpi_data.status_register.address;
+               bit_width = data->acpi_data.status_register.bit_width;
+
+               dprintk("Looking for 0x%08x from port 0x%04x\n",
+                       (u32) data->acpi_data.states[state].status, port);
+
+               for (i=0; i<100; i++) {
+                       ret = acpi_processor_read_port(port, bit_width, &value);
+                       if (ret) {      
+                               dprintk("Invalid port width 0x%04x\n", bit_width);
+                               retval = ret;
+                               goto migrate_end;
+                       }
+                       if (value == (u32) data->acpi_data.states[state].status)
+                               break;
+                       udelay(10);
                }
-               if (value == (u32) data->acpi_data.states[state].status)
-                       break;
-               udelay(10);
+       } else {
+               i = 0;
+               value = (u32) data->acpi_data.states[state].status;
        }
 
        /* notify cpufreq */
        cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
 
-       if (value != (u32) data->acpi_data.states[state].status) {
+       if (unlikely(value != (u32) data->acpi_data.states[state].status)) {
                unsigned int tmp = cpufreq_freqs.new;
                cpufreq_freqs.new = cpufreq_freqs.old;
                cpufreq_freqs.old = tmp;
@@ -537,6 +550,8 @@ acpi_cpufreq_exit (void)
        return;
 }
 
+module_param(acpi_pstate_strict, uint, 0644);
+MODULE_PARM_DESC(acpi_pstate_strict, "value 0 or non-zero. non-zero -> strict ACPI checks are performed during frequency changes.");
 
 late_initcall(acpi_cpufreq_init);
 module_exit(acpi_cpufreq_exit);
index 6578f40..ebedd2e 100644 (file)
@@ -2421,7 +2421,7 @@ device_initcall(ioapic_init_sysfs);
                           ACPI-based IOAPIC Configuration
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 
 int __init io_apic_get_unique_id (int ioapic, int apic_id)
 {
@@ -2574,4 +2574,4 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
        return 0;
 }
 
-#endif /*CONFIG_ACPI_BOOT*/
+#endif /* CONFIG_ACPI */
index ce838ab..97dbf28 100644 (file)
@@ -653,8 +653,6 @@ void __init get_smp_config (void)
        struct intel_mp_floating *mpf = mpf_found;
 
        /*
-        * ACPI may be used to obtain the entire SMP configuration or just to 
-        * enumerate/configure processors (CONFIG_ACPI_BOOT).  Note that 
         * ACPI supports both logical (e.g. Hyper-Threading) and physical 
         * processors, where MPS only supports physical.
         */
@@ -810,7 +808,7 @@ void __init find_smp_config (void)
                             ACPI-based MP Configuration
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 
 void __init mp_register_lapic_address (
        u64                     address)
@@ -856,7 +854,7 @@ void __init mp_register_lapic (
        MP_processor_info(&processor);
 }
 
-#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT))
+#ifdef CONFIG_X86_IO_APIC
 
 #define MP_ISA_BUS             0
 #define MP_MAX_IOAPIC_PIN      127
@@ -1071,11 +1069,9 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
         */
        static int              gsi_to_irq[MAX_GSI_NUM];
 
-#ifdef CONFIG_ACPI_BUS
        /* Don't set up the ACPI SCI because it's already set up */
        if (acpi_fadt.sci_int == gsi)
                return gsi;
-#endif
 
        ioapic = mp_find_ioapic(gsi);
        if (ioapic < 0) {
@@ -1118,13 +1114,11 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
                if (gsi < MAX_GSI_NUM) {
                        if (gsi > 15)
                                gsi = pci_irq++;
-#ifdef CONFIG_ACPI_BUS
                        /*
                         * Don't assign IRQ used by ACPI SCI
                         */
                        if (gsi == acpi_fadt.sci_int)
                                gsi = pci_irq++;
-#endif
                        gsi_to_irq[irq] = gsi;
                } else {
                        printk(KERN_ERR "GSI %u is too high\n", gsi);
@@ -1138,5 +1132,5 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
        return gsi;
 }
 
-#endif /*CONFIG_X86_IO_APIC && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)*/
-#endif /*CONFIG_ACPI_BOOT*/
+#endif /* CONFIG_X86_IO_APIC */
+#endif /* CONFIG_ACPI */
index af4de58..d52eda3 100644 (file)
@@ -87,14 +87,14 @@ EXPORT_SYMBOL(boot_cpu_data);
 
 unsigned long mmu_cr4_features;
 
-#ifdef CONFIG_ACPI_INTERPRETER
+#ifdef CONFIG_ACPI
        int acpi_disabled = 0;
 #else
        int acpi_disabled = 1;
 #endif
 EXPORT_SYMBOL(acpi_disabled);
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 int __initdata acpi_force = 0;
 extern acpi_interrupt_flags    acpi_sci_flags;
 #endif
@@ -794,7 +794,7 @@ static void __init parse_cmdline_early (char ** cmdline_p)
                }
 #endif
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
                /* "acpi=off" disables both ACPI table parsing and interpreter */
                else if (!memcmp(from, "acpi=off", 8)) {
                        disable_acpi();
@@ -850,7 +850,7 @@ static void __init parse_cmdline_early (char ** cmdline_p)
                else if (!memcmp(from, "noapic", 6))
                        disable_ioapic_setup();
 #endif /* CONFIG_X86_LOCAL_APIC */
-#endif /* CONFIG_ACPI_BOOT */
+#endif /* CONFIG_ACPI */
 
 #ifdef CONFIG_X86_LOCAL_APIC
                /* enable local APIC */
@@ -1575,7 +1575,7 @@ void __init setup_arch(char **cmdline_p)
        if (efi_enabled)
                efi_map_memmap();
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        /*
         * Parse the ACPI tables for possible boot-time SMP configuration.
         */
index d5936d5..f549c0e 100644 (file)
@@ -51,7 +51,7 @@ struct mip_reg                *host_reg;
 int                    mip_port;
 unsigned long          mip_addr, host_addr;
 
-#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT))
+#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI)
 
 /*
  * GSI override for ES7000 platforms.
@@ -73,7 +73,7 @@ es7000_rename_gsi(int ioapic, int gsi)
        return gsi;
 }
 
-#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
+#endif /* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */
 
 /*
  * Parse the OEM Table
index 1bff03f..ead6122 100644 (file)
@@ -5,7 +5,7 @@ obj-$(CONFIG_PCI_MMCONFIG)      += mmconfig.o
 obj-$(CONFIG_PCI_DIRECT)       += direct.o
 
 pci-y                          := fixup.o
-pci-$(CONFIG_ACPI_PCI)         += acpi.o
+pci-$(CONFIG_ACPI)             += acpi.o
 pci-y                          += legacy.o irq.o
 
 pci-$(CONFIG_X86_VISWS)                := visws.o fixup.o
index 86348b6..326a2ed 100644 (file)
@@ -1075,7 +1075,7 @@ static void pirq_penalize_isa_irq(int irq, int active)
 
 void pcibios_penalize_isa_irq(int irq, int active)
 {
-#ifdef CONFIG_ACPI_PCI
+#ifdef CONFIG_ACPI
        if (!acpi_noirq)
                acpi_penalize_isa_irq(irq, active);
        else
index 3deced6..e1c9ea0 100644 (file)
@@ -60,6 +60,7 @@ choice
 
 config IA64_GENERIC
        bool "generic"
+       select ACPI
        select NUMA
        select ACPI_NUMA
        select VIRTUAL_MEM_MAP
@@ -340,6 +341,7 @@ config IA64_PALINFO
 
 config ACPI_DEALLOCATE_IRQ
        bool
+       depends on ACPI
        depends on IOSAPIC && EXPERIMENTAL
        default y
 
@@ -351,38 +353,10 @@ endmenu
 
 menu "Power management and ACPI"
 
-config PM
-       bool "Power Management support"
-       depends on !IA64_HP_SIM
-       default y
-       help
-         "Power Management" means that parts of your computer are shut
-         off or put into a power conserving "sleep" mode if they are not
-         being used.  There are two competing standards for doing this: APM
-         and ACPI.  If you want to use either one, say Y here and then also
-         to the requisite support below.
-
-         Power Management is most important for battery powered laptop
-         computers; if you have a laptop, check out the Linux Laptop home
-         page on the WWW at <http://www.linux-on-laptops.com/> and the
-         Battery Powered Linux mini-HOWTO, available from
-         <http://www.tldp.org/docs.html#howto>.
-
-         Note that, even if you say N here, Linux on the x86 architecture
-         will issue the hlt instruction if nothing is to be done, thereby
-         sending the processor to sleep and saving power.
-
-config ACPI
-       bool
-       depends on !IA64_HP_SIM
-       default y
-
-if !IA64_HP_SIM
+source "kernel/power/Kconfig"
 
 source "drivers/acpi/Kconfig"
 
-endif
-
 if PM
 
 source "arch/ia64/kernel/cpufreq/Kconfig"
index b95fcf8..3b65cbb 100644 (file)
@@ -107,18 +107,12 @@ CONFIG_ACPI=y
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=m
-CONFIG_ACPI_VIDEO=m
 CONFIG_ACPI_FAN=m
 CONFIG_ACPI_PROCESSOR=m
 CONFIG_ACPI_THERMAL=m
-CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 
 #
index dccf35c..1ca6e6e 100644 (file)
@@ -130,19 +130,12 @@ CONFIG_ACPI=y
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 # CONFIG_ACPI_BUTTON is not set
-CONFIG_ACPI_VIDEO=m
-CONFIG_ACPI_HOTKEY=m
 # CONFIG_ACPI_FAN is not set
 # CONFIG_ACPI_PROCESSOR is not set
 CONFIG_ACPI_NUMA=y
-CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
 
index c853cfc..3ec94a1 100644 (file)
@@ -128,20 +128,13 @@ CONFIG_ACPI=y
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=m
-# CONFIG_ACPI_VIDEO is not set
-# CONFIG_ACPI_HOTKEY is not set
 CONFIG_ACPI_FAN=m
 CONFIG_ACPI_PROCESSOR=m
 # CONFIG_ACPI_HOTPLUG_CPU is not set
 CONFIG_ACPI_THERMAL=m
-CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
 
index 88e8867..d4cf73d 100644 (file)
@@ -128,19 +128,12 @@ CONFIG_ACPI=y
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=y
-CONFIG_ACPI_VIDEO=m
-CONFIG_ACPI_HOTKEY=m
 CONFIG_ACPI_FAN=y
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_THERMAL=y
-CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
 
index 8444add..b6ec8d3 100644 (file)
@@ -118,20 +118,14 @@ CONFIG_ACPI=y
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=m
-CONFIG_ACPI_VIDEO=m
 CONFIG_ACPI_FAN=m
 CONFIG_ACPI_PROCESSOR=m
 CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_THERMAL=m
 CONFIG_ACPI_NUMA=y
-CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 CONFIG_ACPI_CONTAINER=m
 
index 2623df5..13a5b3b 100644 (file)
 #include <asm/acpi-ext.h>
 
 struct acpi_vendor_descriptor {
-       u8                              guid_id;
-       efi_guid_t                      guid;
+       u8 guid_id;
+       efi_guid_t guid;
 };
 
 struct acpi_vendor_info {
-       struct acpi_vendor_descriptor   *descriptor;
-       u8                              *data;
-       u32                             length;
+       struct acpi_vendor_descriptor *descriptor;
+       u8 *data;
+       u32 length;
 };
 
 acpi_status
 acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
 {
-       struct acpi_vendor_info *info = (struct acpi_vendor_info *) context;
+       struct acpi_vendor_info *info = (struct acpi_vendor_info *)context;
        struct acpi_resource_vendor *vendor;
        struct acpi_vendor_descriptor *descriptor;
        u32 length;
@@ -38,8 +38,8 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
        if (resource->id != ACPI_RSTYPE_VENDOR)
                return AE_OK;
 
-       vendor = (struct acpi_resource_vendor *) &resource->data;
-       descriptor = (struct acpi_vendor_descriptor *) vendor->reserved;
+       vendor = (struct acpi_resource_vendor *)&resource->data;
+       descriptor = (struct acpi_vendor_descriptor *)vendor->reserved;
        if (vendor->length <= sizeof(*info->descriptor) ||
            descriptor->guid_id != info->descriptor->guid_id ||
            efi_guidcmp(descriptor->guid, info->descriptor->guid))
@@ -50,21 +50,24 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
        if (!info->data)
                return AE_NO_MEMORY;
 
-       memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length);
+       memcpy(info->data,
+              vendor->reserved + sizeof(struct acpi_vendor_descriptor),
+              length);
        info->length = length;
        return AE_CTRL_TERMINATE;
 }
 
 acpi_status
-acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
-               u8 **data, u32 *length)
+acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
+                         u8 ** data, u32 * length)
 {
        struct acpi_vendor_info info;
 
        info.descriptor = id;
        info.data = NULL;
 
-       acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info);
+       acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match,
+                           &info);
        if (!info.data)
                return AE_NOT_FOUND;
 
@@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
 
 struct acpi_vendor_descriptor hp_ccsr_descriptor = {
        .guid_id = 2,
-       .guid    = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
+       .guid =
+           EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
+                    0x37, 0x0e, 0xad)
 };
 
-acpi_status
-hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
+acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length)
 {
        acpi_status status;
        u8 *data;
        u32 length;
 
-       status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
+       status =
+           acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
 
        if (ACPI_FAILURE(status) || length != 16)
                return AE_NOT_FOUND;
index 9609f24..318787c 100644 (file)
@@ -74,12 +74,11 @@ unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
 #define MAX_SAPICS 256
-u16 ia64_acpiid_to_sapicid[MAX_SAPICS] =
-       { [0 ... MAX_SAPICS - 1] = -1 };
+u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = {[0 ... MAX_SAPICS - 1] = -1 };
+
 EXPORT_SYMBOL(ia64_acpiid_to_sapicid);
 
-const char *
-acpi_get_sysname (void)
+const char *acpi_get_sysname(void)
 {
 #ifdef CONFIG_IA64_GENERIC
        unsigned long rsdp_phys;
@@ -89,27 +88,29 @@ acpi_get_sysname (void)
 
        rsdp_phys = acpi_find_rsdp();
        if (!rsdp_phys) {
-               printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 RSDP not found, default to \"dig\"\n");
                return "dig";
        }
 
-       rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys);
+       rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys);
        if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
-               printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
                return "dig";
        }
 
-       xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address);
+       xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
        hdr = &xsdt->header;
        if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
-               printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
                return "dig";
        }
 
        if (!strcmp(hdr->oem_id, "HP")) {
                return "hpzx1";
-       }
-       else if (!strcmp(hdr->oem_id, "SGI")) {
+       } else if (!strcmp(hdr->oem_id, "SGI")) {
                return "sn2";
        }
 
@@ -131,7 +132,7 @@ acpi_get_sysname (void)
 #endif
 }
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 
 #define ACPI_MAX_PLATFORM_INTERRUPTS   256
 
@@ -146,8 +147,7 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
  * Interrupt routing API for device drivers.  Provides interrupt vector for
  * a generic platform event.  Currently only CPEI is implemented.
  */
-int
-acpi_request_vector (u32 int_type)
+int acpi_request_vector(u32 int_type)
 {
        int vector = -1;
 
@@ -155,12 +155,12 @@ acpi_request_vector (u32 int_type)
                /* corrected platform error interrupt */
                vector = platform_intr_list[int_type];
        } else
-               printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
+               printk(KERN_ERR
+                      "acpi_request_vector(): invalid interrupt type\n");
        return vector;
 }
 
-char *
-__acpi_map_table (unsigned long phys_addr, unsigned long size)
+char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
 {
        return __va(phys_addr);
 }
@@ -169,19 +169,18 @@ __acpi_map_table (unsigned long phys_addr, unsigned long size)
                             Boot-time Table Parsing
    -------------------------------------------------------------------------- */
 
-static int                     total_cpus __initdata;
-static int                     available_cpus __initdata;
-struct acpi_table_madt *       acpi_madt __initdata;
-static u8                      has_8259;
-
+static int total_cpus __initdata;
+static int available_cpus __initdata;
+struct acpi_table_madt *acpi_madt __initdata;
+static u8 has_8259;
 
 static int __init
-acpi_parse_lapic_addr_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+                         const unsigned long end)
 {
        struct acpi_table_lapic_addr_ovr *lapic;
 
-       lapic = (struct acpi_table_lapic_addr_ovr *) header;
+       lapic = (struct acpi_table_lapic_addr_ovr *)header;
 
        if (BAD_MADT_ENTRY(lapic, end))
                return -EINVAL;
@@ -193,22 +192,23 @@ acpi_parse_lapic_addr_ovr (
        return 0;
 }
 
-
 static int __init
-acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lsapic *lsapic;
 
-       lsapic = (struct acpi_table_lsapic *) header;
+       lsapic = (struct acpi_table_lsapic *)header;
 
        if (BAD_MADT_ENTRY(lsapic, end))
                return -EINVAL;
 
        if (lsapic->flags.enabled) {
 #ifdef CONFIG_SMP
-               smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
+               smp_boot_data.cpu_phys_id[available_cpus] =
+                   (lsapic->id << 8) | lsapic->eid;
 #endif
-               ia64_acpiid_to_sapicid[lsapic->acpi_id] = (lsapic->id << 8) | lsapic->eid;
+               ia64_acpiid_to_sapicid[lsapic->acpi_id] =
+                   (lsapic->id << 8) | lsapic->eid;
                ++available_cpus;
        }
 
@@ -216,13 +216,12 @@ acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-
 static int __init
-acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lapic_nmi *lacpi_nmi;
 
-       lacpi_nmi = (struct acpi_table_lapic_nmi*) header;
+       lacpi_nmi = (struct acpi_table_lapic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lacpi_nmi, end))
                return -EINVAL;
@@ -231,13 +230,12 @@ acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-
 static int __init
-acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_iosapic *iosapic;
 
-       iosapic = (struct acpi_table_iosapic *) header;
+       iosapic = (struct acpi_table_iosapic *)header;
 
        if (BAD_MADT_ENTRY(iosapic, end))
                return -EINVAL;
@@ -245,15 +243,14 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
        return iosapic_init(iosapic->address, iosapic->global_irq_base);
 }
 
-
 static int __init
-acpi_parse_plat_int_src (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_plat_int_src(acpi_table_entry_header * header,
+                       const unsigned long end)
 {
        struct acpi_table_plat_int_src *plintsrc;
        int vector;
 
-       plintsrc = (struct acpi_table_plat_int_src *) header;
+       plintsrc = (struct acpi_table_plat_int_src *)header;
 
        if (BAD_MADT_ENTRY(plintsrc, end))
                return -EINVAL;
@@ -267,8 +264,12 @@ acpi_parse_plat_int_src (
                                                plintsrc->iosapic_vector,
                                                plintsrc->eid,
                                                plintsrc->id,
-                                               (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                                               (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                               (plintsrc->flags.polarity ==
+                                                1) ? IOSAPIC_POL_HIGH :
+                                               IOSAPIC_POL_LOW,
+                                               (plintsrc->flags.trigger ==
+                                                1) ? IOSAPIC_EDGE :
+                                               IOSAPIC_LEVEL);
 
        platform_intr_list[plintsrc->type] = vector;
        if (acpi_madt_rev > 1) {
@@ -283,7 +284,6 @@ acpi_parse_plat_int_src (
        return 0;
 }
 
-
 unsigned int can_cpei_retarget(void)
 {
        extern int cpe_vector;
@@ -322,29 +322,30 @@ unsigned int get_cpei_target_cpu(void)
 }
 
 static int __init
-acpi_parse_int_src_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+                      const unsigned long end)
 {
        struct acpi_table_int_src_ovr *p;
 
-       p = (struct acpi_table_int_src_ovr *) header;
+       p = (struct acpi_table_int_src_ovr *)header;
 
        if (BAD_MADT_ENTRY(p, end))
                return -EINVAL;
 
        iosapic_override_isa_irq(p->bus_irq, p->global_irq,
-                                (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                                (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                (p->flags.polarity ==
+                                 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
+                                (p->flags.trigger ==
+                                 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
        return 0;
 }
 
-
 static int __init
-acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_nmi_src *nmi_src;
 
-       nmi_src = (struct acpi_table_nmi_src*) header;
+       nmi_src = (struct acpi_table_nmi_src *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -353,11 +354,9 @@ acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-static void __init
-acpi_madt_oem_check (char *oem_id, char *oem_table_id)
+static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
-       if (!strncmp(oem_id, "IBM", 3) &&
-           (!strncmp(oem_table_id, "SERMOW", 6))) {
+       if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERMOW", 6))) {
 
                /*
                 * Unfortunately ITC_DRIFT is not yet part of the
@@ -370,19 +369,18 @@ acpi_madt_oem_check (char *oem_id, char *oem_table_id)
        }
 }
 
-static int __init
-acpi_parse_madt (unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 {
        if (!phys_addr || !size)
                return -EINVAL;
 
-       acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
+       acpi_madt = (struct acpi_table_madt *)__va(phys_addr);
 
        acpi_madt_rev = acpi_madt->header.revision;
 
        /* remember the value for reference after free_initmem() */
 #ifdef CONFIG_ITANIUM
-       has_8259 = 1; /* Firmware on old Itanium systems is broken */
+       has_8259 = 1;           /* Firmware on old Itanium systems is broken */
 #else
        has_8259 = acpi_madt->flags.pcat_compat;
 #endif
@@ -396,19 +394,18 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
        printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
 
        acpi_madt_oem_check(acpi_madt->header.oem_id,
-               acpi_madt->header.oem_table_id);
+                           acpi_madt->header.oem_table_id);
 
        return 0;
 }
 
-
 #ifdef CONFIG_ACPI_NUMA
 
 #undef SLIT_DEBUG
 
 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
 
-static int __initdata srat_num_cpus;                   /* number of cpus */
+static int __initdata srat_num_cpus;   /* number of cpus */
 static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
 #define pxm_bit_set(bit)       (set_bit(bit,(void *)pxm_flag))
 #define pxm_bit_test(bit)      (test_bit(bit,(void *)pxm_flag))
@@ -421,15 +418,15 @@ static struct acpi_table_slit __initdata *slit_table;
  * ACPI 2.0 SLIT (System Locality Information Table)
  * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
  */
-void __init
-acpi_numa_slit_init (struct acpi_table_slit *slit)
+void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 {
        u32 len;
 
        len = sizeof(struct acpi_table_header) + 8
-               + slit->localities * slit->localities;
+           + slit->localities * slit->localities;
        if (slit->header.length != len) {
-               printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
+               printk(KERN_ERR
+                      "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
                       len, slit->header.length);
                memset(numa_slit, 10, sizeof(numa_slit));
                return;
@@ -438,19 +435,20 @@ acpi_numa_slit_init (struct acpi_table_slit *slit)
 }
 
 void __init
-acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
+acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
 {
        /* record this node in proximity bitmap */
        pxm_bit_set(pa->proximity_domain);
 
-       node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid);
+       node_cpuid[srat_num_cpus].phys_id =
+           (pa->apic_id << 8) | (pa->lsapic_eid);
        /* nid should be overridden as logical node id later */
        node_cpuid[srat_num_cpus].nid = pa->proximity_domain;
        srat_num_cpus++;
 }
 
 void __init
-acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
+acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
 {
        unsigned long paddr, size;
        u8 pxm;
@@ -487,8 +485,7 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
        num_node_memblks++;
 }
 
-void __init
-acpi_numa_arch_fixup (void)
+void __init acpi_numa_arch_fixup(void)
 {
        int i, j, node_from, node_to;
 
@@ -534,21 +531,24 @@ acpi_numa_arch_fixup (void)
        for (i = 0; i < srat_num_cpus; i++)
                node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
 
-       printk(KERN_INFO "Number of logical nodes in system = %d\n", num_online_nodes());
-       printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
+       printk(KERN_INFO "Number of logical nodes in system = %d\n",
+              num_online_nodes());
+       printk(KERN_INFO "Number of memory chunks in system = %d\n",
+              num_node_memblks);
 
-       if (!slit_table) return;
+       if (!slit_table)
+               return;
        memset(numa_slit, -1, sizeof(numa_slit));
-       for (i=0; i<slit_table->localities; i++) {
+       for (i = 0; i < slit_table->localities; i++) {
                if (!pxm_bit_test(i))
                        continue;
                node_from = pxm_to_nid_map[i];
-               for (j=0; j<slit_table->localities; j++) {
+               for (j = 0; j < slit_table->localities; j++) {
                        if (!pxm_bit_test(j))
                                continue;
                        node_to = pxm_to_nid_map[j];
                        node_distance(node_from, node_to) =
-                               slit_table->entry[i*slit_table->localities + j];
+                           slit_table->entry[i * slit_table->localities + j];
                }
        }
 
@@ -556,36 +556,43 @@ acpi_numa_arch_fixup (void)
        printk("ACPI 2.0 SLIT locality table:\n");
        for_each_online_node(i) {
                for_each_online_node(j)
-                       printk("%03d ", node_distance(i,j));
+                   printk("%03d ", node_distance(i, j));
                printk("\n");
        }
 #endif
 }
-#endif /* CONFIG_ACPI_NUMA */
+#endif                         /* CONFIG_ACPI_NUMA */
 
-unsigned int
-acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
 {
        if (has_8259 && gsi < 16)
                return isa_irq_to_vector(gsi);
 
        return iosapic_register_intr(gsi,
-                       (active_high_low == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                       (edge_level == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                    (active_high_low ==
+                                     ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH :
+                                    IOSAPIC_POL_LOW,
+                                    (edge_level ==
+                                     ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE :
+                                    IOSAPIC_LEVEL);
 }
+
 EXPORT_SYMBOL(acpi_register_gsi);
 
 #ifdef CONFIG_ACPI_DEALLOCATE_IRQ
-void
-acpi_unregister_gsi (u32 gsi)
+void acpi_unregister_gsi(u32 gsi)
 {
        iosapic_unregister_intr(gsi);
 }
+
 EXPORT_SYMBOL(acpi_unregister_gsi);
-#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
+#endif                         /* CONFIG_ACPI_DEALLOCATE_IRQ */
 
-static int __init
-acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
 {
        struct acpi_table_header *fadt_header;
        struct fadt_descriptor_rev2 *fadt;
@@ -593,11 +600,11 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
        if (!phys_addr || !size)
                return -EINVAL;
 
-       fadt_header = (struct acpi_table_header *) __va(phys_addr);
+       fadt_header = (struct acpi_table_header *)__va(phys_addr);
        if (fadt_header->revision != 3)
-               return -ENODEV;         /* Only deal with ACPI 2.0 FADT */
+               return -ENODEV; /* Only deal with ACPI 2.0 FADT */
 
-       fadt = (struct fadt_descriptor_rev2 *) fadt_header;
+       fadt = (struct fadt_descriptor_rev2 *)fadt_header;
 
        if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
                acpi_kbd_controller_present = 0;
@@ -609,22 +616,19 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
        return 0;
 }
 
-
-unsigned long __init
-acpi_find_rsdp (void)
+unsigned long __init acpi_find_rsdp(void)
 {
        unsigned long rsdp_phys = 0;
 
        if (efi.acpi20)
                rsdp_phys = __pa(efi.acpi20);
        else if (efi.acpi)
-               printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n");
+               printk(KERN_WARNING PREFIX
+                      "v1.0/r0.71 tables no longer supported\n");
        return rsdp_phys;
 }
 
-
-int __init
-acpi_boot_init (void)
+int __init acpi_boot_init(void)
 {
 
        /*
@@ -642,31 +646,43 @@ acpi_boot_init (void)
 
        /* Local APIC */
 
-       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
-               printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing LAPIC address override entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
-               printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries\n");
+       if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS)
+           < 1)
+               printk(KERN_ERR PREFIX
+                      "Error parsing MADT - no LAPIC entries\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
+       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0)
+           < 0)
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 
        /* I/O APIC */
 
-       if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
-               printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
+               printk(KERN_ERR PREFIX
+                      "Error parsing MADT - no IOSAPIC entries\n");
 
        /* System-Level Interrupt Routing */
 
-       if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
-               printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src,
+            ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing platform interrupt source entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
-               printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing interrupt source overrides entry\n");
 
        if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
-  skip_madt:
+      skip_madt:
 
        /*
         * FADT says whether a legacy keyboard controller is present.
@@ -681,8 +697,9 @@ acpi_boot_init (void)
        if (available_cpus == 0) {
                printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
                printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id());
-               smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id();
-               available_cpus = 1; /* We've got at least one of these, no? */
+               smp_boot_data.cpu_phys_id[available_cpus] =
+                   hard_smp_processor_id();
+               available_cpus = 1;     /* We've got at least one of these, no? */
        }
        smp_boot_data.cpu_count = available_cpus;
 
@@ -691,8 +708,10 @@ acpi_boot_init (void)
        if (srat_num_cpus == 0) {
                int cpu, i = 1;
                for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
-                       if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
-                               node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
+                       if (smp_boot_data.cpu_phys_id[cpu] !=
+                           hard_smp_processor_id())
+                               node_cpuid[i++].phys_id =
+                                   smp_boot_data.cpu_phys_id[cpu];
        }
 # endif
 #endif
@@ -700,12 +719,12 @@ acpi_boot_init (void)
        build_cpu_to_node_map();
 #endif
        /* Make boot-up look pretty */
-       printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
+       printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus,
+              total_cpus);
        return 0;
 }
 
-int
-acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
+int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
        int vector;
 
@@ -726,11 +745,10 @@ acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
  */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
 static
-int
-acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
+int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
 {
 #ifdef CONFIG_ACPI_NUMA
-       int                     pxm_id;
+       int pxm_id;
 
        pxm_id = acpi_get_pxm(handle);
 
@@ -738,31 +756,28 @@ acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
         * Assuming that the container driver would have set the proximity
         * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag
         */
-       node_cpuid[cpu].nid = (pxm_id < 0) ? 0:
-                       pxm_to_nid_map[pxm_id];
+       node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_nid_map[pxm_id];
 
-       node_cpuid[cpu].phys_id =  physid;
+       node_cpuid[cpu].phys_id = physid;
 #endif
-       return(0);
+       return (0);
 }
 
-
-int
-acpi_map_lsapic(acpi_handle handle, int *pcpu)
+int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
        struct acpi_table_lsapic *lsapic;
        cpumask_t tmp_map;
        long physid;
        int cpu;
+
        if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
                return -EINVAL;
 
-       if (!buffer.length ||  !buffer.pointer)
+       if (!buffer.length || !buffer.pointer)
                return -EINVAL;
+
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*lsapic)) {
@@ -778,7 +793,7 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu)
                return -EINVAL;
        }
 
-       physid = ((lsapic->id <<8) | (lsapic->eid));
+       physid = ((lsapic->id << 8) | (lsapic->eid));
 
        acpi_os_free(buffer.pointer);
        buffer.length = ACPI_ALLOCATE_BUFFER;
@@ -786,50 +801,49 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        cpus_complement(tmp_map, cpu_present_map);
        cpu = first_cpu(tmp_map);
-       if(cpu >= NR_CPUS)
+       if (cpu >= NR_CPUS)
                return -EINVAL;
 
        acpi_map_cpu2node(handle, cpu, physid);
 
-       cpu_set(cpu, cpu_present_map);
+       cpu_set(cpu, cpu_present_map);
        ia64_cpu_to_sapicid[cpu] = physid;
        ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu];
 
        *pcpu = cpu;
-       return(0);
+       return (0);
 }
-EXPORT_SYMBOL(acpi_map_lsapic);
 
+EXPORT_SYMBOL(acpi_map_lsapic);
 
-int
-acpi_unmap_lsapic(int cpu)
+int acpi_unmap_lsapic(int cpu)
 {
        int i;
 
-       for (i=0; i<MAX_SAPICS; i++) {
-               if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
-                       ia64_acpiid_to_sapicid[i] = -1;
-                       break;
-               }
-       }
+       for (i = 0; i < MAX_SAPICS; i++) {
+               if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
+                       ia64_acpiid_to_sapicid[i] = -1;
+                       break;
+               }
+       }
        ia64_cpu_to_sapicid[cpu] = -1;
-       cpu_clear(cpu,cpu_present_map);
+       cpu_clear(cpu, cpu_present_map);
 
 #ifdef CONFIG_ACPI_NUMA
        /* NUMA specific cleanup's */
 #endif
 
-       return(0);
+       return (0);
 }
+
 EXPORT_SYMBOL(acpi_unmap_lsapic);
-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+#endif                         /* CONFIG_ACPI_HOTPLUG_CPU */
 
 #ifdef CONFIG_ACPI_NUMA
 acpi_status __devinit
-acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
+acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
 {
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
        struct acpi_table_iosapic *iosapic;
        unsigned int gsi_base;
@@ -878,10 +892,9 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
        map_iosapic_to_node(gsi_base, node);
        return AE_OK;
 }
-#endif /* CONFIG_NUMA */
+#endif                         /* CONFIG_NUMA */
 
-int
-acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
+int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
 {
        int err;
 
@@ -890,17 +903,18 @@ acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
 
 #if CONFIG_ACPI_NUMA
        acpi_map_iosapic(handle, 0, NULL, NULL);
-#endif /* CONFIG_ACPI_NUMA */
+#endif                         /* CONFIG_ACPI_NUMA */
 
        return 0;
 }
+
 EXPORT_SYMBOL(acpi_register_ioapic);
 
-int
-acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
+int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 {
        return iosapic_remove(gsi_base);
 }
+
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
-#endif /* CONFIG_ACPI_BOOT */
+#endif                         /* CONFIG_ACPI */
index 7936b62..a13df59 100644 (file)
@@ -561,7 +561,7 @@ static inline int vector_is_shared (int vector)
        return (iosapic_intr_info[vector].count > 1);
 }
 
-static void
+static int
 register_intr (unsigned int gsi, int vector, unsigned char delivery,
               unsigned long polarity, unsigned long trigger)
 {
@@ -576,7 +576,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
        index = find_iosapic(gsi);
        if (index < 0) {
                printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi);
-               return;
+               return -ENODEV;
        }
 
        iosapic_address = iosapic_lists[index].addr;
@@ -587,7 +587,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                rte = iosapic_alloc_rte();
                if (!rte) {
                        printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__);
-                       return;
+                       return -ENOMEM;
                }
 
                rte_index = gsi - gsi_base;
@@ -603,7 +603,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                struct iosapic_intr_info *info = &iosapic_intr_info[vector];
                if (info->trigger != trigger || info->polarity != polarity) {
                        printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__);
-                       return;
+                       return -EINVAL;
                }
        }
 
@@ -623,6 +623,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
                               __FUNCTION__, vector, idesc->handler->typename, irq_type->typename);
                idesc->handler = irq_type;
        }
+       return 0;
 }
 
 static unsigned int
@@ -710,7 +711,7 @@ int
 iosapic_register_intr (unsigned int gsi,
                       unsigned long polarity, unsigned long trigger)
 {
-       int vector, mask = 1;
+       int vector, mask = 1, err;
        unsigned int dest;
        unsigned long flags;
        struct iosapic_rte_info *rte;
@@ -737,8 +738,8 @@ again:
        vector = assign_irq_vector(AUTO_ASSIGN);
        if (vector < 0) {
                vector = iosapic_find_sharable_vector(trigger, polarity);
-               if (vector < 0)
-                       panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+               if (vector < 0)
+                       return -ENOSPC;
        }
 
        spin_lock_irqsave(&irq_descp(vector)->lock, flags);
@@ -753,8 +754,13 @@ again:
                }
 
                dest = get_target_cpu(gsi, vector);
-               register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
+               err = register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
                              polarity, trigger);
+               if (err < 0) {
+                       spin_unlock(&iosapic_lock);
+                       spin_unlock_irqrestore(&irq_descp(vector)->lock, flags);
+                       return err;
+               }
 
                /*
                 * If the vector is shared and already unmasked for
index 84f89da..1f5c26d 100644 (file)
@@ -384,7 +384,7 @@ setup_arch (char **cmdline_p)
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        /* Initialize the ACPI boot-time table parser */
        acpi_table_init();
 # ifdef CONFIG_ACPI_NUMA
@@ -420,7 +420,7 @@ setup_arch (char **cmdline_p)
 
        cpu_init();     /* initialize the bootstrap CPU */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        acpi_boot_init();
 #endif
 
index 92ff46a..706b773 100644 (file)
@@ -36,7 +36,7 @@ int arch_register_cpu(int num)
        parent = &sysfs_nodes[cpu_to_node(num)];
 #endif /* CONFIG_NUMA */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        /*
         * If CPEI cannot be re-targetted, and this is
         * CPEI target, then dont create the control file
index 9fc7463..01d18b7 100644 (file)
@@ -23,7 +23,7 @@ static void force_interrupt(int irq);
 static void register_intr_pda(struct sn_irq_info *sn_irq_info);
 static void unregister_intr_pda(struct sn_irq_info *sn_irq_info);
 
-extern int sn_force_interrupt_flag;
+int sn_force_interrupt_flag = 1;
 extern int sn_ioif_inited;
 static struct list_head **sn_irq_lh;
 static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */
index 51bf827..a06719d 100644 (file)
@@ -52,7 +52,7 @@ static int licenseID_open(struct inode *inode, struct file *file)
  * the bridge chip.  The hardware will then send an interrupt message if the
  * interrupt line is active.  This mimics a level sensitive interrupt.
  */
-int sn_force_interrupt_flag = 1;
+extern int sn_force_interrupt_flag;
 
 static int sn_force_interrupt_show(struct seq_file *s, void *p)
 {
index 660a03a..40242c6 100644 (file)
@@ -144,7 +144,6 @@ config X86_CPUID
          with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
          /dev/cpu/31/cpuid.
 
-# disable it for opteron optimized builds because it pulls in ACPI_BOOT
 config X86_HT
        bool
        depends on SMP && !MK8
@@ -461,7 +460,6 @@ config PCI_DIRECT
 config PCI_MMCONFIG
        bool "Support mmconfig PCI config space access"
        depends on PCI && ACPI
-       select ACPI_BOOT
 
 config UNORDERED_IO
        bool "Unordered IO mapping access"
index b97a61e..bf57e23 100644 (file)
@@ -135,8 +135,6 @@ CONFIG_PM_STD_PARTITION=""
 # ACPI (Advanced Configuration and Power Interface) Support
 #
 CONFIG_ACPI=y
-CONFIG_ACPI_BOOT=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_AC=y
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
@@ -151,10 +149,8 @@ CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_TOSHIBA=y
 CONFIG_ACPI_BLACKLIST_YEAR=2001
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_BUS=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
-CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
 
index 48f9e2c..0296ca6 100644 (file)
@@ -12,7 +12,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
 obj-$(CONFIG_X86_MCE)         += mce.o
 obj-$(CONFIG_X86_MCE_INTEL)    += mce_intel.o
 obj-$(CONFIG_MTRR)             += ../../i386/kernel/cpu/mtrr/
-obj-$(CONFIG_ACPI_BOOT)                += acpi/
+obj-$(CONFIG_ACPI)             += acpi/
 obj-$(CONFIG_X86_MSR)          += msr.o
 obj-$(CONFIG_MICROCODE)                += microcode.o
 obj-$(CONFIG_X86_CPUID)                += cpuid.o
index d2c2ee5..7da9ace 100644 (file)
@@ -1,3 +1,3 @@
-obj-$(CONFIG_ACPI_BOOT)                := boot.o
-boot-$(CONFIG_ACPI_BOOT)       := ../../../i386/kernel/acpi/boot.o
+obj-y                  := boot.o
+boot-y                 := ../../../i386/kernel/acpi/boot.o
 obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
index 7a275de..148f6f7 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/proto.h>
 #include <asm/tlbflush.h>
 
-
 /* --------------------------------------------------------------------------
                               Low-Level Sleep Support
    -------------------------------------------------------------------------- */
@@ -77,11 +76,12 @@ static void init_low_mapping(void)
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  */
-int acpi_save_state_mem (void)
+int acpi_save_state_mem(void)
 {
        init_low_mapping();
 
-       memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
+       memcpy((void *)acpi_wakeup_address, &wakeup_start,
+              &wakeup_end - &wakeup_start);
        acpi_copy_wakeup_routine(acpi_wakeup_address);
 
        return 0;
@@ -90,7 +90,7 @@ int acpi_save_state_mem (void)
 /*
  * acpi_restore_state
  */
-void acpi_restore_state_mem (void)
+void acpi_restore_state_mem(void)
 {
        set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
        flush_tlb_all();
@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void)
 {
        acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
-               printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
+               printk(KERN_CRIT
+                      "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
 }
 
 static int __init acpi_sleep_setup(char *str)
@@ -127,6 +128,8 @@ static int __init acpi_sleep_setup(char *str)
 
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-#endif /*CONFIG_ACPI_SLEEP*/
+#endif                         /*CONFIG_ACPI_SLEEP */
 
-void acpi_pci_link_exit(void) {}
+void acpi_pci_link_exit(void)
+{
+}
index 30c843a..f031358 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/smp.h>
 #include <asm/ipi.h>
 
-#if defined(CONFIG_ACPI_BUS)
+#if defined(CONFIG_ACPI)
 #include <acpi/acpi_bus.h>
 #endif
 
@@ -47,7 +47,7 @@ void __init clustered_apic_check(void)
        u8 cluster_cnt[NUM_APIC_CLUSTERS];
        int num_cpus = 0;
 
-#if defined(CONFIG_ACPI_BUS)
+#if defined(CONFIG_ACPI)
        /*
         * Some x86_64 machines use physical APIC mode regardless of how many
         * procs/clusters are present (x86_64 ES7000 is an example).
index d206d7e..1013a8f 100644 (file)
@@ -1841,7 +1841,7 @@ device_initcall(ioapic_init_sysfs);
                           ACPI-based IOAPIC Configuration
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 
 #define IO_APIC_MAX_ID         0xFE
 
@@ -1923,7 +1923,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
        return 0;
 }
 
-#endif /*CONFIG_ACPI_BOOT*/
+#endif /* CONFIG_ACPI */
 
 
 /*
index 79c362d..8d8ed6a 100644 (file)
@@ -74,7 +74,7 @@ static unsigned int num_processors = 0;
 physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
 
 /* ACPI MADT entry parsing functions */
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 extern struct acpi_boot_flags acpi_boot;
 #ifdef CONFIG_X86_LOCAL_APIC
 extern int acpi_parse_lapic (acpi_table_entry_header *header);
@@ -84,7 +84,7 @@ extern int acpi_parse_lapic_nmi (acpi_table_entry_header *header);
 #ifdef CONFIG_X86_IO_APIC
 extern int acpi_parse_ioapic (acpi_table_entry_header *header);
 #endif /*CONFIG_X86_IO_APIC*/
-#endif /*CONFIG_ACPI_BOOT*/
+#endif /*CONFIG_ACPI*/
 
 u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
 
@@ -519,8 +519,6 @@ void __init get_smp_config (void)
        struct intel_mp_floating *mpf = mpf_found;
 
        /*
-        * ACPI may be used to obtain the entire SMP configuration or just to 
-        * enumerate/configure processors (CONFIG_ACPI_BOOT).  Note that 
         * ACPI supports both logical (e.g. Hyper-Threading) and physical 
         * processors, where MPS only supports physical.
         */
@@ -673,7 +671,7 @@ void __init find_smp_config (void)
                             ACPI-based MP Configuration
    -------------------------------------------------------------------------- */
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 
 void __init mp_register_lapic_address (
        u64                     address)
@@ -929,11 +927,9 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
        if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
                return gsi;
 
-#ifdef CONFIG_ACPI_BUS
        /* Don't set up the ACPI SCI because it's already set up */
        if (acpi_fadt.sci_int == gsi)
                return gsi;
-#endif
 
        ioapic = mp_find_ioapic(gsi);
        if (ioapic < 0) {
@@ -973,13 +969,11 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
                if (gsi < MAX_GSI_NUM) {
                        if (gsi > 15)
                                gsi = pci_irq++;
-#ifdef CONFIG_ACPI_BUS
                        /*
                         * Don't assign IRQ used by ACPI SCI
                         */
                        if (gsi == acpi_fadt.sci_int)
                                gsi = pci_irq++;
-#endif
                        gsi_to_irq[irq] = gsi;
                } else {
                        printk(KERN_ERR "GSI %u is too high\n", gsi);
@@ -994,4 +988,4 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
 }
 
 #endif /*CONFIG_X86_IO_APIC*/
-#endif /*CONFIG_ACPI_BOOT*/
+#endif /*CONFIG_ACPI*/
index 116a491..cfcebc8 100644 (file)
@@ -71,7 +71,7 @@ unsigned long mmu_cr4_features;
 
 int acpi_disabled;
 EXPORT_SYMBOL(acpi_disabled);
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 extern int __initdata acpi_ht;
 extern acpi_interrupt_flags    acpi_sci_flags;
 int __initdata acpi_force = 0;
@@ -294,7 +294,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
                        maxcpus = simple_strtoul(from + 8, NULL, 0);
                }
 #endif
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
                /* "acpi=off" disables both ACPI table parsing and interpreter init */
                if (!memcmp(from, "acpi=off", 8))
                        disable_acpi();
@@ -566,7 +566,7 @@ void __init setup_arch(char **cmdline_p)
 
        init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        /*
         * Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
         * Call this early for SRAT node setup.
@@ -658,7 +658,7 @@ void __init setup_arch(char **cmdline_p)
 
        check_ioapic();
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
        /*
         * Read APIC and some other early information from ACPI tables.
         */
index 37c92e8..bb34e5e 100644 (file)
@@ -8,7 +8,7 @@ CFLAGS += -Iarch/i386/pci
 obj-y          := i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o
 obj-y          += fixup.o
-obj-$(CONFIG_ACPI_PCI) += acpi.o
+obj-$(CONFIG_ACPI)     += acpi.o
 obj-y                  += legacy.o irq.o common.o
 # mmconfig has a 64bit special
 obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o
index 291985f..4f0c05a 100644 (file)
@@ -8,7 +8,7 @@ CFLAGS += -I arch/i386/pci
 obj-y          := i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o
 obj-y          += fixup.o
-obj-$(CONFIG_ACPI_PCI) += acpi.o
+obj-$(CONFIG_ACPI)     += acpi.o
 obj-y                  += legacy.o irq.o common.o
 # mmconfig has a 64bit special
 obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o
index 9663132..86c8654 100644 (file)
@@ -8,7 +8,7 @@
 obj-$(CONFIG_PCI)              += pci/
 obj-$(CONFIG_PARISC)           += parisc/
 obj-y                          += video/
-obj-$(CONFIG_ACPI_BOOT)                += acpi/
+obj-$(CONFIG_ACPI)             += acpi/
 # PnP must come after ACPI since it will eventually need to check if acpi
 # was used and do nothing if so
 obj-$(CONFIG_PNP)              += pnp/
index ba13896..3998c9d 100644 (file)
@@ -3,7 +3,6 @@
 #
 
 menu "ACPI (Advanced Configuration and Power Interface) Support"
-       depends on PM
        depends on !X86_VISWS
        depends on !IA64_HP_SIM
        depends on IA64 || X86
@@ -11,6 +10,8 @@ menu "ACPI (Advanced Configuration and Power Interface) Support"
 config ACPI
        bool "ACPI Support"
        depends on IA64 || X86
+       select PM
+       select PCI
 
        default y
        ---help---
@@ -43,20 +44,10 @@ config ACPI
 
 if ACPI
 
-config ACPI_BOOT
-       bool
-       default y
-
-config ACPI_INTERPRETER
-       bool
-       default y
-
-if ACPI_INTERPRETER
-
 config ACPI_SLEEP
-       bool "Sleep States (EXPERIMENTAL)"
+       bool "Sleep States"
        depends on X86 && (!SMP || SUSPEND_SMP)
-       depends on EXPERIMENTAL && PM
+       depends on PM
        default y
        ---help---
          This option adds support for ACPI suspend states. 
@@ -90,16 +81,16 @@ config ACPI_SLEEP_PROC_SLEEP
 config ACPI_AC
        tristate "AC Adapter"
        depends on X86
-       default m
+       default y
        help
          This driver adds support for the AC Adapter object, which indicates
-         whether a system is on AC, or not.  Typically, only mobile systems 
-         have this object, since desktops are always on AC.
+         whether a system is on AC, or not. If you have a system that can
+         switch between A/C and battery, say Y.
 
 config ACPI_BATTERY
        tristate "Battery"
        depends on X86
-       default m
+       default y
        help
          This driver adds support for battery information through
          /proc/acpi/battery. If you have a mobile system with a battery, 
@@ -107,18 +98,17 @@ config ACPI_BATTERY
 
 config ACPI_BUTTON
        tristate "Button"
-       default m
+       default y
        help
-         This driver registers for events based on buttons, such as the
-         power, sleep, and lid switch.  In the future, a daemon will read
-         /proc/acpi/event and perform user-defined actions such as shutting
-         down the system.  Until then, you can cat it, and see output when
-         a button is pressed.
+         This driver handles events on the power, sleep and lid buttons.
+         A daemon reads /proc/acpi/event and perform user-defined actions
+         such as shutting down the system.  This is necessary for
+         software controlled poweroff.
 
 config ACPI_VIDEO
        tristate "Video"
-       depends on EXPERIMENTAL
-       default m
+       depends on X86
+       default y
        help
          This driver implement the ACPI Extensions For Display Adapters
          for integrated graphics devices on motherboard, as specified in
@@ -129,10 +119,9 @@ config ACPI_VIDEO
          for your integrated video device.
 
 config ACPI_HOTKEY
-       tristate "Generic Hotkey"
-       depends on ACPI_INTERPRETER
+       tristate "Generic Hotkey (EXPERIMENTAL)"
        depends on EXPERIMENTAL
-       depends on !IA64_SGI_SN
+       depends on X86
        default n
        help
          Experimental consolidated hotkey driver.
@@ -140,31 +129,30 @@ config ACPI_HOTKEY
 
 config ACPI_FAN
        tristate "Fan"
-       default m
+       default y
        help
          This driver adds support for ACPI fan devices, allowing user-mode 
          applications to perform basic fan control (on, off, status).
 
 config ACPI_PROCESSOR
        tristate "Processor"
-       default m
+       default y
        help
          This driver installs ACPI as the idle handler for Linux, and uses
          ACPI C2 and C3 processor states to save power, on systems that
-         support it.
+         support it.  It is required by several flavors of cpufreq
+         Performance-state drivers.
 
 config ACPI_HOTPLUG_CPU
-       bool "Processor Hotplug (EXPERIMENTAL)"
-       depends on ACPI_PROCESSOR && HOTPLUG_CPU && EXPERIMENTAL
+       bool
+       depends on ACPI_PROCESSOR && HOTPLUG_CPU
        select ACPI_CONTAINER
-       default n
-        ---help---
-        Select this option if your platform support physical CPU hotplug.
+       default y
 
 config ACPI_THERMAL
        tristate "Thermal Zone"
        depends on ACPI_PROCESSOR
-       default m
+       default y
        help
          This driver adds support for ACPI thermal zones.  Most mobile and
          some desktop systems support ACPI thermal zones.  It is HIGHLY
@@ -180,7 +168,7 @@ config ACPI_NUMA
 config ACPI_ASUS
         tristate "ASUS/Medion Laptop Extras"
        depends on X86
-       default m
+       default y
         ---help---
           This driver provides support for extra features of ACPI-compatible
           ASUS laptops. As some of Medion laptops are made by ASUS, it may also
@@ -209,7 +197,7 @@ config ACPI_ASUS
 config ACPI_IBM
        tristate "IBM ThinkPad Laptop Extras"
        depends on X86
-       default m
+       default y
        ---help---
          This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
          support for Fn-Fx key combinations, Bluetooth control, video
@@ -222,7 +210,7 @@ config ACPI_IBM
 config ACPI_TOSHIBA
        tristate "Toshiba Laptop Extras"
        depends on X86
-       default m
+       default y
        ---help---
          This driver adds support for access to certain system settings
          on "legacy free" Toshiba laptops.  These laptops can be recognized by
@@ -263,7 +251,7 @@ config ACPI_CUSTOM_DSDT_FILE
 
 config ACPI_BLACKLIST_YEAR
        int "Disable ACPI for systems before Jan 1st this year"
-       depends on ACPI_INTERPRETER
+       depends on X86
        default 0
        help
          enter a 4-digit year, eg. 2001 to disable ACPI by default
@@ -281,10 +269,6 @@ config ACPI_DEBUG
          of verbosity. Saying Y enables these statements. This will increase
          your kernel size by around 50K.
 
-config ACPI_BUS
-       bool
-       default y
-
 config ACPI_EC
        bool
        depends on X86
@@ -298,10 +282,6 @@ config ACPI_POWER
        bool
        default y
 
-config ACPI_PCI
-       bool
-       default PCI
-
 config ACPI_SYSTEM
        bool
        default y
@@ -309,14 +289,11 @@ config ACPI_SYSTEM
          This driver will enable your system to shut down using ACPI, and
          dump your ACPI DSDT table using /proc/acpi/dsdt.
 
-endif  # ACPI_INTERPRETER
-
 config X86_PM_TIMER
        bool "Power Management Timer Support"
        depends on X86
-       depends on ACPI_BOOT && EXPERIMENTAL
        depends on !X86_64
-       default n
+       default y
        help
          The Power Management Timer is available on all ACPI-capable,
          in most cases even if ACPI is unusable or blacklisted.
index ad67e8f..a182434 100644 (file)
@@ -15,13 +15,13 @@ EXTRA_CFLAGS        += $(ACPI_CFLAGS)
 #
 # ACPI Boot-Time Table Parsing
 #
-obj-$(CONFIG_ACPI_BOOT)                += tables.o
-obj-$(CONFIG_ACPI_INTERPRETER) += blacklist.o
+obj-y                          += tables.o
+obj-y                          += blacklist.o
 
 #
 # ACPI Core Subsystem (Interpreter)
 #
-obj-$(CONFIG_ACPI_INTERPRETER) += osl.o utils.o \
+obj-y                          += osl.o utils.o \
                                   dispatcher/ events/ executer/ hardware/ \
                                   namespace/ parser/ resources/ tables/ \
                                   utilities/
@@ -35,8 +35,8 @@ ifdef CONFIG_CPU_FREQ
 processor-objs += processor_perflib.o                  
 endif
 
-obj-$(CONFIG_ACPI_BUS)         += sleep/
-obj-$(CONFIG_ACPI_BUS)         += bus.o glue.o
+obj-y                          += sleep/
+obj-y                          += bus.o glue.o
 obj-$(CONFIG_ACPI_AC)          += ac.o
 obj-$(CONFIG_ACPI_BATTERY)     += battery.o
 obj-$(CONFIG_ACPI_BUTTON)      += button.o
@@ -44,7 +44,7 @@ obj-$(CONFIG_ACPI_EC)         += ec.o
 obj-$(CONFIG_ACPI_FAN)         += fan.o
 obj-$(CONFIG_ACPI_VIDEO)       += video.o 
 obj-$(CONFIG_ACPI_HOTKEY)      += hotkey.o
-obj-$(CONFIG_ACPI_PCI)         += pci_root.o pci_link.o pci_irq.o pci_bind.o
+obj-y                          += pci_root.o pci_link.o pci_irq.o pci_bind.o
 obj-$(CONFIG_ACPI_POWER)       += power.o
 obj-$(CONFIG_ACPI_PROCESSOR)   += processor.o
 obj-$(CONFIG_ACPI_CONTAINER)   += container.o
@@ -55,5 +55,5 @@ obj-$(CONFIG_ACPI_NUMA)               += numa.o
 obj-$(CONFIG_ACPI_ASUS)                += asus_acpi.o
 obj-$(CONFIG_ACPI_IBM)         += ibm_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)     += toshiba_acpi.o
-obj-$(CONFIG_ACPI_BUS)         += scan.o motherboard.o
+obj-y                          += scan.o motherboard.o
 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)      += acpi_memhotplug.o
index 23ab761..7839b83 100644 (file)
@@ -32,7 +32,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_AC_COMPONENT              0x00020000
 #define ACPI_AC_CLASS                  "ac_adapter"
 #define ACPI_AC_HID                    "ACPI0003"
 #define ACPI_AC_STATUS_UNKNOWN         0xFF
 
 #define _COMPONENT             ACPI_AC_COMPONENT
-ACPI_MODULE_NAME               ("acpi_ac")
+ACPI_MODULE_NAME("acpi_ac")
 
-MODULE_AUTHOR("Paul Diefenbaugh");
+    MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-static int acpi_ac_add (struct acpi_device *device);
-static int acpi_ac_remove (struct acpi_device *device, int type);
+static int acpi_ac_add(struct acpi_device *device);
+static int acpi_ac_remove(struct acpi_device *device, int type);
 static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_ac_driver = {
-       .name =         ACPI_AC_DRIVER_NAME,
-       .class =        ACPI_AC_CLASS,
-       .ids =          ACPI_AC_HID,
-       .ops =          {
-                               .add =          acpi_ac_add,
-                               .remove =       acpi_ac_remove,
-                       },
+       .name = ACPI_AC_DRIVER_NAME,
+       .class = ACPI_AC_CLASS,
+       .ids = ACPI_AC_HID,
+       .ops = {
+               .add = acpi_ac_add,
+               .remove = acpi_ac_remove,
+               },
 };
 
 struct acpi_ac {
-       acpi_handle             handle;
-       unsigned long           state;
+       acpi_handle handle;
+       unsigned long state;
 };
 
 static struct file_operations acpi_ac_fops = {
-       .open           = acpi_ac_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_ac_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
 };
 
 /* --------------------------------------------------------------------------
                                AC Adapter Management
    -------------------------------------------------------------------------- */
 
-static int
-acpi_ac_get_state (
-       struct acpi_ac          *ac)
+static int acpi_ac_get_state(struct acpi_ac *ac)
 {
-       acpi_status             status = AE_OK;
+       acpi_status status = AE_OK;
 
        ACPI_FUNCTION_TRACE("acpi_ac_get_state");
 
@@ -95,24 +92,23 @@ acpi_ac_get_state (
        status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error reading AC Adapter state\n"));
+                                 "Error reading AC Adapter state\n"));
                ac->state = ACPI_AC_STATUS_UNKNOWN;
                return_VALUE(-ENODEV);
        }
-       
+
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-static struct proc_dir_entry   *acpi_ac_dir;
+static struct proc_dir_entry *acpi_ac_dir;
 
 static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_ac          *ac = (struct acpi_ac *) seq->private;
+       struct acpi_ac *ac = (struct acpi_ac *)seq->private;
 
        ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
 
@@ -139,23 +135,21 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 
        return_VALUE(0);
 }
-       
+
 static int acpi_ac_open_fs(struct inode *inode, struct file *file)
 {
        return single_open(file, acpi_ac_seq_show, PDE(inode)->data);
 }
 
-static int
-acpi_ac_add_fs (
-       struct acpi_device      *device)
+static int acpi_ac_add_fs(struct acpi_device *device)
 {
-       struct proc_dir_entry   *entry = NULL;
+       struct proc_dir_entry *entry = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
-                       acpi_ac_dir);
+                                                    acpi_ac_dir);
                if (!acpi_device_dir(device))
                        return_VALUE(-ENODEV);
                acpi_device_dir(device)->owner = THIS_MODULE;
@@ -163,11 +157,11 @@ acpi_ac_add_fs (
 
        /* 'state' [R] */
        entry = create_proc_entry(ACPI_AC_FILE_STATE,
-               S_IRUGO, acpi_device_dir(device));
+                                 S_IRUGO, acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_AC_FILE_STATE));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_AC_FILE_STATE));
        else {
                entry->proc_fops = &acpi_ac_fops;
                entry->data = acpi_driver_data(device);
@@ -177,16 +171,12 @@ acpi_ac_add_fs (
        return_VALUE(0);
 }
 
-
-static int
-acpi_ac_remove_fs (
-       struct acpi_device      *device)
+static int acpi_ac_remove_fs(struct acpi_device *device)
 {
        ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
 
        if (acpi_device_dir(device)) {
-               remove_proc_entry(ACPI_AC_FILE_STATE,
-                                 acpi_device_dir(device));
+               remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
 
                remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
                acpi_device_dir(device) = NULL;
@@ -195,19 +185,14 @@ acpi_ac_remove_fs (
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                                    Driver Model
    -------------------------------------------------------------------------- */
 
-static void
-acpi_ac_notify (
-       acpi_handle             handle,
-       u32                     event,
-       void                    *data)
+static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_ac          *ac = (struct acpi_ac *) data;
-       struct acpi_device      *device = NULL;
+       struct acpi_ac *ac = (struct acpi_ac *)data;
+       struct acpi_device *device = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_notify");
 
@@ -224,21 +209,18 @@ acpi_ac_notify (
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-
-static int
-acpi_ac_add (
-       struct acpi_device      *device)
+static int acpi_ac_add(struct acpi_device *device)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       struct acpi_ac          *ac = NULL;
+       int result = 0;
+       acpi_status status = AE_OK;
+       struct acpi_ac *ac = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_add");
 
@@ -264,19 +246,20 @@ acpi_ac_add (
                goto end;
 
        status = acpi_install_notify_handler(ac->handle,
-               ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac);
+                                            ACPI_DEVICE_NOTIFY, acpi_ac_notify,
+                                            ac);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
 
-       printk(KERN_INFO PREFIX "%s [%s] (%s)\n", 
-               acpi_device_name(device), acpi_device_bid(device), 
-               ac->state?"on-line":"off-line");
+       printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
+              acpi_device_name(device), acpi_device_bid(device),
+              ac->state ? "on-line" : "off-line");
 
-end:
+      end:
        if (result) {
                acpi_ac_remove_fs(device);
                kfree(ac);
@@ -285,27 +268,23 @@ end:
        return_VALUE(result);
 }
 
-
-static int
-acpi_ac_remove (
-       struct acpi_device      *device,
-       int                     type)
+static int acpi_ac_remove(struct acpi_device *device, int type)
 {
-       acpi_status             status = AE_OK;
-       struct acpi_ac          *ac = NULL;
+       acpi_status status = AE_OK;
+       struct acpi_ac *ac = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_remove");
 
        if (!device || !acpi_driver_data(device))
                return_VALUE(-EINVAL);
 
-       ac = (struct acpi_ac *) acpi_driver_data(device);
+       ac = (struct acpi_ac *)acpi_driver_data(device);
 
        status = acpi_remove_notify_handler(ac->handle,
-               ACPI_DEVICE_NOTIFY, acpi_ac_notify);
+                                           ACPI_DEVICE_NOTIFY, acpi_ac_notify);
        if (ACPI_FAILURE(status))
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
 
        acpi_ac_remove_fs(device);
 
@@ -314,11 +293,9 @@ acpi_ac_remove (
        return_VALUE(0);
 }
 
-
-static int __init
-acpi_ac_init (void)
+static int __init acpi_ac_init(void)
 {
-       int                     result = 0;
+       int result = 0;
 
        ACPI_FUNCTION_TRACE("acpi_ac_init");
 
@@ -336,9 +313,7 @@ acpi_ac_init (void)
        return_VALUE(0);
 }
 
-
-static void __exit
-acpi_ac_exit (void)
+static void __exit acpi_ac_exit(void)
 {
        ACPI_FUNCTION_TRACE("acpi_ac_exit");
 
@@ -349,6 +324,5 @@ acpi_ac_exit (void)
        return_VOID;
 }
 
-
 module_init(acpi_ac_init);
 module_exit(acpi_ac_exit);
index 77285ff..01a1bd2 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/memory_hotplug.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_MEMORY_DEVICE_COMPONENT           0x08000000UL
 #define ACPI_MEMORY_DEVICE_CLASS               "memory"
 #define ACPI_MEMORY_DEVICE_HID                 "PNP0C80"
@@ -41,8 +40,8 @@
 
 #define _COMPONENT             ACPI_MEMORY_DEVICE_COMPONENT
 
-ACPI_MODULE_NAME               ("acpi_memory")
-MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
+ACPI_MODULE_NAME("acpi_memory")
+    MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
 MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
@@ -56,34 +55,33 @@ MODULE_LICENSE("GPL");
 #define MEMORY_POWER_ON_STATE  1
 #define MEMORY_POWER_OFF_STATE 2
 
-static int acpi_memory_device_add (struct acpi_device *device);
-static int acpi_memory_device_remove (struct acpi_device *device, int type);
+static int acpi_memory_device_add(struct acpi_device *device);
+static int acpi_memory_device_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_memory_device_driver = {
-       .name =         ACPI_MEMORY_DEVICE_DRIVER_NAME,
-       .class =        ACPI_MEMORY_DEVICE_CLASS,
-       .ids =          ACPI_MEMORY_DEVICE_HID,
-       .ops =          {
-                               .add =          acpi_memory_device_add,
-                               .remove =       acpi_memory_device_remove,
-                       },
+       .name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
+       .class = ACPI_MEMORY_DEVICE_CLASS,
+       .ids = ACPI_MEMORY_DEVICE_HID,
+       .ops = {
+               .add = acpi_memory_device_add,
+               .remove = acpi_memory_device_remove,
+               },
 };
 
 struct acpi_memory_device {
        acpi_handle handle;
-       unsigned int state;             /* State of the memory device */
+       unsigned int state;     /* State of the memory device */
        unsigned short cache_attribute; /* memory cache attribute */
-       unsigned short read_write_attribute;/* memory read/write attribute */
-       u64 start_addr; /* Memory Range start physical addr */
-       u64 end_addr;   /* Memory Range end physical addr */
+       unsigned short read_write_attribute;    /* memory read/write attribute */
+       u64 start_addr;         /* Memory Range start physical addr */
+       u64 end_addr;           /* Memory Range end physical addr */
 };
 
-
 static int
 acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
 {
        acpi_status status;
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_resource *resource = NULL;
        struct acpi_resource_address64 address64;
 
@@ -94,15 +92,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
        if (ACPI_FAILURE(status))
                return_VALUE(-EINVAL);
 
-       resource = (struct acpi_resource *) buffer.pointer;
+       resource = (struct acpi_resource *)buffer.pointer;
        status = acpi_resource_to_address64(resource, &address64);
        if (ACPI_SUCCESS(status)) {
                if (address64.resource_type == ACPI_MEMORY_RANGE) {
                        /* Populate the structure */
                        mem_device->cache_attribute =
-                               address64.attribute.memory.cache_attribute;
+                           address64.attribute.memory.cache_attribute;
                        mem_device->read_write_attribute =
-                       address64.attribute.memory.read_write_attribute;
+                           address64.attribute.memory.read_write_attribute;
                        mem_device->start_addr = address64.min_address_range;
                        mem_device->end_addr = address64.max_address_range;
                }
@@ -114,7 +112,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
 
 static int
 acpi_memory_get_device(acpi_handle handle,
-       struct acpi_memory_device **mem_device)
+                      struct acpi_memory_device **mem_device)
 {
        acpi_status status;
        acpi_handle phandle;
@@ -128,8 +126,7 @@ acpi_memory_get_device(acpi_handle handle,
 
        status = acpi_get_parent(handle, &phandle);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_get_parent\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
                return_VALUE(-EINVAL);
        }
 
@@ -137,7 +134,7 @@ acpi_memory_get_device(acpi_handle handle,
        status = acpi_bus_get_device(phandle, &pdevice);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_bus_get_device\n"));
+                                 "Error in acpi_bus_get_device\n"));
                return_VALUE(-EINVAL);
        }
 
@@ -147,23 +144,21 @@ acpi_memory_get_device(acpi_handle handle,
         */
        status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_bus_add\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
                return_VALUE(-EINVAL);
        }
 
-end:
+      end:
        *mem_device = acpi_driver_data(device);
        if (!(*mem_device)) {
-               printk(KERN_ERR "\n driver data not found" );
+               printk(KERN_ERR "\n driver data not found");
                return_VALUE(-ENODEV);
        }
 
        return_VALUE(0);
 }
 
-static int
-acpi_memory_check_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
 {
        unsigned long current_status;
 
@@ -171,22 +166,21 @@ acpi_memory_check_device(struct acpi_memory_device *mem_device)
 
        /* Get device present/absent information from the _STA */
        if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
-               NULL, &current_status)))
+                                              NULL, &current_status)))
                return_VALUE(-ENODEV);
        /*
         * Check for device status. Device should be
         * present/enabled/functioning.
         */
        if (!((current_status & ACPI_MEMORY_STA_PRESENT)
-               && (current_status & ACPI_MEMORY_STA_ENABLED)
-               && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
+             && (current_status & ACPI_MEMORY_STA_ENABLED)
+             && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
                return_VALUE(-ENODEV);
 
        return_VALUE(0);
 }
 
-static int
-acpi_memory_enable_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
        int result;
 
@@ -196,7 +190,7 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
        result = acpi_memory_get_device_resources(mem_device);
        if (result) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "\nget_device_resources failed\n"));
+                                 "\nget_device_resources failed\n"));
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
        }
@@ -206,11 +200,10 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
         * Note: Assume that this function returns zero on success
         */
        result = add_memory(mem_device->start_addr,
-                       (mem_device->end_addr - mem_device->start_addr) + 1,
-                       mem_device->read_write_attribute);
+                           (mem_device->end_addr - mem_device->start_addr) + 1,
+                           mem_device->read_write_attribute);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "\nadd_memory failed\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
        }
@@ -218,11 +211,10 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
        return result;
 }
 
-static int
-acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
 {
        acpi_status status;
-       struct acpi_object_list arg_list;
+       struct acpi_object_list arg_list;
        union acpi_object arg;
        unsigned long current_status;
 
@@ -234,16 +226,16 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        arg.type = ACPI_TYPE_INTEGER;
        arg.integer.value = 1;
        status = acpi_evaluate_object(mem_device->handle,
-                       "_EJ0", &arg_list, NULL);
+                                     "_EJ0", &arg_list, NULL);
        /* Return on _EJ0 failure */
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"_EJ0 failed.\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
                return_VALUE(-ENODEV);
        }
 
        /* Evalute _STA to check if the device is disabled */
        status = acpi_evaluate_integer(mem_device->handle, "_STA",
-               NULL, &current_status);
+                                      NULL, &current_status);
        if (ACPI_FAILURE(status))
                return_VALUE(-ENODEV);
 
@@ -254,8 +246,7 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        return_VALUE(0);
 }
 
-static int
-acpi_memory_disable_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
 {
        int result;
        u64 start = mem_device->start_addr;
@@ -278,7 +269,7 @@ acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        result = acpi_memory_powerdown_device(mem_device);
        if (result) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Device Power Down failed.\n"));
+                                 "Device Power Down failed.\n"));
                /* Set the status of the device to invalid */
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
@@ -288,8 +279,7 @@ acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        return result;
 }
 
-static void
-acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
+static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 {
        struct acpi_memory_device *mem_device;
        struct acpi_device *device;
@@ -299,37 +289,37 @@ acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
        switch (event) {
        case ACPI_NOTIFY_BUS_CHECK:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived BUS CHECK notification for device\n"));
+                                 "\nReceived BUS CHECK notification for device\n"));
                /* Fall Through */
        case ACPI_NOTIFY_DEVICE_CHECK:
                if (event == ACPI_NOTIFY_DEVICE_CHECK)
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived DEVICE CHECK notification for device\n"));
+                                         "\nReceived DEVICE CHECK notification for device\n"));
                if (acpi_memory_get_device(handle, &mem_device)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in finding driver data\n"));
+                                         "Error in finding driver data\n"));
                        return_VOID;
                }
 
                if (!acpi_memory_check_device(mem_device)) {
                        if (acpi_memory_enable_device(mem_device))
                                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in acpi_memory_enable_device\n"));
+                                                 "Error in acpi_memory_enable_device\n"));
                }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived EJECT REQUEST notification for device\n"));
+                                 "\nReceived EJECT REQUEST notification for device\n"));
 
                if (acpi_bus_get_device(handle, &device)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Device doesn't exist\n"));
+                                         "Device doesn't exist\n"));
                        break;
                }
                mem_device = acpi_driver_data(device);
                if (!mem_device) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Driver Data is NULL\n"));
+                                         "Driver Data is NULL\n"));
                        break;
                }
 
@@ -337,26 +327,25 @@ acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                 * Currently disabling memory device from kernel mode
                 * TBD: Can also be disabled from user mode scripts
                 * TBD: Can also be disabled by Callback registration
-                *      with generic sysfs driver
+                *      with generic sysfs driver
                 */
                if (acpi_memory_disable_device(mem_device))
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in acpi_memory_disable_device\n"));
+                                         "Error in acpi_memory_disable_device\n"));
                /*
                 * TBD: Invoke acpi_bus_remove to cleanup data structures
                 */
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-static int
-acpi_memory_device_add(struct acpi_device *device)
+static int acpi_memory_device_add(struct acpi_device *device)
 {
        int result;
        struct acpi_memory_device *mem_device = NULL;
@@ -391,8 +380,7 @@ acpi_memory_device_add(struct acpi_device *device)
        return_VALUE(result);
 }
 
-static int
-acpi_memory_device_remove (struct acpi_device *device, int type)
+static int acpi_memory_device_remove(struct acpi_device *device, int type)
 {
        struct acpi_memory_device *mem_device = NULL;
 
@@ -401,7 +389,7 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
        if (!device || !acpi_driver_data(device))
                return_VALUE(-EINVAL);
 
-       mem_device = (struct acpi_memory_device *) acpi_driver_data(device);
+       mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
        kfree(mem_device);
 
        return_VALUE(0);
@@ -410,12 +398,11 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
 /*
  * Helper function to check for memory device
  */
-static acpi_status
-is_memory_device(acpi_handle handle)
+static acpi_status is_memory_device(acpi_handle handle)
 {
        char *hardware_id;
        acpi_status status;
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_device_info *info;
 
        ACPI_FUNCTION_TRACE("is_memory_device");
@@ -432,7 +419,7 @@ is_memory_device(acpi_handle handle)
 
        hardware_id = info->hardware_id.value;
        if ((hardware_id == NULL) ||
-               (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
+           (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
                status = AE_ERROR;
 
        acpi_os_free(buffer.pointer);
@@ -440,8 +427,8 @@ is_memory_device(acpi_handle handle)
 }
 
 static acpi_status
-acpi_memory_register_notify_handler (acpi_handle handle,
-       u32 level, void *ctxt, void **retv)
+acpi_memory_register_notify_handler(acpi_handle handle,
+                                   u32 level, void *ctxt, void **retv)
 {
        acpi_status status;
 
@@ -452,10 +439,10 @@ acpi_memory_register_notify_handler (acpi_handle handle,
                return_ACPI_STATUS(AE_OK);      /* continue */
 
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
-                       acpi_memory_device_notify, NULL);
+                                            acpi_memory_device_notify, NULL);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                return_ACPI_STATUS(AE_OK);      /* continue */
        }
 
@@ -463,8 +450,8 @@ acpi_memory_register_notify_handler (acpi_handle handle,
 }
 
 static acpi_status
-acpi_memory_deregister_notify_handler (acpi_handle handle,
-                              u32 level, void *ctxt, void **retv)
+acpi_memory_deregister_notify_handler(acpi_handle handle,
+                                     u32 level, void *ctxt, void **retv)
 {
        acpi_status status;
 
@@ -475,18 +462,18 @@ acpi_memory_deregister_notify_handler (acpi_handle handle,
                return_ACPI_STATUS(AE_OK);      /* continue */
 
        status = acpi_remove_notify_handler(handle,
-                       ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify);
+                                           ACPI_SYSTEM_NOTIFY,
+                                           acpi_memory_device_notify);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
                return_ACPI_STATUS(AE_OK);      /* continue */
        }
 
        return_ACPI_STATUS(status);
 }
 
-static int __init
-acpi_memory_device_init (void)
+static int __init acpi_memory_device_init(void)
 {
        int result;
        acpi_status status;
@@ -499,21 +486,20 @@ acpi_memory_device_init (void)
                return_VALUE(-ENODEV);
 
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                               ACPI_UINT32_MAX,
-                               acpi_memory_register_notify_handler,
-                               NULL, NULL);
+                                    ACPI_UINT32_MAX,
+                                    acpi_memory_register_notify_handler,
+                                    NULL, NULL);
 
-       if (ACPI_FAILURE (status)) {
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+       if (ACPI_FAILURE(status)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
                acpi_bus_unregister_driver(&acpi_memory_device_driver);
                return_VALUE(-ENODEV);
-        }
+       }
 
        return_VALUE(0);
 }
 
-static void __exit
-acpi_memory_device_exit (void)
+static void __exit acpi_memory_device_exit(void)
 {
        acpi_status status;
 
@@ -524,12 +510,12 @@ acpi_memory_device_exit (void)
         * handles.
         */
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                       ACPI_UINT32_MAX,
-                       acpi_memory_deregister_notify_handler,
-                       NULL, NULL);
+                                    ACPI_UINT32_MAX,
+                                    acpi_memory_deregister_notify_handler,
+                                    NULL, NULL);
 
-       if (ACPI_FAILURE (status))
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+       if (ACPI_FAILURE(status))
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
 
        acpi_bus_unregister_driver(&acpi_memory_device_driver);
 
@@ -538,5 +524,3 @@ acpi_memory_device_exit (void)
 
 module_init(acpi_memory_device_init);
 module_exit(acpi_memory_device_exit);
-
-
index a560b1e..fec895a 100644 (file)
@@ -61,7 +61,7 @@
 /*
  * Some events we use, same for all Asus
  */
-#define BR_UP       0x10               
+#define BR_UP       0x10
 #define BR_DOWN     0x20
 
 /*
@@ -75,7 +75,6 @@ MODULE_AUTHOR("Julien Lerouge, Karol Kozimor");
 MODULE_DESCRIPTION(ACPI_HOTK_NAME);
 MODULE_LICENSE("GPL");
 
-
 static uid_t asus_uid;
 static gid_t asus_gid;
 module_param(asus_uid, uint, 0);
@@ -83,26 +82,25 @@ MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
 module_param(asus_gid, uint, 0);
 MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n");
 
-
 /* For each model, all features implemented, 
  * those marked with R are relative to HOTK, A for absolute */
 struct model_data {
-       char *name;              //name of the laptop________________A
-       char *mt_mled;           //method to handle mled_____________R
-       char *mled_status;       //node to handle mled reading_______A
-       char *mt_wled;           //method to handle wled_____________R
-       char *wled_status;       //node to handle wled reading_______A
-       char *mt_tled;           //method to handle tled_____________R
-       char *tled_status;       //node to handle tled reading_______A
-       char *mt_lcd_switch;     //method to turn LCD ON/OFF_________A
-       char *lcd_status;        //node to read LCD panel state______A
-       char *brightness_up;     //method to set brightness up_______A
-       char *brightness_down;   //guess what ?______________________A
-       char *brightness_set;    //method to set absolute brightness_R
-       char *brightness_get;    //method to get absolute brightness_R
-       char *brightness_status; //node to get brightness____________A
-       char *display_set;       //method to set video output________R
-       char *display_get;       //method to get video output________R
+       char *name;             //name of the laptop________________A
+       char *mt_mled;          //method to handle mled_____________R
+       char *mled_status;      //node to handle mled reading_______A
+       char *mt_wled;          //method to handle wled_____________R
+       char *wled_status;      //node to handle wled reading_______A
+       char *mt_tled;          //method to handle tled_____________R
+       char *tled_status;      //node to handle tled reading_______A
+       char *mt_lcd_switch;    //method to turn LCD ON/OFF_________A
+       char *lcd_status;       //node to read LCD panel state______A
+       char *brightness_up;    //method to set brightness up_______A
+       char *brightness_down;  //guess what ?______________________A
+       char *brightness_set;   //method to set absolute brightness_R
+       char *brightness_get;   //method to get absolute brightness_R
+       char *brightness_status;        //node to get brightness____________A
+       char *display_set;      //method to set video output________R
+       char *display_get;      //method to get video output________R
 };
 
 /*
@@ -110,34 +108,34 @@ struct model_data {
  * about the hotk device
  */
 struct asus_hotk {
-       struct acpi_device *device; //the device we are in
-       acpi_handle handle;         //the handle of the hotk device
-       char status;                //status of the hotk, for LEDs, ...
-       struct model_data *methods; //methods available on the laptop
-       u8 brightness;              //brightness level
+       struct acpi_device *device;     //the device we are in
+       acpi_handle handle;     //the handle of the hotk device
+       char status;            //status of the hotk, for LEDs, ...
+       struct model_data *methods;     //methods available on the laptop
+       u8 brightness;          //brightness level
        enum {
-               A1x = 0,  //A1340D, A1300F
-               A2x,      //A2500H
-               D1x,      //D1
-               L2D,      //L2000D
-               L3C,      //L3800C
-               L3D,      //L3400D
-               L3H,      //L3H, but also L2000E
-               L4R,      //L4500R
-               L5x,      //L5800C 
-               L8L,      //L8400L
-               M1A,      //M1300A
-               M2E,      //M2400E, L4400L
-               M6N,      //M6800N
-               M6R,      //M6700R
-               P30,      //Samsung P30
-               S1x,      //S1300A, but also L1400B and M2400A (L84F)
-               S2x,      //S200 (J1 reported), Victor MP-XP7210
-               xxN,      //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
-                         //(Centrino)
+               A1x = 0,        //A1340D, A1300F
+               A2x,            //A2500H
+               D1x,            //D1
+               L2D,            //L2000D
+               L3C,            //L3800C
+               L3D,            //L3400D
+               L3H,            //L3H, but also L2000E
+               L4R,            //L4500R
+               L5x,            //L5800C 
+               L8L,            //L8400L
+               M1A,            //M1300A
+               M2E,            //M2400E, L4400L
+               M6N,            //M6800N
+               M6R,            //M6700R
+               P30,            //Samsung P30
+               S1x,            //S1300A, but also L1400B and M2400A (L84F)
+               S2x,            //S200 (J1 reported), Victor MP-XP7210
+               xxN,            //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
+               //(Centrino)
                END_MODEL
-       } model;              //Models currently supported
-       u16 event_count[128]; //count for each event TODO make this better
+       } model;                //Models currently supported
+       u16 event_count[128];   //count for each event TODO make this better
 };
 
 /* Here we go */
@@ -150,7 +148,7 @@ struct asus_hotk {
 #define xxN_PREFIX "\\_SB.PCI0.SBRG.EC0."
 
 static struct model_data model_conf[END_MODEL] = {
-        /*
+       /*
         * Those pathnames are relative to the HOTK / ATKD device :
         *       - mt_mled
         *       - mt_wled
@@ -165,215 +163,197 @@ static struct model_data model_conf[END_MODEL] = {
         */
 
        {
-               .name              = "A1x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MAIL",
-               .mt_lcd_switch     = A1x_PREFIX "_Q10",
-               .lcd_status        = "\\BKLI",
-               .brightness_up     = A1x_PREFIX "_Q0E",
-               .brightness_down   = A1x_PREFIX "_Q0F"
-       },
+        .name = "A1x",
+        .mt_mled = "MLED",
+        .mled_status = "\\MAIL",
+        .mt_lcd_switch = A1x_PREFIX "_Q10",
+        .lcd_status = "\\BKLI",
+        .brightness_up = A1x_PREFIX "_Q0E",
+        .brightness_down = A1x_PREFIX "_Q0F"},
 
        {
-               .name              = "A2x",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\SG66",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\BAOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "A2x",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\SG66",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\BAOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "D1x",
-               .mt_mled           = "MLED",
-               .mt_lcd_switch     = "\\Q0D",
-               .lcd_status        = "\\GP11",
-               .brightness_up     = "\\Q0C",
-               .brightness_down   = "\\Q0B",
-               .brightness_status = "\\BLVL",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "D1x",
+        .mt_mled = "MLED",
+        .mt_lcd_switch = "\\Q0D",
+        .lcd_status = "\\GP11",
+        .brightness_up = "\\Q0C",
+        .brightness_down = "\\Q0B",
+        .brightness_status = "\\BLVL",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L2D",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\SGP6",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\RCP3",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\SGP0",
-               .brightness_up     = "\\Q0E",
-               .brightness_down   = "\\Q0F",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L2D",
+        .mt_mled = "MLED",
+        .mled_status = "\\SGP6",
+        .mt_wled = "WLED",
+        .wled_status = "\\RCP3",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\SGP0",
+        .brightness_up = "\\Q0E",
+        .brightness_down = "\\Q0F",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L3C",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = L3C_PREFIX "_Q10",
-               .lcd_status        = "\\GL32",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\_SB.PCI0.PCI1.VGAC.NMAP"
-       },
+        .name = "L3C",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = L3C_PREFIX "_Q10",
+        .lcd_status = "\\GL32",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\_SB.PCI0.PCI1.VGAC.NMAP"},
 
        {
-               .name              = "L3D",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MALD",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\BKLG",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L3D",
+        .mt_mled = "MLED",
+        .mled_status = "\\MALD",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\BKLG",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L3H",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "EHK",
-               .lcd_status        = "\\_SB.PCI0.PM.PBC",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L3H",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "EHK",
+        .lcd_status = "\\_SB.PCI0.PM.PBC",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L4R",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\_SB.PCI0.SBRG.SG13",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.PCI0.SBSM.SEO4",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV", 
-               .display_set       = "SDSP",
-               .display_get       = "\\_SB.PCI0.P0P1.VGA.GETD"
-       },
+        .name = "L4R",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\_SB.PCI0.SBRG.SG13",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
 
        {
-               .name              = "L5x",
-               .mt_mled           = "MLED",
+        .name = "L5x",
+        .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
-               .mt_tled           = "TLED",
-               .mt_lcd_switch     = "\\Q0D",
-               .lcd_status        = "\\BAOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .mt_tled = "TLED",
+        .mt_lcd_switch = "\\Q0D",
+        .lcd_status = "\\BAOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L8L"
+        .name = "L8L"
 /* No features, but at least support the hotkeys */
-       },
+        },
 
        {
-               .name              = "M1A",
-               .mt_mled           = "MLED",
-               .mt_lcd_switch     = M1A_PREFIX "Q10",
-               .lcd_status        = "\\PNOF",
-               .brightness_up     = M1A_PREFIX "Q0E",
-               .brightness_down   = M1A_PREFIX "Q0F",
-               .brightness_status = "\\BRIT",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "M1A",
+        .mt_mled = "MLED",
+        .mt_lcd_switch = M1A_PREFIX "Q10",
+        .lcd_status = "\\PNOF",
+        .brightness_up = M1A_PREFIX "Q0E",
+        .brightness_down = M1A_PREFIX "Q0F",
+        .brightness_status = "\\BRIT",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "M2E",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\GP06",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "M2E",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\GP06",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "M6N",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\_SB.PCI0.SBRG.SG13",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.BKLT",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\SSTE"
-       },
+        .name = "M6N",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\_SB.PCI0.SBRG.SG13",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\SSTE"},
        {
-               .name              = "M6R",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.PCI0.SBSM.SEO4",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\SSTE"
-       },
-
+        .name = "M6R",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\SSTE"},
 
        {
-               .name              = "P30",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = P30_PREFIX "_Q0E",
-               .lcd_status        = "\\BKLT",
-               .brightness_up     = P30_PREFIX "_Q68",
-               .brightness_down   = P30_PREFIX "_Q69",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\DNXT"
-       },
+        .name = "P30",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = P30_PREFIX "_Q0E",
+        .lcd_status = "\\BKLT",
+        .brightness_up = P30_PREFIX "_Q68",
+        .brightness_down = P30_PREFIX "_Q69",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\DNXT"},
 
        {
-               .name              = "S1x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\EMLE",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = S1x_PREFIX "Q10" ,
-               .lcd_status        = "\\PNOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV"
-       },
+        .name = "S1x",
+        .mt_mled = "MLED",
+        .mled_status = "\\EMLE",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = S1x_PREFIX "Q10",
+        .lcd_status = "\\PNOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV"},
 
        {
-               .name              = "S2x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MAIL",
-               .mt_lcd_switch     = S2x_PREFIX "_Q10",
-               .lcd_status        = "\\BKLI",
-               .brightness_up     = S2x_PREFIX "_Q0B",
-               .brightness_down   = S2x_PREFIX "_Q0A"
-       },
+        .name = "S2x",
+        .mt_mled = "MLED",
+        .mled_status = "\\MAIL",
+        .mt_lcd_switch = S2x_PREFIX "_Q10",
+        .lcd_status = "\\BKLI",
+        .brightness_up = S2x_PREFIX "_Q0B",
+        .brightness_down = S2x_PREFIX "_Q0A"},
 
        {
-               .name              = "xxN",
-               .mt_mled           = "MLED",
+        .name = "xxN",
+        .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\BKLT",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\ADVG"
-       }
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\ADVG"}
 };
 
 /* procdir we use */
@@ -395,13 +375,13 @@ static struct asus_hotk *hotk;
 static int asus_hotk_add(struct acpi_device *device);
 static int asus_hotk_remove(struct acpi_device *device, int type);
 static struct acpi_driver asus_hotk_driver = {
-       .name =         ACPI_HOTK_NAME,
-       .class =        ACPI_HOTK_CLASS,
-       .ids =          ACPI_HOTK_HID,
-       .ops =          {
-                               .add =          asus_hotk_add,
-                               .remove =       asus_hotk_remove,
-                       },
+       .name = ACPI_HOTK_NAME,
+       .class = ACPI_HOTK_CLASS,
+       .ids = ACPI_HOTK_HID,
+       .ops = {
+               .add = asus_hotk_add,
+               .remove = asus_hotk_remove,
+               },
 };
 
 /* 
@@ -423,11 +403,10 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
        in_obj.type = ACPI_TYPE_INTEGER;
        in_obj.integer.value = val;
 
-       status = acpi_evaluate_object(handle, (char *) method, &params, output);
+       status = acpi_evaluate_object(handle, (char *)method, &params, output);
        return (status == AE_OK);
 }
 
-
 static int read_acpi_int(acpi_handle handle, const char *method, int *val)
 {
        struct acpi_buffer output;
@@ -437,7 +416,7 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val)
        output.length = sizeof(out_obj);
        output.pointer = &out_obj;
 
-       status = acpi_evaluate_object(handle, (char *) method, NULL, &output);
+       status = acpi_evaluate_object(handle, (char *)method, NULL, &output);
        *val = out_obj.integer.value;
        return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER);
 }
@@ -449,7 +428,7 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val)
  */
 static int
 proc_read_info(char *page, char **start, off_t off, int count, int *eof,
-               void *data)
+              void *data)
 {
        int len = 0;
        int temp;
@@ -460,7 +439,7 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         */
 
        len += sprintf(page, ACPI_HOTK_NAME " " ASUS_ACPI_VERSION "\n");
-       len += sprintf(page + len, "Model reference    : %s\n", 
+       len += sprintf(page + len, "Model reference    : %s\n",
                       hotk->methods->name);
        /* 
         * The SFUN method probably allows the original driver to get the list 
@@ -469,7 +448,8 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         * The significance of others is yet to be found.
         */
        if (read_acpi_int(hotk->handle, "SFUN", &temp))
-               len += sprintf(page + len, "SFUN value         : 0x%04x\n", temp);
+               len +=
+                   sprintf(page + len, "SFUN value         : 0x%04x\n", temp);
        /*
         * Another value for userspace: the ASYM method returns 0x02 for
         * battery low and 0x04 for battery critical, its readings tend to be
@@ -478,7 +458,8 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         * silently ignored.
         */
        if (read_acpi_int(hotk->handle, "ASYM", &temp))
-               len += sprintf(page + len, "ASYM value         : 0x%04x\n", temp);
+               len +=
+                   sprintf(page + len, "ASYM value         : 0x%04x\n", temp);
        if (asus_info) {
                snprintf(buf, 16, "%d", asus_info->length);
                len += sprintf(page + len, "DSDT length        : %s\n", buf);
@@ -501,7 +482,6 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
        return len;
 }
 
-
 /*
  * /proc handlers
  * We write our info in page, we begin at offset off and cannot write more
@@ -510,8 +490,7 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
  */
 
 /* Generic LED functions */
-static int
-read_led(const char *ledname, int ledmask)
+static int read_led(const char *ledname, int ledmask)
 {
        if (ledname) {
                int led_status;
@@ -525,7 +504,7 @@ read_led(const char *ledname, int ledmask)
        return (hotk->status & ledmask) ? 1 : 0;
 }
 
-static int parse_arg(const char __user *buf, unsigned long count, int *val)
+static int parse_arg(const char __user * buf, unsigned long count, int *val)
 {
        char s[32];
        if (!count)
@@ -542,8 +521,8 @@ static int parse_arg(const char __user *buf, unsigned long count, int *val)
 
 /* FIXME: kill extraneous args so it can be called independently */
 static int
-write_led(const char __user *buffer, unsigned long count,
-          char *ledname, int ledmask, int invert)
+write_led(const char __user * buffer, unsigned long count,
+         char *ledname, int ledmask, int invert)
 {
        int value;
        int led_out = 0;
@@ -555,16 +534,16 @@ write_led(const char __user *buffer, unsigned long count,
        hotk->status =
            (led_out) ? (hotk->status | ledmask) : (hotk->status & ~ledmask);
 
-       if (invert) /* invert target value */
+       if (invert)             /* invert target value */
                led_out = !led_out & 0x1;
 
        if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
-               printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", ledname);
+               printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
+                      ledname);
 
        return count;
 }
 
-
 /*
  * Proc handlers for MLED
  */
@@ -572,12 +551,12 @@ static int
 proc_read_mled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->mled_status, MLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->mled_status, MLED_ON));
 }
 
-
 static int
-proc_write_mled(struct file *file, const char __user *buffer,
+proc_write_mled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_mled, MLED_ON, 1);
@@ -590,11 +569,12 @@ static int
 proc_read_wled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->wled_status, WLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->wled_status, WLED_ON));
 }
 
 static int
-proc_write_wled(struct file *file, const char __user *buffer,
+proc_write_wled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_wled, WLED_ON, 0);
@@ -607,35 +587,36 @@ static int
 proc_read_tled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->tled_status, TLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->tled_status, TLED_ON));
 }
 
 static int
-proc_write_tled(struct file *file, const char __user *buffer,
+proc_write_tled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_tled, TLED_ON, 0);
 }
 
-
 static int get_lcd_state(void)
 {
        int lcd = 0;
 
        if (hotk->model != L3H) {
-       /* We don't have to check anything if we are here */
+               /* We don't have to check anything if we are here */
                if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
-                       printk(KERN_WARNING "Asus ACPI: Error reading LCD status\n");
-       
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading LCD status\n");
+
                if (hotk->model == L2D)
                        lcd = ~lcd;
-       } else { /* L3H and the like have to be handled differently */
+       } else {                /* L3H and the like have to be handled differently */
                acpi_status status = 0;
                struct acpi_object_list input;
                union acpi_object mt_params[2];
                struct acpi_buffer output;
                union acpi_object out_obj;
-               
+
                input.count = 2;
                input.pointer = mt_params;
                /* Note: the following values are partly guessed up, but 
@@ -647,15 +628,17 @@ static int get_lcd_state(void)
 
                output.length = sizeof(out_obj);
                output.pointer = &out_obj;
-               
-               status = acpi_evaluate_object(NULL, hotk->methods->lcd_status, &input, &output);
+
+               status =
+                   acpi_evaluate_object(NULL, hotk->methods->lcd_status,
+                                        &input, &output);
                if (status != AE_OK)
                        return -1;
                if (out_obj.type == ACPI_TYPE_INTEGER)
                        /* That's what the AML code does */
                        lcd = out_obj.integer.value >> 8;
        }
-       
+
        return (lcd & 1);
 }
 
@@ -669,10 +652,13 @@ static int set_lcd_state(int value)
                /* switch */
                if (hotk->model != L3H) {
                        status =
-                           acpi_evaluate_object(NULL, hotk->methods->mt_lcd_switch,
+                           acpi_evaluate_object(NULL,
+                                                hotk->methods->mt_lcd_switch,
                                                 NULL, NULL);
-               } else { /* L3H and the like have to be handled differently */
-                       if (!write_acpi_int(hotk->handle, hotk->methods->mt_lcd_switch, 0x07, NULL))
+               } else {        /* L3H and the like have to be handled differently */
+                       if (!write_acpi_int
+                           (hotk->handle, hotk->methods->mt_lcd_switch, 0x07,
+                            NULL))
                                status = AE_ERROR;
                        /* L3H's AML executes EHK (0x07) upon Fn+F7 keypress, 
                           the exact behaviour is simulated here */
@@ -691,33 +677,33 @@ proc_read_lcd(char *page, char **start, off_t off, int count, int *eof,
        return sprintf(page, "%d\n", get_lcd_state());
 }
 
-
 static int
-proc_write_lcd(struct file *file, const char __user *buffer,
+proc_write_lcd(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
        int value;
-       
+
        count = parse_arg(buffer, count, &value);
        if (count > 0)
                set_lcd_state(value);
        return count;
 }
 
-
 static int read_brightness(void)
 {
        int value;
-       
-       if(hotk->methods->brightness_get) { /* SPLV/GPLV laptop */
-               if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, 
+
+       if (hotk->methods->brightness_get) {    /* SPLV/GPLV laptop */
+               if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
                                   &value))
-                       printk(KERN_WARNING "Asus ACPI: Error reading brightness\n");
-       } else if (hotk->methods->brightness_status) { /* For D1 for example */
-               if (!read_acpi_int(NULL, hotk->methods->brightness_status, 
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading brightness\n");
+       } else if (hotk->methods->brightness_status) {  /* For D1 for example */
+               if (!read_acpi_int(NULL, hotk->methods->brightness_status,
                                   &value))
-                       printk(KERN_WARNING "Asus ACPI: Error reading brightness\n");
-       } else /* No GPLV method */
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading brightness\n");
+       } else                  /* No GPLV method */
                value = hotk->brightness;
        return value;
 }
@@ -730,23 +716,25 @@ static void set_brightness(int value)
        acpi_status status = 0;
 
        /* SPLV laptop */
-       if(hotk->methods->brightness_set) {
-               if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set, 
+       if (hotk->methods->brightness_set) {
+               if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
                                    value, NULL))
-                       printk(KERN_WARNING "Asus ACPI: Error changing brightness\n");
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error changing brightness\n");
                return;
        }
 
        /* No SPLV method if we are here, act as appropriate */
        value -= read_brightness();
        while (value != 0) {
-               status = acpi_evaluate_object(NULL, (value > 0) ? 
-                                             hotk->methods->brightness_up : 
+               status = acpi_evaluate_object(NULL, (value > 0) ?
+                                             hotk->methods->brightness_up :
                                              hotk->methods->brightness_down,
                                              NULL, NULL);
                (value > 0) ? value-- : value++;
                if (ACPI_FAILURE(status))
-                       printk(KERN_WARNING "Asus ACPI: Error changing brightness\n");
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error changing brightness\n");
        }
        return;
 }
@@ -759,7 +747,7 @@ proc_read_brn(char *page, char **start, off_t off, int count, int *eof,
 }
 
 static int
-proc_write_brn(struct file *file, const char __user *buffer,
+proc_write_brn(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
        int value;
@@ -767,7 +755,7 @@ proc_write_brn(struct file *file, const char __user *buffer,
        count = parse_arg(buffer, count, &value);
        if (count > 0) {
                value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
-                       /* 0 <= value <= 15 */
+               /* 0 <= value <= 15 */
                set_brightness(value);
        } else if (count < 0) {
                printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
@@ -779,7 +767,7 @@ proc_write_brn(struct file *file, const char __user *buffer,
 static void set_display(int value)
 {
        /* no sanity check needed for now */
-       if (!write_acpi_int(hotk->handle, hotk->methods->display_set, 
+       if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
                            value, NULL))
                printk(KERN_WARNING "Asus ACPI: Error setting display\n");
        return;
@@ -791,13 +779,14 @@ static void set_display(int value)
  */
 static int
 proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
-             void *data)
+              void *data)
 {
        int value = 0;
-       
+
        if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
-               printk(KERN_WARNING "Asus ACPI: Error reading display status\n");
-       value &= 0x07; /* needed for some models, shouldn't hurt others */
+               printk(KERN_WARNING
+                      "Asus ACPI: Error reading display status\n");
+       value &= 0x07;          /* needed for some models, shouldn't hurt others */
        return sprintf(page, "%d\n", value);
 }
 
@@ -808,8 +797,8 @@ proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
  * simultaneously, so be warned. See the acpi4asus README for more info.
  */
 static int
-proc_write_disp(struct file *file, const char __user *buffer,
-              unsigned long count, void *data)
+proc_write_disp(struct file *file, const char __user * buffer,
+               unsigned long count, void *data)
 {
        int value;
 
@@ -822,19 +811,19 @@ proc_write_disp(struct file *file, const char __user *buffer,
        return count;
 }
 
-
-typedef int (proc_readfunc)(char *page, char **start, off_t off, int count,
-                            int *eof, void *data);
-typedef int (proc_writefunc)(struct file *file, const char __user *buffer,
-                             unsigned long count, void *data);
+typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
+                            int *eof, void *data);
+typedef int (proc_writefunc) (struct file * file, const char __user * buffer,
+                             unsigned long count, void *data);
 
 static int
-__init asus_proc_add(char *name, proc_writefunc *writefunc,
-                    proc_readfunc *readfunc, mode_t mode,
-                    struct acpi_device *device)
+__init asus_proc_add(char *name, proc_writefunc * writefunc,
+                    proc_readfunc * readfunc, mode_t mode,
+                    struct acpi_device *device)
 {
-       struct proc_dir_entry *proc = create_proc_entry(name, mode, acpi_device_dir(device));
-       if(!proc) {
+       struct proc_dir_entry *proc =
+           create_proc_entry(name, mode, acpi_device_dir(device));
+       if (!proc) {
                printk(KERN_WARNING "  Unable to create %s fs entry\n", name);
                return -1;
        }
@@ -851,14 +840,14 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *proc;
        mode_t mode;
-       
+
        /*
         * If parameter uid or gid is not changed, keep the default setting for
         * our proc entries (-rw-rw-rw-) else, it means we care about security,
         * and then set to -rw-rw----
         */
 
-       if ((asus_uid == 0) && (asus_gid == 0)){
+       if ((asus_uid == 0) && (asus_gid == 0)) {
                mode = S_IFREG | S_IRUGO | S_IWUGO;
        } else {
                mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
@@ -881,15 +870,18 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
        }
 
        if (hotk->methods->mt_wled) {
-               asus_proc_add(PROC_WLED, &proc_write_wled, &proc_read_wled, mode, device);
+               asus_proc_add(PROC_WLED, &proc_write_wled, &proc_read_wled,
+                             mode, device);
        }
 
        if (hotk->methods->mt_mled) {
-               asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled, mode, device);
+               asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled,
+                             mode, device);
        }
 
        if (hotk->methods->mt_tled) {
-               asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled, mode, device);
+               asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled,
+                             mode, device);
        }
 
        /* 
@@ -897,35 +889,40 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
         * from keyboard 
         */
        if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) {
-               asus_proc_add(PROC_LCD, &proc_write_lcd, &proc_read_lcd, mode, device);
+               asus_proc_add(PROC_LCD, &proc_write_lcd, &proc_read_lcd, mode,
+                             device);
        }
-       
+
        if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
            (hotk->methods->brightness_get && hotk->methods->brightness_set)) {
-               asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode, device);
+               asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode,
+                             device);
        }
 
        if (hotk->methods->display_set) {
-               asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp, mode, device);
+               asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp,
+                             mode, device);
        }
 
        return 0;
 }
 
-static int asus_hotk_remove_fs(struct acpi_device* device)
+static int asus_hotk_remove_fs(struct acpi_device *device)
 {
-       if(acpi_device_dir(device)) {
-               remove_proc_entry(PROC_INFO,acpi_device_dir(device));
+       if (acpi_device_dir(device)) {
+               remove_proc_entry(PROC_INFO, acpi_device_dir(device));
                if (hotk->methods->mt_wled)
-                       remove_proc_entry(PROC_WLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_WLED, acpi_device_dir(device));
                if (hotk->methods->mt_mled)
-                       remove_proc_entry(PROC_MLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_MLED, acpi_device_dir(device));
                if (hotk->methods->mt_tled)
-                       remove_proc_entry(PROC_TLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_TLED, acpi_device_dir(device));
                if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
                        remove_proc_entry(PROC_LCD, acpi_device_dir(device));
-               if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
-                   (hotk->methods->brightness_get && hotk->methods->brightness_set))
+               if ((hotk->methods->brightness_up
+                    && hotk->methods->brightness_down)
+                   || (hotk->methods->brightness_get
+                       && hotk->methods->brightness_set))
                        remove_proc_entry(PROC_BRN, acpi_device_dir(device));
                if (hotk->methods->display_set)
                        remove_proc_entry(PROC_DISP, acpi_device_dir(device));
@@ -933,16 +930,15 @@ static int asus_hotk_remove_fs(struct acpi_device* device)
        return 0;
 }
 
-
 static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
 {
-       /* TODO Find a better way to handle events count.*/
+       /* TODO Find a better way to handle events count. */
        if (!hotk)
                return;
 
        if ((event & ~((u32) BR_UP)) < 16) {
                hotk->brightness = (event & ~((u32) BR_UP));
-       } else if ((event & ~((u32) BR_DOWN)) < 16 ) {
+       } else if ((event & ~((u32) BR_DOWN)) < 16) {
                hotk->brightness = (event & ~((u32) BR_DOWN));
        }
 
@@ -976,7 +972,7 @@ static int __init asus_hotk_get_info(void)
        if (ACPI_FAILURE(status))
                printk(KERN_WARNING "  Couldn't get the DSDT table header\n");
        else
-               asus_info = (struct acpi_table_header *) dsdt.pointer;
+               asus_info = (struct acpi_table_header *)dsdt.pointer;
 
        /* We have to write 0 on init this far for all ASUS models */
        if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
@@ -988,15 +984,17 @@ static int __init asus_hotk_get_info(void)
        if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
                printk(KERN_WARNING "  Error calling BSTS\n");
        else if (bsts_result)
-               printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n", bsts_result);
+               printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n",
+                      bsts_result);
 
        /* Samsung P30 has a device with a valid _HID whose INIT does not 
         * return anything. Catch this one and any similar here */
        if (buffer.pointer == NULL) {
-               if (asus_info && /* Samsung P30 */
+               if (asus_info &&        /* Samsung P30 */
                    strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
                        hotk->model = P30;
-                       printk(KERN_NOTICE "  Samsung P30 detected, supported\n");
+                       printk(KERN_NOTICE
+                              "  Samsung P30 detected, supported\n");
                } else {
                        hotk->model = M2E;
                        printk(KERN_WARNING "  no string returned by INIT\n");
@@ -1006,10 +1004,11 @@ static int __init asus_hotk_get_info(void)
                hotk->methods = &model_conf[hotk->model];
                return AE_OK;
        }
-       
-       model = (union acpi_object *) buffer.pointer;
+
+       model = (union acpi_object *)buffer.pointer;
        if (model->type == ACPI_TYPE_STRING) {
-               printk(KERN_NOTICE "  %s model detected, ", model->string.pointer);
+               printk(KERN_NOTICE "  %s model detected, ",
+                      model->string.pointer);
        }
 
        hotk->model = END_MODEL;
@@ -1035,7 +1034,7 @@ static int __init asus_hotk_get_info(void)
                 strncmp(model->string.pointer, "M6N", 3) == 0 ||
                 strncmp(model->string.pointer, "S1N", 3) == 0 ||
                 strncmp(model->string.pointer, "S5N", 3) == 0 ||
-                 strncmp(model->string.pointer, "W1N", 3) == 0)
+                strncmp(model->string.pointer, "W1N", 3) == 0)
                hotk->model = xxN;
        else if (strncmp(model->string.pointer, "M1", 2) == 0)
                hotk->model = M1A;
@@ -1069,21 +1068,21 @@ static int __init asus_hotk_get_info(void)
 
        /* Sort of per-model blacklist */
        if (strncmp(model->string.pointer, "L2B", 3) == 0)
-               hotk->methods->lcd_status = NULL; 
+               hotk->methods->lcd_status = NULL;
        /* L2B is similar enough to L3C to use its settings, with this only 
           exception */
        else if (strncmp(model->string.pointer, "S5N", 3) == 0 ||
                 strncmp(model->string.pointer, "M5N", 3) == 0)
-               hotk->methods->mt_mled = NULL; 
+               hotk->methods->mt_mled = NULL;
        /* S5N and M5N have no MLED */
        else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
                 strncmp(model->string.pointer, "W1N", 3) == 0)
-               hotk->methods->mt_wled = "WLED"; 
+               hotk->methods->mt_wled = "WLED";
        /* M2N and W1N have a usable WLED */
        else if (asus_info) {
                if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
                        hotk->methods->mled_status = NULL;
-       /* S1300A reports L84F, but L1400B too, account for that */
+               /* S1300A reports L84F, but L1400B too, account for that */
        }
 
        acpi_os_free(model);
@@ -1091,7 +1090,6 @@ static int __init asus_hotk_get_info(void)
        return AE_OK;
 }
 
-
 static int __init asus_hotk_check(void)
 {
        int result = 0;
@@ -1110,7 +1108,6 @@ static int __init asus_hotk_check(void)
        return result;
 }
 
-
 static int __init asus_hotk_add(struct acpi_device *device)
 {
        acpi_status status = AE_OK;
@@ -1123,7 +1120,7 @@ static int __init asus_hotk_add(struct acpi_device *device)
               ASUS_ACPI_VERSION);
 
        hotk =
-           (struct asus_hotk *) kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
+           (struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
        if (!hotk)
                return -ENOMEM;
        memset(hotk, 0, sizeof(struct asus_hotk));
@@ -1134,7 +1131,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
        acpi_driver_data(device) = hotk;
        hotk->device = device;
 
-
        result = asus_hotk_check();
        if (result)
                goto end;
@@ -1153,17 +1149,22 @@ static int __init asus_hotk_add(struct acpi_device *device)
                printk(KERN_ERR "  Error installing notify handler\n");
 
        /* For laptops without GPLV: init the hotk->brightness value */
-       if ((!hotk->methods->brightness_get) && (!hotk->methods->brightness_status) &&
-           (hotk->methods->brightness_up && hotk->methods->brightness_down)) {
-               status = acpi_evaluate_object(NULL, hotk->methods->brightness_down,
-                                             NULL, NULL);
+       if ((!hotk->methods->brightness_get)
+           && (!hotk->methods->brightness_status)
+           && (hotk->methods->brightness_up
+               && hotk->methods->brightness_down)) {
+               status =
+                   acpi_evaluate_object(NULL, hotk->methods->brightness_down,
+                                        NULL, NULL);
                if (ACPI_FAILURE(status))
                        printk(KERN_WARNING "  Error changing brightness\n");
                else {
-                       status = acpi_evaluate_object(NULL, hotk->methods->brightness_up,
-                                                     NULL, NULL);
+                       status =
+                           acpi_evaluate_object(NULL,
+                                                hotk->methods->brightness_up,
+                                                NULL, NULL);
                        if (ACPI_FAILURE(status))
-                               printk(KERN_WARNING "  Strange, error changing" 
+                               printk(KERN_WARNING "  Strange, error changing"
                                       " brightness\n");
                }
        }
@@ -1176,7 +1177,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
        return result;
 }
 
-
 static int asus_hotk_remove(struct acpi_device *device, int type)
 {
        acpi_status status = 0;
@@ -1196,7 +1196,6 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
        return 0;
 }
 
-
 static int __init asus_acpi_init(void)
 {
        int result;
@@ -1204,9 +1203,9 @@ static int __init asus_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled){
+       if (!acpi_specific_hotkey_enabled) {
                printk(KERN_ERR "Using generic hotkey driver\n");
-               return -ENODEV; 
+               return -ENODEV;
        }
        asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
        if (!asus_proc_dir) {
@@ -1225,7 +1224,6 @@ static int __init asus_acpi_init(void)
        return 0;
 }
 
-
 static void __exit asus_acpi_exit(void)
 {
        acpi_bus_unregister_driver(&asus_hotk_driver);
index c55feca..702e857 100644 (file)
@@ -34,7 +34,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF
 
 #define ACPI_BATTERY_FORMAT_BIF        "NNNNNNNNNSSSS"
 #define ACPI_BATTERY_UNITS_WATTS       "mW"
 #define ACPI_BATTERY_UNITS_AMPS                "mA"
 
-
 #define _COMPONENT             ACPI_BATTERY_COMPONENT
-ACPI_MODULE_NAME               ("acpi_battery")
+ACPI_MODULE_NAME("acpi_battery")
 
-MODULE_AUTHOR("Paul Diefenbaugh");
+    MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-static int acpi_battery_add (struct acpi_device *device);
-static int acpi_battery_remove (struct acpi_device *device, int type);
+static int acpi_battery_add(struct acpi_device *device);
+static int acpi_battery_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_battery_driver = {
-       .name =         ACPI_BATTERY_DRIVER_NAME,
-       .class =        ACPI_BATTERY_CLASS,
-       .ids =          ACPI_BATTERY_HID,
-       .ops =          {
-                               .add =          acpi_battery_add,
-                               .remove =       acpi_battery_remove,
-                       },
+       .name = ACPI_BATTERY_DRIVER_NAME,
+       .class = ACPI_BATTERY_CLASS,
+       .ids = ACPI_BATTERY_HID,
+       .ops = {
+               .add = acpi_battery_add,
+               .remove = acpi_battery_remove,
+               },
 };
 
 struct acpi_battery_status {
-       acpi_integer            state;
-       acpi_integer            present_rate;
-       acpi_integer            remaining_capacity;
-       acpi_integer            present_voltage;
+       acpi_integer state;
+       acpi_integer present_rate;
+       acpi_integer remaining_capacity;
+       acpi_integer present_voltage;
 };
 
 struct acpi_battery_info {
-       acpi_integer            power_unit;
-       acpi_integer            design_capacity;
-       acpi_integer            last_full_capacity;
-       acpi_integer            battery_technology;
-       acpi_integer            design_voltage;
-       acpi_integer            design_capacity_warning;
-       acpi_integer            design_capacity_low;
-       acpi_integer            battery_capacity_granularity_1;
-       acpi_integer            battery_capacity_granularity_2;
-       acpi_string             model_number;
-       acpi_string             serial_number;
-       acpi_string             battery_type;
-       acpi_string             oem_info;
+       acpi_integer power_unit;
+       acpi_integer design_capacity;
+       acpi_integer last_full_capacity;
+       acpi_integer battery_technology;
+       acpi_integer design_voltage;
+       acpi_integer design_capacity_warning;
+       acpi_integer design_capacity_low;
+       acpi_integer battery_capacity_granularity_1;
+       acpi_integer battery_capacity_granularity_2;
+       acpi_string model_number;
+       acpi_string serial_number;
+       acpi_string battery_type;
+       acpi_string oem_info;
 };
 
 struct acpi_battery_flags {
-       u8                      present:1;      /* Bay occupied? */
-       u8                      power_unit:1;   /* 0=watts, 1=apms */
-       u8                      alarm:1;        /* _BTP present? */
-       u8                      reserved:5;
+       u8 present:1;           /* Bay occupied? */
+       u8 power_unit:1;        /* 0=watts, 1=apms */
+       u8 alarm:1;             /* _BTP present? */
+       u8 reserved:5;
 };
 
 struct acpi_battery_trips {
-       unsigned long           warning;
-       unsigned long           low;
+       unsigned long warning;
+       unsigned long low;
 };
 
 struct acpi_battery {
-       acpi_handle             handle;
+       acpi_handle handle;
        struct acpi_battery_flags flags;
        struct acpi_battery_trips trips;
-       unsigned long           alarm;
+       unsigned long alarm;
        struct acpi_battery_info *info;
 };
 
-
 /* --------------------------------------------------------------------------
                                Battery Management
    -------------------------------------------------------------------------- */
 
 static int
-acpi_battery_get_info (
-       struct acpi_battery     *battery,
-       struct acpi_battery_info **bif)
+acpi_battery_get_info(struct acpi_battery *battery,
+                     struct acpi_battery_info **bif)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_buffer      buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       struct acpi_buffer      format = {sizeof(ACPI_BATTERY_FORMAT_BIF),
-                                               ACPI_BATTERY_FORMAT_BIF};
-       struct acpi_buffer      data = {0, NULL};
-       union acpi_object       *package = NULL;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BIF),
+               ACPI_BATTERY_FORMAT_BIF
+       };
+       struct acpi_buffer data = { 0, NULL };
+       union acpi_object *package = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_get_info");
 
@@ -148,7 +145,7 @@ acpi_battery_get_info (
                return_VALUE(-ENODEV);
        }
 
-       package = (union acpi_object *) buffer.pointer;
+       package = (union acpi_object *)buffer.pointer;
 
        /* Extract Package Data */
 
@@ -174,27 +171,27 @@ acpi_battery_get_info (
                goto end;
        }
 
-end:
+      end:
        acpi_os_free(buffer.pointer);
 
        if (!result)
-               (*bif) = (struct acpi_battery_info *) data.pointer;
+               (*bif) = (struct acpi_battery_info *)data.pointer;
 
        return_VALUE(result);
 }
 
 static int
-acpi_battery_get_status (
-       struct acpi_battery     *battery,
-       struct acpi_battery_status **bst)
+acpi_battery_get_status(struct acpi_battery *battery,
+                       struct acpi_battery_status **bst)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_buffer      buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       struct acpi_buffer      format = {sizeof(ACPI_BATTERY_FORMAT_BST),
-                                               ACPI_BATTERY_FORMAT_BST};
-       struct acpi_buffer      data = {0, NULL};
-       union acpi_object       *package = NULL;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BST),
+               ACPI_BATTERY_FORMAT_BST
+       };
+       struct acpi_buffer data = { 0, NULL };
+       union acpi_object *package = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_get_status");
 
@@ -209,7 +206,7 @@ acpi_battery_get_status (
                return_VALUE(-ENODEV);