Skip to contentSkip to conversation

APM emulation reunion

PATCH New Rodolfo Giometti 1 participant 1 message Jul 20, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 APM emulation reunion

Hello,

here a patch to unify the APM enulation supports for ARM and MIPS.

I put APM emulation code into a dedicated directory so it can be used to put there the APM-emu per board specific code. For instance on my system I added the following lines to the "Kconfig" file:

config CONFIG_WWPC1000_APM_EMU
tristate "APM support for WWPC1000"
depends APM_EMU
default y

The kernel configuration file is now unique and not duplicated anymore.

Also I modified the configuration define "CONFIG_APM" to "CONFIG_APM_EMU" in order to avoid conflicts with real APM support. Doing like this these boards' configuration files should be updated:

arch/arm/configs/bast_defconfig:CONFIG_APM=y arch/arm/configs/collie_defconfig:CONFIG_APM=y arch/arm/configs/corgi_defconfig:CONFIG_APM=y arch/arm/configs/ixp4xx_defconfig:CONFIG_APM=y arch/arm/configs/neponset_defconfig:CONFIG_APM=y arch/arm/configs/s3c2410_defconfig:CONFIG_APM=y arch/arm/configs/simpad_defconfig:CONFIG_APM=y arch/arm/configs/spitz_defconfig:CONFIG_APM=y arch/arm/configs/trizeps4_defconfig:CONFIG_APM=y

Ciao,

Rodolfo

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127
arch/arm/Kconfig +1 -26
index f81a623..d039838 100644
@@ -797,32 +797,7 @@ menu "Power management options"
 
 source "kernel/power/Kconfig"
 
-config APM
-	tristate "Advanced Power Management Emulation"
-	---help---
-	  APM is a BIOS specification for saving power using several different
-	  techniques. This is mostly useful for battery powered laptops with
-	  APM compliant BIOSes. If you say Y here, the system time will be
-	  reset after a RESUME operation, the /proc/apm device will provide
-	  battery status information, and user-space programs will receive
-	  notification of APM "events" (e.g. battery status change).
-
-	  In order to use APM, you will need supporting software. For location
-	  and more information, read <file:Documentation/pm.txt> and the
-	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.
-
-	  This driver does not spin down disk drives (see the hdparm(8)
-	  manpage ("man 8 hdparm") for that), and it doesn't turn off
-	  VESA-compliant "green" monitors.
-
-	  Generally, if you don't have a battery in your machine, there isn't
-	  much point in using this driver and you should say N. If you get
-	  random kernel OOPSes or reboots that don't seem to be related to
-	  anything, try disabling/enabling this option (or disabling/enabling
-	  APM in your BIOS).
-
-endmenu
+source "drivers/apm-emu/Kconfig"
 
 source "net/Kconfig"
 
arch/arm/kernel/Makefile +0 -1
index f0c0cdb..fe7d480 100644
@@ -10,7 +10,6 @@ obj-y		:= compat.o entry-armv.o entry-co
 		   process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
 		   time.o traps.o
 
-obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_ISA_DMA_API)	+= dma.o
 obj-$(CONFIG_ARCH_ACORN)	+= ecard.o 
 obj-$(CONFIG_FOOTBRIDGE)	+= isa.o
arch/arm/kernel/apm.c deleted +0 -604

604 lines not on this page · raw message

arch/mips/Kconfig +9 -29
index 309757a..ccdee59 100644
@@ -2018,35 +2018,15 @@ config SECCOMP
 
 	  If unsure, say Y. Only embedded should say N here.
 
-config PM
-	bool "Power Management support (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && SOC_AU1X00
-
-config APM
-        tristate "Advanced Power Management Emulation"
-	depends on PM
-        ---help---
-	  APM is a BIOS specification for saving power using several different
-	  techniques. This is mostly useful for battery powered systems with
-	  APM compliant BIOSes. If you say Y here, the system time will be
-	  reset after a RESUME operation, the /proc/apm device will provide
-	  battery status information, and user-space programs will receive
-	  notification of APM "events" (e.g. battery status change).
-
-	  In order to use APM, you will need supporting software. For location
-	  and more information, read <file:Documentation/pm.txt> and the
-	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.
-
-	  This driver does not spin down disk drives (see the hdparm(8)
-	  manpage ("man 8 hdparm") for that), and it doesn't turn off
-	  VESA-compliant "green" monitors.
-
-	  Generally, if you don't have a battery in your machine, there isn't
-	  much point in using this driver and you should say N. If you get
-	  random kernel OOPSes or reboots that don't seem to be related to
-	  anything, try disabling/enabling this option (or disabling/enabling
-	  APM in your BIOS).
+endmenu
+
+menu "Power management options"
+
+if SOC_AU1X00
+source "kernel/power/Kconfig"
+endif
+
+source "drivers/apm-emu/Kconfig"
 
 endmenu
 
arch/mips/kernel/Makefile +0 -2
index 881c467..34e8a25 100644
@@ -13,8 +13,6 @@ binfmt_irix-objs	:= irixelf.o irixinv.o 
 
 obj-$(CONFIG_MODULES)		+= mips_ksyms.o module.o
 
-obj-$(CONFIG_APM)		+= apm.o
-
 obj-$(CONFIG_CPU_R3000)		+= r2300_fpu.o r2300_switch.o
 obj-$(CONFIG_CPU_TX39XX)	+= r2300_fpu.o r2300_switch.o
 obj-$(CONFIG_CPU_TX49XX)	+= r4k_fpu.o r4k_switch.o
drivers/Makefile +1 -0
index fc2d744..c3c2abd 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_PARISC)		+= parisc/
 obj-$(CONFIG_RAPIDIO)		+= rapidio/
 obj-y				+= video/
 obj-$(CONFIG_ACPI)		+= acpi/
+obj-$(CONFIG_APM_EMU)		+= apm-emu/
 # 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/
drivers/apm-emu/Kconfig new file +25 -0
new file mode 100644
index 0000000..a37f1cc
@@ -0,0 +1,25 @@
+#
+# APM Emulator Configuration
+#
+
+config APM_EMU
+        tristate "Advanced Power Management (APM) Emulation"
+        ---help---
+	  APM is a BIOS specification for saving power using several different
+	  techniques. This is mostly useful for battery powered systems with
+	  APM compliant BIOSes. If you say Y here, the system time will be
+	  reset after a RESUME operation, the /proc/apm device will provide
+	  battery status information, and user-space programs will receive
+	  notification of APM "events" (e.g. battery status change).
+
+	  In order to use APM, you will need supporting software. For location
+	  and more information, read <file:Documentation/pm.txt> and the
+	  Battery Powered Linux mini-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>.
+
+	  Please, note that this driver is just an emulation of BIOS APM, so
+	  you have to add specific support for your board in order to make
+	  it work.
+
+	  Generally, if you don't have a battery in your machine, there isn't
+	  much point in using this driver and you should say N.
drivers/apm-emu/Makefile new file +5 -0
new file mode 100644
index 0000000..751ce37
@@ -0,0 +1,5 @@
+#
+# Makefile for the Linux APM Emulator
+#
+
+obj-$(CONFIG_APM_EMU)               += apm-emu.o
drivers/apm-emu/apm-emu.c renamed from arch/mips/kernel/apm.c +39 -15

95 lines not on this page · raw message