diff --git a/[refs] b/[refs] index 836f1c0b06ba..4b125c192952 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6a28a05f9b1b4db920e390ac89968ed6d2e4b8ec +refs/heads/master: 8f5ad1a8227aa110d633b5ed04dde535381c16c7 diff --git a/trunk/Makefile b/trunk/Makefile index dfe3d1610a7b..23f81c9f698e 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) -LDFLAGS_MODULE = +LDFLAGS_MODULE = -r CFLAGS_KERNEL = AFLAGS_KERNEL = diff --git a/trunk/arch/i386/boot/apm.c b/trunk/arch/i386/boot/apm.c index eab50c55a3a5..a34087c370c0 100644 --- a/trunk/arch/i386/boot/apm.c +++ b/trunk/arch/i386/boot/apm.c @@ -40,15 +40,14 @@ int query_apm_bios(void) if (bx != 0x504d) /* "PM" signature */ return -1; - if (!(cx & 0x02)) /* 32 bits supported? */ + if (cx & 0x02) /* 32 bits supported? */ return -1; /* Disconnect first, just in case */ ax = 0x5304; - bx = 0; asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp" - : "+a" (ax), "+b" (bx) - : : "ecx", "edx", "esi", "edi"); + : "+a" (ax) + : : "ebx", "ecx", "edx", "esi", "edi"); /* Paranoia */ ebx = esi = 0; diff --git a/trunk/arch/i386/boot/main.c b/trunk/arch/i386/boot/main.c index 0eeef3989a17..7f01f96c4fb8 100644 --- a/trunk/arch/i386/boot/main.c +++ b/trunk/arch/i386/boot/main.c @@ -73,15 +73,15 @@ static void keyboard_set_repeat(void) } /* - * Get Intel SpeedStep (IST) information. + * Get Intel SpeedStep IST information. */ -static void query_ist(void) +static void query_speedstep_ist(void) { asm("int $0x15" - : "=a" (boot_params.ist_info.signature), - "=b" (boot_params.ist_info.command), - "=c" (boot_params.ist_info.event), - "=d" (boot_params.ist_info.perf_level) + : "=a" (boot_params.speedstep_info[0]), + "=b" (boot_params.speedstep_info[1]), + "=c" (boot_params.speedstep_info[2]), + "=d" (boot_params.speedstep_info[3]) : "a" (0x0000e980), /* IST Support */ "d" (0x47534943)); /* Request value */ } @@ -144,8 +144,8 @@ void main(void) query_voyager(); #endif - /* Query Intel SpeedStep (IST) information */ - query_ist(); + /* Query SpeedStep IST information */ + query_speedstep_ist(); /* Query APM information */ #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) diff --git a/trunk/arch/i386/kernel/acpi/Makefile b/trunk/arch/i386/kernel/acpi/Makefile index 223f58fc9f46..7f7be01f44e6 100644 --- a/trunk/arch/i386/kernel/acpi/Makefile +++ b/trunk/arch/i386/kernel/acpi/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o ifneq ($(CONFIG_PCI),) obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o endif -obj-$(CONFIG_ACPI) += sleep.o wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o ifneq ($(CONFIG_ACPI_PROCESSOR),) obj-y += cstate.o processor.o diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c index 7fe5da3c932e..d474cd639bcb 100644 --- a/trunk/arch/i386/kernel/setup.c +++ b/trunk/arch/i386/kernel/setup.c @@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void) */ reserve_bootmem(PAGE_SIZE, PAGE_SIZE); #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP /* * Reserve low memory region for sleep support. */ diff --git a/trunk/arch/i386/mm/init.c b/trunk/arch/i386/mm/init.c index 1b1a1e66d099..c3b9905af2d5 100644 --- a/trunk/arch/i386/mm/init.c +++ b/trunk/arch/i386/mm/init.c @@ -432,7 +432,7 @@ static void __init pagetable_init (void) paravirt_pagetable_setup_done(pgd_base); } -#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI) +#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP) /* * Swap suspend & friends need this for resume because things like the intel-agp * driver might have split up a kernel 4MB mapping. diff --git a/trunk/arch/ia64/kernel/acpi.c b/trunk/arch/ia64/kernel/acpi.c index c6ede8780ded..103dd8edda71 100644 --- a/trunk/arch/ia64/kernel/acpi.c +++ b/trunk/arch/ia64/kernel/acpi.c @@ -67,8 +67,6 @@ EXPORT_SYMBOL(pm_power_off); unsigned int acpi_cpei_override; unsigned int acpi_cpei_phys_cpuid; -unsigned long acpi_wakeup_address = 0; - const char __init * acpi_get_sysname(void) { @@ -988,21 +986,4 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) EXPORT_SYMBOL(acpi_unregister_ioapic); -/* - * acpi_save_state_mem() - save kernel state - * - * TBD when when IA64 starts to support suspend... - */ -int acpi_save_state_mem(void) { return 0; } - -/* - * acpi_restore_state() - */ -void acpi_restore_state_mem(void) {} - -/* - * do_suspend_lowlevel() - */ -void do_suspend_lowlevel(void) {} - #endif /* CONFIG_ACPI */ diff --git a/trunk/arch/ia64/kernel/irq_ia64.c b/trunk/arch/ia64/kernel/irq_ia64.c index 91797c111162..158eafb5f1aa 100644 --- a/trunk/arch/ia64/kernel/irq_ia64.c +++ b/trunk/arch/ia64/kernel/irq_ia64.c @@ -212,9 +212,6 @@ assign_irq_vector (int irq) vector = -ENOSPC; spin_lock_irqsave(&vector_lock, flags); - if (irq < 0) { - goto out; - } for_each_online_cpu(cpu) { domain = vector_allocation_domain(cpu); vector = find_unassigned_vector(domain); @@ -223,6 +220,8 @@ assign_irq_vector (int irq) } if (vector < 0) goto out; + if (irq == AUTO_ASSIGN) + irq = vector; BUG_ON(__bind_irq_vector(irq, vector, domain)); out: spin_unlock_irqrestore(&vector_lock, flags); diff --git a/trunk/arch/m68knommu/Kconfig b/trunk/arch/m68knommu/Kconfig index 185906b54cb0..1175ceff8b2a 100644 --- a/trunk/arch/m68knommu/Kconfig +++ b/trunk/arch/m68knommu/Kconfig @@ -216,18 +216,6 @@ config XCOPILOT_BUGS help Support the bugs of Xcopilot. -config UC5272 - bool 'Arcturus Networks uC5272 dimm board support' - depends on M5272 - help - Support for the Arcturus Networks uC5272 dimm board. - -config UC5282 - bool "Arcturus Networks uC5282 board support" - depends on M528x - help - Support for the Arcturus Networks uC5282 dimm board. - config UCSIMM bool "uCsimm module support" depends on M68EZ328 @@ -354,18 +342,6 @@ config SOM5282EM depends on M528x help Support for the EMAC.Inc SOM5282EM module. - -config WILDFIRE - bool "Intec Automation Inc. WildFire board support" - depends on M528x - help - Support for the Intec Automation Inc. WildFire. - -config WILDFIREMOD - bool "Intec Automation Inc. WildFire module support" - depends on M528x - help - Support for the Intec Automation Inc. WildFire module. config ARN5307 bool "Arnewsh 5307 board support" diff --git a/trunk/arch/m68knommu/Makefile b/trunk/arch/m68knommu/Makefile index 1305cc980023..8951793fd8d4 100644 --- a/trunk/arch/m68knommu/Makefile +++ b/trunk/arch/m68knommu/Makefile @@ -26,8 +26,6 @@ platform-$(CONFIG_M5407) := 5407 PLATFORM := $(platform-y) board-$(CONFIG_PILOT) := pilot -board-$(CONFIG_UC5272) := UC5272 -board-$(CONFIG_UC5282) := UC5282 board-$(CONFIG_UCSIMM) := ucsimm board-$(CONFIG_UCDIMM) := ucdimm board-$(CONFIG_UCQUICC) := uCquicc diff --git a/trunk/arch/m68knommu/kernel/dma.c b/trunk/arch/m68knommu/kernel/dma.c index e10eafc52789..0a25874a2aae 100644 --- a/trunk/arch/m68knommu/kernel/dma.c +++ b/trunk/arch/m68knommu/kernel/dma.c @@ -8,7 +8,6 @@ #include #include #include -#include #include void *dma_alloc_coherent(struct device *dev, size_t size, diff --git a/trunk/arch/m68knommu/kernel/setup.c b/trunk/arch/m68knommu/kernel/setup.c index a5ac0d40fbec..2203f694f26b 100644 --- a/trunk/arch/m68knommu/kernel/setup.c +++ b/trunk/arch/m68knommu/kernel/setup.c @@ -132,11 +132,6 @@ void setup_arch(char **cmdline_p) config_BSP(&command_line[0], sizeof(command_line)); -#if defined(CONFIG_BOOTPARAM) - strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); - command_line[sizeof(command_line) - 1] = 0; -#endif - printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n"); #ifdef CONFIG_UCDIMM diff --git a/trunk/arch/m68knommu/platform/5206/config.c b/trunk/arch/m68knommu/platform/5206/config.c index d265ed4e5afc..3343830aad10 100644 --- a/trunk/arch/m68knommu/platform/5206/config.c +++ b/trunk/arch/m68knommu/platform/5206/config.c @@ -98,6 +98,14 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); + +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_timer_init; mach_tick = coldfire_tick; mach_gettimeoffset = coldfire_timer_offset; diff --git a/trunk/arch/m68knommu/platform/5206e/config.c b/trunk/arch/m68knommu/platform/5206e/config.c index 7fa5e8254c31..0f67320b4031 100644 --- a/trunk/arch/m68knommu/platform/5206e/config.c +++ b/trunk/arch/m68knommu/platform/5206e/config.c @@ -98,10 +98,15 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if defined(CONFIG_NETtel) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0004000, size); commandp[size-1] = 0; +#else + memset(commandp, 0, size); #endif /* CONFIG_NETtel */ mach_sched_init = coldfire_timer_init; diff --git a/trunk/arch/m68knommu/platform/520x/config.c b/trunk/arch/m68knommu/platform/520x/config.c index 85830f9882f3..58b2878deb61 100644 --- a/trunk/arch/m68knommu/platform/520x/config.c +++ b/trunk/arch/m68knommu/platform/520x/config.c @@ -48,6 +48,13 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/523x/config.c b/trunk/arch/m68knommu/platform/523x/config.c index c0157e110035..9b054e6caee2 100644 --- a/trunk/arch/m68knommu/platform/523x/config.c +++ b/trunk/arch/m68knommu/platform/523x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/5249/config.c b/trunk/arch/m68knommu/platform/5249/config.c index 4cdeb719512d..d6706079d64a 100644 --- a/trunk/arch/m68knommu/platform/5249/config.c +++ b/trunk/arch/m68knommu/platform/5249/config.c @@ -96,6 +96,14 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); + +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_timer_init; mach_tick = coldfire_tick; mach_gettimeoffset = coldfire_timer_offset; diff --git a/trunk/arch/m68knommu/platform/5272/config.c b/trunk/arch/m68knommu/platform/5272/config.c index 609b10e4b9b9..6b437cc97776 100644 --- a/trunk/arch/m68knommu/platform/5272/config.c +++ b/trunk/arch/m68knommu/platform/5272/config.c @@ -113,7 +113,10 @@ void config_BSP(char *commandp, int size) mcf_disableall(); -#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0004000, size); commandp[size-1] = 0; @@ -125,6 +128,8 @@ void config_BSP(char *commandp, int size) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0010000, size); commandp[size-1] = 0; +#else + memset(commandp, 0, size); #endif mcf_timervector = 69; diff --git a/trunk/arch/m68knommu/platform/527x/config.c b/trunk/arch/m68knommu/platform/527x/config.c index 126dac066482..28e7d964eef1 100644 --- a/trunk/arch/m68knommu/platform/527x/config.c +++ b/trunk/arch/m68knommu/platform/527x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/528x/config.c b/trunk/arch/m68knommu/platform/528x/config.c index aab1ef0c1f78..805b4f74ff19 100644 --- a/trunk/arch/m68knommu/platform/528x/config.c +++ b/trunk/arch/m68knommu/platform/528x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/5307/config.c b/trunk/arch/m68knommu/platform/5307/config.c index 1f10e941b87c..e04b84deb57d 100644 --- a/trunk/arch/m68knommu/platform/5307/config.c +++ b/trunk/arch/m68knommu/platform/5307/config.c @@ -111,7 +111,10 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ defined(CONFIG_CLEOPATRA) /* Copy command line from FLASH to local buffer... */ @@ -121,6 +124,8 @@ void config_BSP(char *commandp, int size) mcf_timervector = 30; mcf_profilevector = 31; mcf_timerlevel = 6; +#else + memset(commandp, 0, size); #endif mach_sched_init = coldfire_timer_init; diff --git a/trunk/arch/m68knommu/platform/5307/entry.S b/trunk/arch/m68knommu/platform/5307/entry.S index a8cd867805ca..c358aebe0af3 100644 --- a/trunk/arch/m68knommu/platform/5307/entry.S +++ b/trunk/arch/m68knommu/platform/5307/entry.S @@ -213,12 +213,16 @@ ENTRY(ret_from_interrupt) * Beware - when entering resume, prev (the current task) is * in a0, next (the new task) is in a1,so don't change these * registers until their contents are no longer needed. - * This is always called in supervisor mode, so don't bother to save - * and restore sr; user's process sr is actually in the stack. */ ENTRY(resume) movel %a0, %d1 /* get prev thread in d1 */ + movew %sr,%d0 /* save thread status reg */ + movew %d0,%a0@(TASK_THREAD+THREAD_SR) + + oril #0x700,%d0 /* disable interrupts */ + move %d0,%sr + movel sw_usp,%d0 /* save usp */ movel %d0,%a0@(TASK_THREAD+THREAD_USP) @@ -229,4 +233,7 @@ ENTRY(resume) movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ movel %a0, sw_usp + + movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */ + movew %d0, %sr rts diff --git a/trunk/arch/m68knommu/platform/532x/config.c b/trunk/arch/m68knommu/platform/532x/config.c index dc39c466e33f..664c3a12b0c1 100644 --- a/trunk/arch/m68knommu/platform/532x/config.c +++ b/trunk/arch/m68knommu/platform/532x/config.c @@ -92,7 +92,10 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if !defined(CONFIG_BOOTPARAM) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0x4000, 4); if(strncmp(commandp, "kcl ", 4) == 0){ diff --git a/trunk/arch/m68knommu/platform/5407/config.c b/trunk/arch/m68knommu/platform/5407/config.c index fde417fdd650..036f62876241 100644 --- a/trunk/arch/m68knommu/platform/5407/config.c +++ b/trunk/arch/m68knommu/platform/5407/config.c @@ -102,6 +102,13 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + #if defined(CONFIG_CLEOPATRA) /* Different timer setup - to prevent device clash */ mcf_timervector = 30; diff --git a/trunk/arch/m68knommu/platform/68VZ328/config.c b/trunk/arch/m68knommu/platform/68VZ328/config.c index 79dced929c97..8abe0f6e7235 100644 --- a/trunk/arch/m68knommu/platform/68VZ328/config.c +++ b/trunk/arch/m68knommu/platform/68VZ328/config.c @@ -191,6 +191,13 @@ void config_BSP(char *command, int size) { printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); +#if defined(CONFIG_BOOTPARAM) + strncpy(command, CONFIG_BOOTPARAM_STRING, size); + command[size-1] = 0; +#else + memset(command, 0, size); +#endif + init_hardware(command, size); mach_sched_init = (void *) m68328_timer_init; diff --git a/trunk/arch/x86_64/kernel/acpi/Makefile b/trunk/arch/x86_64/kernel/acpi/Makefile index 17595d23fee7..080b9963f1bc 100644 --- a/trunk/arch/x86_64/kernel/acpi/Makefile +++ b/trunk/arch/x86_64/kernel/acpi/Makefile @@ -1,6 +1,6 @@ obj-y := boot.o boot-y := ../../../i386/kernel/acpi/boot.o -obj-y += sleep.o wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o ifneq ($(CONFIG_ACPI_PROCESSOR),) obj-y += processor.o diff --git a/trunk/arch/x86_64/kernel/acpi/sleep.c b/trunk/arch/x86_64/kernel/acpi/sleep.c index 79475d237071..4277f2b27e6d 100644 --- a/trunk/arch/x86_64/kernel/acpi/sleep.c +++ b/trunk/arch/x86_64/kernel/acpi/sleep.c @@ -51,6 +51,8 @@ Low-Level Sleep Support -------------------------------------------------------------------------- */ +#ifdef CONFIG_ACPI_SLEEP + /* address in low memory of the wakeup routine. */ unsigned long acpi_wakeup_address = 0; unsigned long acpi_realmode_flags; @@ -115,6 +117,8 @@ static int __init acpi_sleep_setup(char *str) __setup("acpi_sleep=", acpi_sleep_setup); +#endif /*CONFIG_ACPI_SLEEP */ + void acpi_pci_link_exit(void) { } diff --git a/trunk/arch/x86_64/kernel/head.S b/trunk/arch/x86_64/kernel/head.S index 3a16e417dd8d..e89abcdbdde8 100644 --- a/trunk/arch/x86_64/kernel/head.S +++ b/trunk/arch/x86_64/kernel/head.S @@ -120,7 +120,7 @@ ident_complete: addq %rbp, trampoline_level4_pgt + 0(%rip) addq %rbp, trampoline_level4_pgt + (511*8)(%rip) #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP addq %rbp, wakeup_level4_pgt + 0(%rip) addq %rbp, wakeup_level4_pgt + (511*8)(%rip) #endif diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 0f400f3c4694..af838f6b0b7f 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p) reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE); #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP /* * Reserve low memory region for sleep support. */ diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index 251344cb29ae..408b45168aba 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -11,9 +11,6 @@ menuconfig ACPI depends on PCI depends on PM select PNP - # for sleep - select HOTPLUG_CPU if X86 && SMP - select SUSPEND_SMP if X86 && SMP default y ---help--- Advanced Configuration and Power Interface (ACPI) support for @@ -45,26 +42,51 @@ menuconfig ACPI if ACPI +config ACPI_SLEEP + bool "Sleep States" + depends on X86 && (!SMP || SUSPEND_SMP) + default y + ---help--- + This option adds support for ACPI suspend states. + + With this option, you will be able to put the system "to sleep". + Sleep states are low power states for the system and devices. All + of the system operating state is saved to either memory or disk + (depending on the state), to allow the system to resume operation + quickly at your request. + + Although this option sounds really nifty, barely any of the device + drivers have been converted to the new driver model and hence few + have proper power management support. + + This option is not recommended for anyone except those doing driver + power management development. + +config ACPI_SLEEP_PROC_FS + bool + depends on ACPI_SLEEP && PROC_FS + default y + +config ACPI_SLEEP_PROC_SLEEP + bool "/proc/acpi/sleep (deprecated)" + depends on ACPI_SLEEP_PROC_FS + default n + ---help--- + Create /proc/acpi/sleep + Deprecated by /sys/power/state + config ACPI_PROCFS - bool "Deprecated /proc/acpi files" - depends on PROC_FS + bool "Procfs interface (deprecated)" + default y ---help--- - For backwards compatibility, this option allows - depricated /proc/acpi/ files to exist, even when - they have been replaced by functions in /sys. - The deprecated files (and their replacements) include: - - /proc/acpi/sleep (/sys/power/state) - /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) - /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) - /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) - /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) - /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) - - This option has no effect on /proc/acpi/ files - and functions which do not yet exist in /sys. - - Say N to delete /proc/acpi/ files that have moved to /sys/ + The Procfs interface for ACPI is made optional for backward compatibility. + As the same functions are duplicated in the sysfs interface + and this proc interface will be removed some time later, + it's marked as deprecated. + ( /proc/acpi/debug_layer && debug_level are deprecated by + /sys/module/acpi/parameters/debug_layer && debug_level. + /proc/acpi/info is deprecated by + /sys/module/acpi/parameters/acpica_version ) config ACPI_AC tristate "AC Adapter" diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index d8b35093527a..37c7dc4f9fe5 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -34,6 +34,7 @@ #define ACPI_AC_COMPONENT 0x00020000 #define ACPI_AC_CLASS "ac_adapter" +#define ACPI_AC_HID "ACPI0003" #define ACPI_AC_DEVICE_NAME "AC Adapter" #define ACPI_AC_FILE_STATE "state" #define ACPI_AC_NOTIFY_STATUS 0x80 @@ -55,16 +56,10 @@ 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); -const static struct acpi_device_id ac_device_ids[] = { - {"ACPI0003", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, ac_device_ids); - static struct acpi_driver acpi_ac_driver = { .name = "ac", .class = ACPI_AC_CLASS, - .ids = ac_device_ids, + .ids = ACPI_AC_HID, .ops = { .add = acpi_ac_add, .remove = acpi_ac_remove, diff --git a/trunk/drivers/acpi/acpi_memhotplug.c b/trunk/drivers/acpi/acpi_memhotplug.c index 5f1127ad5a95..e65628a03085 100644 --- a/trunk/drivers/acpi/acpi_memhotplug.c +++ b/trunk/drivers/acpi/acpi_memhotplug.c @@ -53,16 +53,10 @@ 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_start(struct acpi_device *device); -static const struct acpi_device_id memory_device_ids[] = { - {ACPI_MEMORY_DEVICE_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, memory_device_ids); - static struct acpi_driver acpi_memory_device_driver = { .name = "acpi_memhotplug", .class = ACPI_MEMORY_DEVICE_CLASS, - .ids = memory_device_ids, + .ids = ACPI_MEMORY_DEVICE_HID, .ops = { .add = acpi_memory_device_add, .remove = acpi_memory_device_remove, diff --git a/trunk/drivers/acpi/asus_acpi.c b/trunk/drivers/acpi/asus_acpi.c index 9c4bd220c44f..3cd79caad70c 100644 --- a/trunk/drivers/acpi/asus_acpi.c +++ b/trunk/drivers/acpi/asus_acpi.c @@ -56,6 +56,7 @@ #define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver" #define ACPI_HOTK_CLASS "hotkey" #define ACPI_HOTK_DEVICE_NAME "Hotkey" +#define ACPI_HOTK_HID "ATK0100" /* * Some events we use, same for all Asus @@ -425,20 +426,14 @@ static struct acpi_table_header *asus_info; static struct asus_hotk *hotk; /* - * The hotkey driver and autoloading declaration + * The hotkey driver declaration */ static int asus_hotk_add(struct acpi_device *device); static int asus_hotk_remove(struct acpi_device *device, int type); -static const struct acpi_device_id asus_device_ids[] = { - {"ATK0100", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, asus_device_ids); - static struct acpi_driver asus_hotk_driver = { .name = "asus_acpi", .class = ACPI_HOTK_CLASS, - .ids = asus_device_ids, + .ids = ACPI_HOTK_HID, .ops = { .add = asus_hotk_add, .remove = asus_hotk_remove, diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index 81651032791b..cad932de383d 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -41,6 +41,7 @@ #define ACPI_BATTERY_COMPONENT 0x00040000 #define ACPI_BATTERY_CLASS "battery" +#define ACPI_BATTERY_HID "PNP0C0A" #define ACPI_BATTERY_DEVICE_NAME "Battery" #define ACPI_BATTERY_NOTIFY_STATUS 0x80 #define ACPI_BATTERY_NOTIFY_INFO 0x81 @@ -73,16 +74,10 @@ static int acpi_battery_add(struct acpi_device *device); static int acpi_battery_remove(struct acpi_device *device, int type); static int acpi_battery_resume(struct acpi_device *device); -static const struct acpi_device_id battery_device_ids[] = { - {"PNP0C0A", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, battery_device_ids); - static struct acpi_driver acpi_battery_driver = { .name = "battery", .class = ACPI_BATTERY_CLASS, - .ids = battery_device_ids, + .ids = ACPI_BATTERY_HID, .ops = { .add = acpi_battery_add, .resume = acpi_battery_resume, diff --git a/trunk/drivers/acpi/button.c b/trunk/drivers/acpi/button.c index 540581338ef5..cb4110b50cd0 100644 --- a/trunk/drivers/acpi/button.c +++ b/trunk/drivers/acpi/button.c @@ -66,16 +66,6 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Button Driver"); MODULE_LICENSE("GPL"); -static const struct acpi_device_id button_device_ids[] = { - {ACPI_BUTTON_HID_LID, 0}, - {ACPI_BUTTON_HID_SLEEP, 0}, - {ACPI_BUTTON_HID_SLEEPF, 0}, - {ACPI_BUTTON_HID_POWER, 0}, - {ACPI_BUTTON_HID_POWERF, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, button_device_ids); - static int acpi_button_add(struct acpi_device *device); static int acpi_button_remove(struct acpi_device *device, int type); static int acpi_button_info_open_fs(struct inode *inode, struct file *file); @@ -84,7 +74,7 @@ static int acpi_button_state_open_fs(struct inode *inode, struct file *file); static struct acpi_driver acpi_button_driver = { .name = "button", .class = ACPI_BUTTON_CLASS, - .ids = button_device_ids, + .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", .ops = { .add = acpi_button_add, .remove = acpi_button_remove, diff --git a/trunk/drivers/acpi/container.c b/trunk/drivers/acpi/container.c index 3c25ec7a1871..0dd3bf7c0ed1 100644 --- a/trunk/drivers/acpi/container.c +++ b/trunk/drivers/acpi/container.c @@ -52,18 +52,10 @@ MODULE_LICENSE("GPL"); static int acpi_container_add(struct acpi_device *device); static int acpi_container_remove(struct acpi_device *device, int type); -static const struct acpi_device_id container_device_ids[] = { - {"ACPI0004", 0}, - {"PNP0A05", 0}, - {"PNP0A06", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, container_device_ids); - static struct acpi_driver acpi_container_driver = { .name = "container", .class = ACPI_CONTAINER_CLASS, - .ids = container_device_ids, + .ids = "ACPI0004,PNP0A05,PNP0A06", .ops = { .add = acpi_container_add, .remove = acpi_container_remove, diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 469f3f57f881..10e851021eca 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -41,6 +41,7 @@ #include #define ACPI_EC_CLASS "embedded_controller" +#define ACPI_EC_HID "PNP0C09" #define ACPI_EC_DEVICE_NAME "Embedded Controller" #define ACPI_EC_FILE_INFO "info" @@ -81,15 +82,10 @@ static int acpi_ec_start(struct acpi_device *device); static int acpi_ec_stop(struct acpi_device *device, int type); static int acpi_ec_add(struct acpi_device *device); -static const struct acpi_device_id ec_device_ids[] = { - {"PNP0C09", 0}, - {"", 0}, -}; - static struct acpi_driver acpi_ec_driver = { .name = "ec", .class = ACPI_EC_CLASS, - .ids = ec_device_ids, + .ids = ACPI_EC_HID, .ops = { .add = acpi_ec_add, .remove = acpi_ec_remove, diff --git a/trunk/drivers/acpi/events/evrgnini.c b/trunk/drivers/acpi/events/evrgnini.c index b1aaa0e84588..23ee7bc4a705 100644 --- a/trunk/drivers/acpi/events/evrgnini.c +++ b/trunk/drivers/acpi/events/evrgnini.c @@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id) static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) { acpi_status status; - struct acpica_device_id hid; + struct acpi_device_id hid; struct acpi_compatible_id_list *cid; acpi_native_uint i; diff --git a/trunk/drivers/acpi/fan.c b/trunk/drivers/acpi/fan.c index c81f6bdb68b8..ec655c539492 100644 --- a/trunk/drivers/acpi/fan.c +++ b/trunk/drivers/acpi/fan.c @@ -50,16 +50,10 @@ static int acpi_fan_remove(struct acpi_device *device, int type); static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); static int acpi_fan_resume(struct acpi_device *device); -static const struct acpi_device_id fan_device_ids[] = { - {"PNP0C0B", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, fan_device_ids); - static struct acpi_driver acpi_fan_driver = { .name = "fan", .class = ACPI_FAN_CLASS, - .ids = fan_device_ids, + .ids = "PNP0C0B", .ops = { .add = acpi_fan_add, .remove = acpi_fan_remove, diff --git a/trunk/drivers/acpi/namespace/nsxfeval.c b/trunk/drivers/acpi/namespace/nsxfeval.c index ab65b2c2560e..be4f2899de74 100644 --- a/trunk/drivers/acpi/namespace/nsxfeval.c +++ b/trunk/drivers/acpi/namespace/nsxfeval.c @@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, acpi_status status; struct acpi_namespace_node *node; u32 flags; - struct acpica_device_id hid; + struct acpi_device_id hid; struct acpi_compatible_id_list *cid; acpi_native_uint i; diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index c9f526e55392..3448edd61dc4 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -46,6 +46,7 @@ #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME("pci_link"); #define ACPI_PCI_LINK_CLASS "pci_irq_routing" +#define ACPI_PCI_LINK_HID "PNP0C0F" #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" #define ACPI_PCI_LINK_FILE_INFO "info" #define ACPI_PCI_LINK_FILE_STATUS "state" @@ -53,16 +54,10 @@ ACPI_MODULE_NAME("pci_link"); static int acpi_pci_link_add(struct acpi_device *device); static int acpi_pci_link_remove(struct acpi_device *device, int type); -static struct acpi_device_id link_device_ids[] = { - {"PNP0C0F", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, link_device_ids); - static struct acpi_driver acpi_pci_link_driver = { .name = "pci_link", .class = ACPI_PCI_LINK_CLASS, - .ids = link_device_ids, + .ids = ACPI_PCI_LINK_HID, .ops = { .add = acpi_pci_link_add, .remove = acpi_pci_link_remove, diff --git a/trunk/drivers/acpi/pci_root.c b/trunk/drivers/acpi/pci_root.c index f14ff1ffab29..ad4145a37786 100644 --- a/trunk/drivers/acpi/pci_root.c +++ b/trunk/drivers/acpi/pci_root.c @@ -38,21 +38,16 @@ #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME("pci_root"); #define ACPI_PCI_ROOT_CLASS "pci_bridge" +#define ACPI_PCI_ROOT_HID "PNP0A03" #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" static int acpi_pci_root_add(struct acpi_device *device); static int acpi_pci_root_remove(struct acpi_device *device, int type); static int acpi_pci_root_start(struct acpi_device *device); -static struct acpi_device_id root_device_ids[] = { - {"PNP0A03", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, root_device_ids); - static struct acpi_driver acpi_pci_root_driver = { .name = "pci_root", .class = ACPI_PCI_ROOT_CLASS, - .ids = root_device_ids, + .ids = ACPI_PCI_ROOT_HID, .ops = { .add = acpi_pci_root_add, .remove = acpi_pci_root_remove, diff --git a/trunk/drivers/acpi/power.c b/trunk/drivers/acpi/power.c index 57b9a2998fd0..4ffecd179702 100644 --- a/trunk/drivers/acpi/power.c +++ b/trunk/drivers/acpi/power.c @@ -59,16 +59,10 @@ static int acpi_power_remove(struct acpi_device *device, int type); static int acpi_power_resume(struct acpi_device *device); static int acpi_power_open_fs(struct inode *inode, struct file *file); -static struct acpi_device_id power_device_ids[] = { - {ACPI_POWER_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, power_device_ids); - static struct acpi_driver acpi_power_driver = { .name = "power", .class = ACPI_POWER_CLASS, - .ids = power_device_ids, + .ids = ACPI_POWER_HID, .ops = { .add = acpi_power_add, .remove = acpi_power_remove, diff --git a/trunk/drivers/acpi/processor_core.c b/trunk/drivers/acpi/processor_core.c index 498422343f38..81aceb5da7c7 100644 --- a/trunk/drivers/acpi/processor_core.c +++ b/trunk/drivers/acpi/processor_core.c @@ -88,16 +88,10 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr); extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); -static const struct acpi_device_id processor_device_ids[] = { - {ACPI_PROCESSOR_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, processor_device_ids); - static struct acpi_driver acpi_processor_driver = { .name = "processor", .class = ACPI_PROCESSOR_CLASS, - .ids = processor_device_ids, + .ids = ACPI_PROCESSOR_HID, .ops = { .add = acpi_processor_add, .remove = acpi_processor_remove, diff --git a/trunk/drivers/acpi/processor_throttling.c b/trunk/drivers/acpi/processor_throttling.c index 0b8204e7082a..3f55d1f90c11 100644 --- a/trunk/drivers/acpi/processor_throttling.c +++ b/trunk/drivers/acpi/processor_throttling.c @@ -47,9 +47,6 @@ ACPI_MODULE_NAME("processor_throttling"); static int acpi_processor_get_throttling(struct acpi_processor *pr); int acpi_processor_set_throttling(struct acpi_processor *pr, int state); -/* - * _TPC - Throttling Present Capabilities - */ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) { acpi_status status = 0; @@ -58,10 +55,8 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) if (!pr) return -EINVAL; status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); - if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); - } + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); return -ENODEV; } pr->throttling_platform_limit = (int)tpc; @@ -73,9 +68,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr) return acpi_processor_get_platform_limit(pr); } -/* - * _PTC - Processor Throttling Control (and status) register location - */ +/* -------------------------------------------------------------------------- + _PTC, _TSS, _TSD support + -------------------------------------------------------------------------- */ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) { int result = 0; @@ -86,9 +81,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); - } + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); return -ENODEV; } @@ -139,10 +132,6 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) return result; } - -/* - * _TSS - Throttling Supported States - */ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) { int result = 0; @@ -155,9 +144,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); - } + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); return -ENODEV; } @@ -214,10 +201,6 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) return result; } - -/* - * _TSD - T-State Dependencies - */ static int acpi_processor_get_tsd(struct acpi_processor *pr) { int result = 0; @@ -230,9 +213,6 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); - } return -ENODEV; } @@ -545,6 +525,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) int result = 0; int step = 0; int i = 0; + int no_ptc = 0; + int no_tss = 0; + int no_tsd = 0; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", @@ -555,14 +538,12 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) if (!pr) return -EINVAL; - /* - * Evaluate _PTC, _TSS and _TPC - * They must all be present or none of them can be used. - */ - if (acpi_processor_get_throttling_control(pr) || - acpi_processor_get_throttling_states(pr) || - acpi_processor_get_platform_limit(pr)) - { + /* TBD: Support ACPI 2.0 objects */ + no_ptc = acpi_processor_get_throttling_control(pr); + no_tss = acpi_processor_get_throttling_states(pr); + no_tsd = acpi_processor_get_tsd(pr); + + if (no_ptc || no_tss) { pr->throttling.acpi_processor_get_throttling = &acpi_processor_get_throttling_fadt; pr->throttling.acpi_processor_set_throttling = @@ -574,8 +555,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) &acpi_processor_set_throttling_ptc; } - acpi_processor_get_tsd(pr); - if (!pr->throttling.address) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); return 0; @@ -679,20 +658,18 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq, pr->throttling.state_count - 1); seq_puts(seq, "states:\n"); - if (pr->throttling.acpi_processor_get_throttling == - acpi_processor_get_throttling_fadt) { + if (acpi_processor_get_throttling == acpi_processor_get_throttling_fadt) for (i = 0; i < pr->throttling.state_count; i++) seq_printf(seq, " %cT%d: %02d%%\n", (i == pr->throttling.state ? '*' : ' '), i, (pr->throttling.states[i].performance ? pr-> throttling.states[i].performance / 10 : 0)); - } else { + else for (i = 0; i < pr->throttling.state_count; i++) seq_printf(seq, " %cT%d: %02d%%\n", (i == pr->throttling.state ? '*' : ' '), i, (int)pr->throttling.states_tss[i]. freqpercentage); - } end: return 0; diff --git a/trunk/drivers/acpi/sbs.c b/trunk/drivers/acpi/sbs.c index 7d8e78ea13a5..974d00ccfe84 100644 --- a/trunk/drivers/acpi/sbs.c +++ b/trunk/drivers/acpi/sbs.c @@ -38,6 +38,7 @@ #define ACPI_SBS_CLASS "sbs" #define ACPI_AC_CLASS "ac_adapter" #define ACPI_BATTERY_CLASS "battery" +#define ACPI_SBS_HID "ACPI0002" #define ACPI_SBS_DEVICE_NAME "Smart Battery System" #define ACPI_SBS_FILE_INFO "info" #define ACPI_SBS_FILE_STATE "state" @@ -123,17 +124,10 @@ static int acpi_sbs_add(struct acpi_device *device); static int acpi_sbs_remove(struct acpi_device *device, int type); static int acpi_sbs_resume(struct acpi_device *device); -static const struct acpi_device_id sbs_device_ids[] = { - {"ACPI0001", 0}, - {"ACPI0005", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, sbs_device_ids); - static struct acpi_driver acpi_sbs_driver = { .name = "sbs", .class = ACPI_SBS_CLASS, - .ids = sbs_device_ids, + .ids = "ACPI0001,ACPI0005", .ops = { .add = acpi_sbs_add, .remove = acpi_sbs_remove, diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index be74347d1354..6b3b8a522476 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -16,7 +16,7 @@ ACPI_MODULE_NAME("scan"); extern struct acpi_device *acpi_root; #define ACPI_BUS_CLASS "system_bus" -#define ACPI_BUS_HID "LNXSYBUS" +#define ACPI_BUS_HID "ACPI_BUS" #define ACPI_BUS_DEVICE_NAME "System Bus" static LIST_HEAD(acpi_device_list); @@ -29,62 +29,6 @@ struct acpi_device_bus_id{ unsigned int instance_no; struct list_head node; }; - -/* - * Creates hid/cid(s) string needed for modalias and uevent - * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: - * char *modalias: "acpi:IBM0001:ACPI0001" -*/ -int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){ - - int len; - - if (!acpi_dev->flags.hardware_id) - return -ENODEV; - - len = snprintf(modalias, size, "acpi:%s:", - acpi_dev->pnp.hardware_id); - if (len < 0 || len >= size) - return -EINVAL; - size -= len; - - if (acpi_dev->flags.compatible_ids) { - struct acpi_compatible_id_list *cid_list; - int i; - int count; - - cid_list = acpi_dev->pnp.cid_list; - for (i = 0; i < cid_list->count; i++) { - count = snprintf(&modalias[len], size, "%s:", - cid_list->id[i].value); - if (count < 0 || count >= size) { - printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size", - acpi_dev->pnp.device_name, i); - break; - } - len += count; - size -= count; - } - } - - modalias[len] = '\0'; - return len; -} - -static ssize_t -acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct acpi_device *acpi_dev = to_acpi_device(dev); - int len; - - /* Device has no HID and no CID or string is >1024 */ - len = create_modalias(acpi_dev, buf, 1024); - if (len <= 0) - return 0; - buf[len++] = '\n'; - return len; -} -static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); - static int acpi_eject_operation(acpi_handle handle, int lockable) { struct acpi_object_list arg_list; @@ -210,12 +154,6 @@ static int acpi_device_setup_files(struct acpi_device *dev) goto end; } - if (dev->flags.hardware_id || dev->flags.compatible_ids){ - result = device_create_file(&dev->dev, &dev_attr_modalias); - if(result) - goto end; - } - /* * If device has _EJ0, 'eject' file is created that is used to trigger * hot-removal function from userland. @@ -240,9 +178,6 @@ static void acpi_device_remove_files(struct acpi_device *dev) if (ACPI_SUCCESS(status)) device_remove_file(&dev->dev, &dev_attr_eject); - if (dev->flags.hardware_id || dev->flags.compatible_ids) - device_remove_file(&dev->dev, &dev_attr_modalias); - if(dev->flags.hardware_id) device_remove_file(&dev->dev, &dev_attr_hid); if(dev->handle) @@ -251,37 +186,6 @@ static void acpi_device_remove_files(struct acpi_device *dev) /* -------------------------------------------------------------------------- ACPI Bus operations -------------------------------------------------------------------------- */ - -int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids) -{ - const struct acpi_device_id *id; - - if (device->flags.hardware_id) { - for (id = ids; id->id[0]; id++) { - if (!strcmp((char*)id->id, device->pnp.hardware_id)) - return 0; - } - } - - if (device->flags.compatible_ids) { - struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; - int i; - - for (id = ids; id->id[0]; id++) { - /* compare multiple _CID entries against driver ids */ - for (i = 0; i < cid_list->count; i++) { - if (!strcmp((char*)id->id, - cid_list->id[i].value)) - return 0; - } - } - } - - return -ENOENT; -} -EXPORT_SYMBOL(acpi_match_device_ids); - static void acpi_device_release(struct device *dev) { struct acpi_device *acpi_dev = to_acpi_device(dev); @@ -315,19 +219,37 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv) struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_driver *acpi_drv = to_acpi_driver(drv); - return !acpi_match_device_ids(acpi_dev, acpi_drv->ids); + return !acpi_match_ids(acpi_dev, acpi_drv->ids); } static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) + char *buffer, int buffer_size) { struct acpi_device *acpi_dev = to_acpi_device(dev); + int i = 0, length = 0, ret = 0; + + if (acpi_dev->flags.hardware_id) + ret = add_uevent_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "HWID=%s", acpi_dev->pnp.hardware_id); + if (ret) + return -ENOMEM; + if (acpi_dev->flags.compatible_ids) { + int j; + struct acpi_compatible_id_list *cid_list; - strcpy(buffer, "MODALIAS="); - if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) { - envp[0] = buffer; - envp[1] = NULL; + cid_list = acpi_dev->pnp.cid_list; + + for (j = 0; j < cid_list->count; j++) { + ret = add_uevent_var(envp, num_envp, &i, buffer, + buffer_size, &length, "COMPTID=%s", + cid_list->id[j].value); + if (ret) + return -ENOMEM; + } } + + envp[i] = NULL; return 0; } @@ -621,6 +543,25 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) return; } +int acpi_match_ids(struct acpi_device *device, char *ids) +{ + if (device->flags.hardware_id) + if (strstr(ids, device->pnp.hardware_id)) + return 0; + + if (device->flags.compatible_ids) { + struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; + int i; + + /* compare multiple _CID entries against driver ids */ + for (i = 0; i < cid_list->count; i++) { + if (strstr(ids, cid_list->id[i].value)) + return 0; + } + } + return -ENOENT; +} + static int acpi_bus_get_perf_flags(struct acpi_device *device) { device->performance.state = ACPI_STATE_UNKNOWN; @@ -683,13 +624,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *package = NULL; - struct acpi_device_id button_device_ids[] = { - {"PNP0C0D", 0}, - {"PNP0C0C", 0}, - {"PNP0C0E", 0}, - {"", 0}, - }; - /* _PRW */ status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); @@ -709,7 +643,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) device->wakeup.flags.valid = 1; /* Power button, Lid switch always enable wakeup */ - if (!acpi_match_device_ids(device, button_device_ids)) + if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E")) device->wakeup.flags.run_wake = 1; end: diff --git a/trunk/drivers/acpi/sleep/Makefile b/trunk/drivers/acpi/sleep/Makefile index 01a993a1d086..d6c017709c85 100644 --- a/trunk/drivers/acpi/sleep/Makefile +++ b/trunk/drivers/acpi/sleep/Makefile @@ -1,5 +1,5 @@ obj-y := poweroff.o wakeup.o -obj-y += main.o -obj-$(CONFIG_X86) += proc.o +obj-$(CONFIG_ACPI_SLEEP) += main.o +obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/trunk/drivers/acpi/sleep/main.c b/trunk/drivers/acpi/sleep/main.c index ab21357c5c7b..3279e72a94f8 100644 --- a/trunk/drivers/acpi/sleep/main.c +++ b/trunk/drivers/acpi/sleep/main.c @@ -34,55 +34,35 @@ static u32 acpi_suspend_states[] = { static int init_8259A_after_S1; -extern int acpi_sleep_prepare(u32 acpi_state); -extern void acpi_power_off(void); - -static u32 acpi_target_sleep_state = ACPI_STATE_S0; - -/** - * acpi_pm_set_target - Set the target system sleep state to the state - * associated with given @pm_state, if supported. - */ - -static int acpi_pm_set_target(suspend_state_t pm_state) -{ - u32 acpi_state = acpi_suspend_states[pm_state]; - int error = 0; - - if (sleep_states[acpi_state]) { - acpi_target_sleep_state = acpi_state; - } else { - printk(KERN_ERR "ACPI does not support this state: %d\n", - pm_state); - error = -ENOSYS; - } - return error; -} - /** * acpi_pm_prepare - Do preliminary suspend work. - * @pm_state: ignored + * @pm_state: suspend state we're entering. * - * If necessary, set the firmware waking vector and do arch-specific - * nastiness to get the wakeup code to the waking vector. + * Make sure we support the state. If we do, and we need it, set the + * firmware waking vector and do arch-specific nastiness to get the + * wakeup code to the waking vector. */ +extern int acpi_sleep_prepare(u32 acpi_state); +extern void acpi_power_off(void); + static int acpi_pm_prepare(suspend_state_t pm_state) { - int error = acpi_sleep_prepare(acpi_target_sleep_state); - - if (error) - acpi_target_sleep_state = ACPI_STATE_S0; + u32 acpi_state = acpi_suspend_states[pm_state]; - return error; + if (!sleep_states[acpi_state]) { + printk("acpi_pm_prepare does not support %d \n", pm_state); + return -EPERM; + } + return acpi_sleep_prepare(acpi_state); } /** * acpi_pm_enter - Actually enter a sleep state. - * @pm_state: ignored + * @pm_state: State we're entering. * - * Flush caches and go to sleep. For STR we have to call arch-specific - * assembly, which in turn call acpi_enter_sleep_state(). + * Flush caches and go to sleep. For STR or STD, we have to call + * arch-specific assembly, which in turn call acpi_enter_sleep_state(). * It's unfortunate, but it works. Please fix if you're feeling frisky. */ @@ -90,31 +70,31 @@ static int acpi_pm_enter(suspend_state_t pm_state) { acpi_status status = AE_OK; unsigned long flags = 0; - u32 acpi_state = acpi_target_sleep_state; + u32 acpi_state = acpi_suspend_states[pm_state]; ACPI_FLUSH_CPU_CACHE(); /* Do arch specific saving of state. */ - if (acpi_state == ACPI_STATE_S3) { + if (pm_state > PM_SUSPEND_STANDBY) { int error = acpi_save_state_mem(); - - if (error) { - acpi_target_sleep_state = ACPI_STATE_S0; + if (error) return error; - } } local_irq_save(flags); acpi_enable_wakeup_device(acpi_state); - switch (acpi_state) { - case ACPI_STATE_S1: + switch (pm_state) { + case PM_SUSPEND_STANDBY: barrier(); status = acpi_enter_sleep_state(acpi_state); break; - case ACPI_STATE_S3: + case PM_SUSPEND_MEM: do_suspend_lowlevel(); break; + + default: + return -EINVAL; } /* ACPI 3.0 specs (P62) says that it's the responsabilty @@ -127,8 +107,12 @@ static int acpi_pm_enter(suspend_state_t pm_state) local_irq_restore(flags); printk(KERN_DEBUG "Back to C!\n"); - /* restore processor state */ - if (acpi_state == ACPI_STATE_S3) + /* restore processor state + * We should only be here if we're coming back from STR or STD. + * And, in the case of the latter, the memory image should have already + * been loaded from disk. + */ + if (pm_state > PM_SUSPEND_STANDBY) acpi_restore_state_mem(); return ACPI_SUCCESS(status) ? 0 : -EFAULT; @@ -136,7 +120,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) /** * acpi_pm_finish - Finish up suspend sequence. - * @pm_state: ignored + * @pm_state: State we're coming out of. * * This is called after we wake back up (or if entering the sleep state * failed). @@ -144,7 +128,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) static int acpi_pm_finish(suspend_state_t pm_state) { - u32 acpi_state = acpi_target_sleep_state; + u32 acpi_state = acpi_suspend_states[pm_state]; acpi_leave_sleep_state(acpi_state); acpi_disable_wakeup_device(acpi_state); @@ -152,14 +136,10 @@ static int acpi_pm_finish(suspend_state_t pm_state) /* reset firmware waking vector */ acpi_set_firmware_waking_vector((acpi_physical_address) 0); - acpi_target_sleep_state = ACPI_STATE_S0; - -#ifdef CONFIG_X86 if (init_8259A_after_S1) { printk("Broken toshiba laptop -> kicking interrupts\n"); init_8259A(0); } -#endif return 0; } @@ -196,7 +176,6 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) static struct pm_ops acpi_pm_ops = { .valid = acpi_pm_state_valid, - .set_target = acpi_pm_set_target, .prepare = acpi_pm_prepare, .enter = acpi_pm_enter, .finish = acpi_pm_finish, @@ -256,81 +235,6 @@ static struct hibernation_ops acpi_hibernation_ops = { }; #endif /* CONFIG_SOFTWARE_SUSPEND */ -/** - * acpi_pm_device_sleep_state - return preferred power state of ACPI device - * in the system sleep state given by %acpi_target_sleep_state - * @dev: device to examine - * @wake: if set, the device should be able to wake up the system - * @d_min_p: used to store the upper limit of allowed states range - * Return value: preferred power state of the device on success, -ENODEV on - * failure (ie. if there's no 'struct acpi_device' for @dev) - * - * Find the lowest power (highest number) ACPI device power state that - * device @dev can be in while the system is in the sleep state represented - * by %acpi_target_sleep_state. If @wake is nonzero, the device should be - * able to wake up the system from this sleep state. If @d_min_p is set, - * the highest power (lowest number) device power state of @dev allowed - * in this system sleep state is stored at the location pointed to by it. - * - * The caller must ensure that @dev is valid before using this function. - * The caller is also responsible for figuring out if the device is - * supposed to be able to wake up the system and passing this information - * via @wake. - */ - -int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) -{ - acpi_handle handle = DEVICE_ACPI_HANDLE(dev); - struct acpi_device *adev; - char acpi_method[] = "_SxD"; - unsigned long d_min, d_max; - - if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { - printk(KERN_ERR "ACPI handle has no context!\n"); - return -ENODEV; - } - - acpi_method[2] = '0' + acpi_target_sleep_state; - /* - * If the sleep state is S0, we will return D3, but if the device has - * _S0W, we will use the value from _S0W - */ - d_min = ACPI_STATE_D0; - d_max = ACPI_STATE_D3; - - /* - * If present, _SxD methods return the minimum D-state (highest power - * state) we can use for the corresponding S-states. Otherwise, the - * minimum D-state is D0 (ACPI 3.x). - * - * NOTE: We rely on acpi_evaluate_integer() not clobbering the integer - * provided -- that's our fault recovery, we ignore retval. - */ - if (acpi_target_sleep_state > ACPI_STATE_S0) - acpi_evaluate_integer(handle, acpi_method, NULL, &d_min); - - /* - * If _PRW says we can wake up the system from the target sleep state, - * the D-state returned by _SxD is sufficient for that (we assume a - * wakeup-aware driver if wake is set). Still, if _SxW exists - * (ACPI 3.x), it should return the maximum (lowest power) D-state that - * can wake the system. _S0W may be valid, too. - */ - if (acpi_target_sleep_state == ACPI_STATE_S0 || - (wake && adev->wakeup.state.enabled && - adev->wakeup.sleep_state <= acpi_target_sleep_state)) { - acpi_method[3] = 'W'; - acpi_evaluate_integer(handle, acpi_method, NULL, &d_max); - /* Sanity check */ - if (d_max < d_min) - d_min = d_max; - } - - if (d_min_p) - *d_min_p = d_min; - return d_max; -} - /* * Toshiba fails to preserve interrupts over S1, reinitialization * of 8259 is needed after S1 resume. diff --git a/trunk/drivers/acpi/sleep/poweroff.c b/trunk/drivers/acpi/sleep/poweroff.c index b3f68ef0669e..39e40d56b034 100644 --- a/trunk/drivers/acpi/sleep/poweroff.c +++ b/trunk/drivers/acpi/sleep/poweroff.c @@ -18,6 +18,7 @@ int acpi_sleep_prepare(u32 acpi_state) { +#ifdef CONFIG_ACPI_SLEEP /* do we have a wakeup address for S2 and S3? */ if (acpi_state == ACPI_STATE_S3) { if (!acpi_wakeup_address) { @@ -30,6 +31,7 @@ int acpi_sleep_prepare(u32 acpi_state) } ACPI_FLUSH_CPU_CACHE(); acpi_enable_wakeup_device_prep(acpi_state); +#endif acpi_gpe_sleep_prepare(acpi_state); acpi_enter_sleep_state_prep(acpi_state); return 0; diff --git a/trunk/drivers/acpi/sleep/proc.c b/trunk/drivers/acpi/sleep/proc.c index ed58e1168aed..61f1822cc350 100644 --- a/trunk/drivers/acpi/sleep/proc.c +++ b/trunk/drivers/acpi/sleep/proc.c @@ -14,16 +14,8 @@ #include "sleep.h" #define _COMPONENT ACPI_SYSTEM_COMPONENT - -/* - * this file provides support for: - * /proc/acpi/sleep - * /proc/acpi/alarm - * /proc/acpi/wakeup - */ - ACPI_MODULE_NAME("sleep") -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) { int i; @@ -76,7 +68,7 @@ acpi_system_write_sleep(struct file *file, Done: return error ? error : count; } -#endif /* CONFIG_ACPI_PROCFS */ +#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */ @@ -471,7 +463,7 @@ static const struct file_operations acpi_system_wakeup_device_fops = { .release = single_release, }; -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP static const struct file_operations acpi_system_sleep_fops = { .open = acpi_system_sleep_open_fs, .read = seq_read, @@ -479,7 +471,7 @@ static const struct file_operations acpi_system_sleep_fops = { .llseek = seq_lseek, .release = single_release, }; -#endif /* CONFIG_ACPI_PROCFS */ +#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ #ifdef HAVE_ACPI_LEGACY_ALARM static const struct file_operations acpi_system_alarm_fops = { @@ -506,14 +498,14 @@ static int __init acpi_sleep_proc_init(void) if (acpi_disabled) return 0; -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP /* 'sleep' [R/W] */ entry = create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, acpi_root_dir); if (entry) entry->proc_fops = &acpi_system_sleep_fops; -#endif /* CONFIG_ACPI_PROCFS */ +#endif #ifdef HAVE_ACPI_LEGACY_ALARM /* 'alarm' [R/W] */ diff --git a/trunk/drivers/acpi/sleep/wakeup.c b/trunk/drivers/acpi/sleep/wakeup.c index 97c27ddb144d..fab8f2694f03 100644 --- a/trunk/drivers/acpi/sleep/wakeup.c +++ b/trunk/drivers/acpi/sleep/wakeup.c @@ -17,6 +17,7 @@ ACPI_MODULE_NAME("wakeup_devices") extern struct list_head acpi_wakeup_device_list; extern spinlock_t acpi_device_lock; +#ifdef CONFIG_ACPI_SLEEP /** * acpi_enable_wakeup_device_prep - prepare wakeup devices * @sleep_state: ACPI state @@ -179,6 +180,7 @@ static int __init acpi_wakeup_device_init(void) } late_initcall(acpi_wakeup_device_init); +#endif /* * Disable all wakeup GPEs before entering requested sleep state. diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 5a62de1b7f2a..58f1338981bc 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -92,16 +92,10 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file); static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, size_t, loff_t *); -static const struct acpi_device_id thermal_device_ids[] = { - {ACPI_THERMAL_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, thermal_device_ids); - static struct acpi_driver acpi_thermal_driver = { .name = "thermal", .class = ACPI_THERMAL_CLASS, - .ids = thermal_device_ids, + .ids = ACPI_THERMAL_HID, .ops = { .add = acpi_thermal_add, .remove = acpi_thermal_remove, diff --git a/trunk/drivers/acpi/utilities/uteval.c b/trunk/drivers/acpi/utilities/uteval.c index 0042b7e78b26..f112af433e36 100644 --- a/trunk/drivers/acpi/utilities/uteval.c +++ b/trunk/drivers/acpi/utilities/uteval.c @@ -407,7 +407,7 @@ acpi_ut_copy_id_string(char *destination, char *source, acpi_size max_length) acpi_status acpi_ut_execute_HID(struct acpi_namespace_node *device_node, - struct acpica_device_id *hid) + struct acpi_device_id *hid) { union acpi_operand_object *obj_desc; acpi_status status; @@ -609,7 +609,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, acpi_status acpi_ut_execute_UID(struct acpi_namespace_node *device_node, - struct acpica_device_id *uid) + struct acpi_device_id *uid) { union acpi_operand_object *obj_desc; acpi_status status; diff --git a/trunk/drivers/acpi/video.c b/trunk/drivers/acpi/video.c index d98701941981..04ea697f72bf 100644 --- a/trunk/drivers/acpi/video.c +++ b/trunk/drivers/acpi/video.c @@ -74,16 +74,10 @@ MODULE_LICENSE("GPL"); static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device, int type); -static const struct acpi_device_id video_device_ids[] = { - {ACPI_VIDEO_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, video_device_ids); - static struct acpi_driver acpi_video_bus = { .name = "video", .class = ACPI_VIDEO_CLASS, - .ids = video_device_ids, + .ids = ACPI_VIDEO_HID, .ops = { .add = acpi_video_bus_add, .remove = acpi_video_bus_remove, diff --git a/trunk/drivers/char/hpet.c b/trunk/drivers/char/hpet.c index 9a2694e5f8b9..ba0e74ad74bb 100644 --- a/trunk/drivers/char/hpet.c +++ b/trunk/drivers/char/hpet.c @@ -1007,15 +1007,9 @@ static int hpet_acpi_remove(struct acpi_device *device, int type) return -EINVAL; } -static const struct acpi_device_id hpet_device_ids[] = { - {"PNP0103", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, hpet_device_ids); - static struct acpi_driver hpet_acpi_driver = { .name = "hpet", - .ids = hpet_device_ids, + .ids = "PNP0103", .ops = { .add = hpet_acpi_add, .remove = hpet_acpi_remove, diff --git a/trunk/drivers/input/misc/atlas_btns.c b/trunk/drivers/input/misc/atlas_btns.c index e43e92fd9e23..0acc3a123604 100644 --- a/trunk/drivers/input/misc/atlas_btns.c +++ b/trunk/drivers/input/misc/atlas_btns.c @@ -31,6 +31,7 @@ #define ACPI_ATLAS_NAME "Atlas ACPI" #define ACPI_ATLAS_CLASS "Atlas" +#define ACPI_ATLAS_BUTTON_HID "ASIM0000" static struct input_dev *input_dev; @@ -129,16 +130,10 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type) return status; } -static const struct acpi_device_id atlas_device_ids[] = { - {"ASIM0000", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, atlas_device_ids); - static struct acpi_driver atlas_acpi_driver = { .name = ACPI_ATLAS_NAME, .class = ACPI_ATLAS_CLASS, - .ids = atlas_device_ids, + .ids = ACPI_ATLAS_BUTTON_HID, .ops = { .add = atlas_acpi_button_add, .remove = atlas_acpi_button_remove, diff --git a/trunk/drivers/kvm/kvm_main.c b/trunk/drivers/kvm/kvm_main.c index 96856097d15b..bcbe6835beb4 100644 --- a/trunk/drivers/kvm/kvm_main.c +++ b/trunk/drivers/kvm/kvm_main.c @@ -297,6 +297,9 @@ static struct kvm *kvm_create_vm(void) kvm_io_bus_init(&kvm->pio_bus); spin_lock_init(&kvm->lock); INIT_LIST_HEAD(&kvm->active_mmu_pages); + spin_lock(&kvm_lock); + list_add(&kvm->vm_list, &vm_list); + spin_unlock(&kvm_lock); kvm_io_bus_init(&kvm->mmio_bus); for (i = 0; i < KVM_MAX_VCPUS; ++i) { struct kvm_vcpu *vcpu = &kvm->vcpus[i]; @@ -306,9 +309,6 @@ static struct kvm *kvm_create_vm(void) vcpu->kvm = kvm; vcpu->mmu.root_hpa = INVALID_PAGE; } - spin_lock(&kvm_lock); - list_add(&kvm->vm_list, &vm_list); - spin_unlock(&kvm_lock); return kvm; } @@ -1070,16 +1070,18 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, return 0; mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT); virt = kmap_atomic(page, KM_USER0); - kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); - memcpy(virt + offset_in_page(gpa), val, bytes); + if (memcmp(virt + offset_in_page(gpa), val, bytes)) { + kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); + memcpy(virt + offset_in_page(gpa), val, bytes); + } kunmap_atomic(virt, KM_USER0); return 1; } -static int emulator_write_emulated_onepage(unsigned long addr, - const void *val, - unsigned int bytes, - struct x86_emulate_ctxt *ctxt) +static int emulator_write_emulated(unsigned long addr, + const void *val, + unsigned int bytes, + struct x86_emulate_ctxt *ctxt) { struct kvm_vcpu *vcpu = ctxt->vcpu; struct kvm_io_device *mmio_dev; @@ -1111,26 +1113,6 @@ static int emulator_write_emulated_onepage(unsigned long addr, return X86EMUL_CONTINUE; } -static int emulator_write_emulated(unsigned long addr, - const void *val, - unsigned int bytes, - struct x86_emulate_ctxt *ctxt) -{ - /* Crossing a page boundary? */ - if (((addr + bytes - 1) ^ addr) & PAGE_MASK) { - int rc, now; - - now = -addr & ~PAGE_MASK; - rc = emulator_write_emulated_onepage(addr, val, now, ctxt); - if (rc != X86EMUL_CONTINUE) - return rc; - addr += now; - val += now; - bytes -= now; - } - return emulator_write_emulated_onepage(addr, val, bytes, ctxt); -} - static int emulator_cmpxchg_emulated(unsigned long addr, const void *old, const void *new, @@ -2432,9 +2414,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) break; } } - if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) { + if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { entry->edx &= ~(1 << 20); - printk(KERN_INFO "kvm: guest NX capability removed\n"); + printk(KERN_INFO ": guest NX capability removed\n"); } } diff --git a/trunk/drivers/kvm/x86_emulate.c b/trunk/drivers/kvm/x86_emulate.c index 1f979cb0df31..1b800fc00342 100644 --- a/trunk/drivers/kvm/x86_emulate.c +++ b/trunk/drivers/kvm/x86_emulate.c @@ -1178,8 +1178,6 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) twobyte_insn: switch (b) { case 0x01: /* lgdt, lidt, lmsw */ - /* Disable writeback. */ - no_wb = 1; switch (modrm_reg) { u16 size; unsigned long address; diff --git a/trunk/drivers/misc/asus-laptop.c b/trunk/drivers/misc/asus-laptop.c index d0fc4fd212e6..6b89854bd3ff 100644 --- a/trunk/drivers/misc/asus-laptop.c +++ b/trunk/drivers/misc/asus-laptop.c @@ -53,6 +53,7 @@ #define ASUS_HOTK_NAME "Asus Laptop Support" #define ASUS_HOTK_CLASS "hotkey" #define ASUS_HOTK_DEVICE_NAME "Hotkey" +#define ASUS_HOTK_HID "ATK0100" #define ASUS_HOTK_FILE "asus-laptop" #define ASUS_HOTK_PREFIX "\\_SB.ATKD." @@ -196,18 +197,12 @@ static struct asus_hotk *hotk; /* * The hotkey driver declaration */ -static const struct acpi_device_id asus_device_ids[] = { - {"ATK0100", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, asus_device_ids); - 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 = ASUS_HOTK_NAME, .class = ASUS_HOTK_CLASS, - .ids = asus_device_ids, + .ids = ASUS_HOTK_HID, .ops = { .add = asus_hotk_add, .remove = asus_hotk_remove, diff --git a/trunk/drivers/misc/sony-laptop.c b/trunk/drivers/misc/sony-laptop.c index 14ee06c8f127..303e48ca0e8a 100644 --- a/trunk/drivers/misc/sony-laptop.c +++ b/trunk/drivers/misc/sony-laptop.c @@ -1124,22 +1124,10 @@ static int sony_nc_remove(struct acpi_device *device, int type) return 0; } -static const struct acpi_device_id sony_device_ids[] = { - {SONY_NC_HID, 0}, - {SONY_PIC_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, sony_device_ids); - -static const struct acpi_device_id sony_nc_device_ids[] = { - {SONY_NC_HID, 0}, - {"", 0}, -}; - static struct acpi_driver sony_nc_driver = { .name = SONY_NC_DRIVER_NAME, .class = SONY_NC_CLASS, - .ids = sony_nc_device_ids, + .ids = SONY_NC_HID, .owner = THIS_MODULE, .ops = { .add = sony_nc_add, @@ -2482,15 +2470,10 @@ static int sony_pic_resume(struct acpi_device *device) return 0; } -static const struct acpi_device_id sony_pic_device_ids[] = { - {SONY_PIC_HID, 0}, - {"", 0}, -}; - static struct acpi_driver sony_pic_driver = { .name = SONY_PIC_DRIVER_NAME, .class = SONY_PIC_CLASS, - .ids = sony_pic_device_ids, + .ids = SONY_PIC_HID, .owner = THIS_MODULE, .ops = { .add = sony_pic_add, diff --git a/trunk/drivers/misc/thinkpad_acpi.c b/trunk/drivers/misc/thinkpad_acpi.c index fa80f355e522..f15a58f7403f 100644 --- a/trunk/drivers/misc/thinkpad_acpi.c +++ b/trunk/drivers/misc/thinkpad_acpi.c @@ -411,13 +411,12 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name); ibm->acpi->driver->ids = ibm->acpi->hid; - ibm->acpi->driver->ops.add = &tpacpi_device_add; rc = acpi_bus_register_driver(ibm->acpi->driver); if (rc < 0) { printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", - ibm->name, rc); + ibm->acpi->hid, rc); kfree(ibm->acpi->driver); ibm->acpi->driver = NULL; } else if (!rc) @@ -1317,13 +1316,8 @@ static int hotkey_write(char *buf) return res; } -static const struct acpi_device_id ibm_htk_device_ids[] = { - {IBM_HKEY_HID, 0}, - {"", 0}, -}; - static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { - .hid = ibm_htk_device_ids, + .hid = IBM_HKEY_HID, .notify = hotkey_notify, .handle = &hkey_handle, .type = ACPI_DEVICE_NOTIFY, @@ -2086,11 +2080,6 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ /* don't list other alternatives as we install a notify handler on the 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ -static const struct acpi_device_id ibm_pci_device_ids[] = { - {PCI_ROOT_HID_STRING, 0}, - {"", 0}, -}; - static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { { .notify = dock_notify, @@ -2101,7 +2090,7 @@ static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING. * We just use it to get notifications of dock hotplug * in very old thinkpads */ - .hid = ibm_pci_device_ids, + .hid = PCI_ROOT_HID_STRING, .notify = dock_notify, .handle = &pci_handle, .type = ACPI_SYSTEM_NOTIFY, @@ -2160,8 +2149,7 @@ static int __init dock_init2(struct ibm_init_struct *iibm) static void dock_notify(struct ibm_struct *ibm, u32 event) { int docked = dock_docked(); - int pci = ibm->acpi->hid && ibm->acpi->device && - acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); + int pci = ibm->acpi->hid && strstr(ibm->acpi->hid, PCI_ROOT_HID_STRING); if (event == 1 && !pci) /* 570 */ acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ diff --git a/trunk/drivers/misc/thinkpad_acpi.h b/trunk/drivers/misc/thinkpad_acpi.h index 88af089d6494..b7a4a888cc8b 100644 --- a/trunk/drivers/misc/thinkpad_acpi.h +++ b/trunk/drivers/misc/thinkpad_acpi.h @@ -193,7 +193,7 @@ static void thinkpad_acpi_module_exit(void); struct ibm_struct; struct tp_acpi_drv_struct { - const struct acpi_device_id *hid; + char *hid; struct acpi_driver *driver; void (*notify) (struct ibm_struct *, u32); diff --git a/trunk/drivers/pci/pci-acpi.c b/trunk/drivers/pci/pci-acpi.c index 67c63d1f1582..c8062494009f 100644 --- a/trunk/drivers/pci/pci-acpi.c +++ b/trunk/drivers/pci/pci-acpi.c @@ -245,33 +245,16 @@ EXPORT_SYMBOL(pci_osc_control_set); * currently we simply return _SxD, if present. */ -static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, - pm_message_t state) +static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state) { - int acpi_state; - - acpi_state = acpi_pm_device_sleep_state(&pdev->dev, - device_may_wakeup(&pdev->dev), NULL); - if (acpi_state < 0) - return PCI_POWER_ERROR; - - switch (acpi_state) { - case ACPI_STATE_D0: - return PCI_D0; - case ACPI_STATE_D1: - return PCI_D1; - case ACPI_STATE_D2: - return PCI_D2; - case ACPI_STATE_D3: - return PCI_D3hot; - } - return PCI_POWER_ERROR; + /* TBD */ + + return -ENODEV; } static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) { acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); - acpi_handle tmp; static int state_conv[] = { [0] = 0, [1] = 1, @@ -283,9 +266,6 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) if (!handle) return -ENODEV; - /* If the ACPI device has _EJ0, ignore the device */ - if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) - return 0; return acpi_bus_set_power(handle, acpi_state); } diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index fba319d6fcc8..c95485398687 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -499,7 +499,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) return 0; } -pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); +int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); /** * pci_choose_state - Choose the power state of a PCI device @@ -513,15 +513,15 @@ pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { - pci_power_t ret; + int ret; if (!pci_find_capability(dev, PCI_CAP_ID_PM)) return PCI_D0; if (platform_pci_choose_state) { ret = platform_pci_choose_state(dev, state); - if (ret != PCI_POWER_ERROR) - return ret; + if (ret >= 0) + state.event = ret; } switch (state.event) { diff --git a/trunk/drivers/pci/pci.h b/trunk/drivers/pci/pci.h index c6e132d7c0f7..7b696cd66dc5 100644 --- a/trunk/drivers/pci/pci.h +++ b/trunk/drivers/pci/pci.h @@ -12,7 +12,7 @@ extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, resource_size_t, resource_size_t), void *alignf_data); /* Firmware callbacks */ -extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); +extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); diff --git a/trunk/drivers/pnp/driver.c b/trunk/drivers/pnp/driver.c index 1432806451cd..e161423b4300 100644 --- a/trunk/drivers/pnp/driver.c +++ b/trunk/drivers/pnp/driver.c @@ -167,8 +167,6 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) return error; } - if (pnp_dev->protocol && pnp_dev->protocol->suspend) - pnp_dev->protocol->suspend(pnp_dev, state); return 0; } @@ -181,9 +179,6 @@ static int pnp_bus_resume(struct device *dev) if (!pnp_drv) return 0; - if (pnp_dev->protocol && pnp_dev->protocol->resume) - pnp_dev->protocol->resume(pnp_dev); - if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) { error = pnp_start_dev(pnp_dev); if (error) diff --git a/trunk/drivers/pnp/pnpacpi/core.c b/trunk/drivers/pnp/pnpacpi/core.c index fcd32ac575c3..a00548799e98 100644 --- a/trunk/drivers/pnp/pnpacpi/core.c +++ b/trunk/drivers/pnp/pnpacpi/core.c @@ -21,10 +21,7 @@ #include #include -#include #include -#include - #include "pnpacpi.h" static int num = 0; @@ -36,17 +33,15 @@ static int num = 0; * have irqs (PIC, Timer) because we call acpi_register_gsi. * Finaly only devices that have a CRS method need to be in this list. */ -static __initdata struct acpi_device_id excluded_id_list[] ={ - {"PNP0C09", 0}, /* EC */ - {"PNP0C0F", 0}, /* Link device */ - {"PNP0000", 0}, /* PIC */ - {"PNP0100", 0}, /* Timer */ - {"", 0}, -}; - +static char __initdata excluded_id_list[] = + "PNP0C09," /* EC */ + "PNP0C0F," /* Link device */ + "PNP0000," /* PIC */ + "PNP0100," /* Timer */ + ; static inline int is_exclusive_device(struct acpi_device *dev) { - return (!acpi_match_device_ids(dev, excluded_id_list)); + return (!acpi_match_ids(dev, excluded_id_list)); } /* @@ -124,25 +119,11 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) return ACPI_FAILURE(status) ? -ENODEV : 0; } -static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) -{ - return acpi_bus_set_power((acpi_handle)dev->data, - acpi_pm_device_sleep_state(&dev->dev, - device_may_wakeup(&dev->dev), NULL)); -} - -static int pnpacpi_resume(struct pnp_dev *dev) -{ - return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0); -} - static struct pnp_protocol pnpacpi_protocol = { .name = "Plug and Play ACPI", .get = pnpacpi_get_resources, .set = pnpacpi_set_resources, .disable = pnpacpi_disable_resources, - .suspend = pnpacpi_suspend, - .resume = pnpacpi_resume, }; static int __init pnpacpi_add_device(struct acpi_device *device) diff --git a/trunk/drivers/rtc/class.c b/trunk/drivers/rtc/class.c index 10ab3b71ffc6..8b3cd31d6a61 100644 --- a/trunk/drivers/rtc/class.c +++ b/trunk/drivers/rtc/class.c @@ -46,7 +46,6 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) { struct rtc_device *rtc = to_rtc_device(dev); struct rtc_time tm; - struct timespec ts = current_kernel_time(); if (strncmp(rtc->dev.bus_id, CONFIG_RTC_HCTOSYS_DEVICE, @@ -58,8 +57,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ set_normalized_timespec(&delta, - ts.tv_sec - oldtime, - ts.tv_nsec - (NSEC_PER_SEC >> 1)); + xtime.tv_sec - oldtime, + xtime.tv_nsec - (NSEC_PER_SEC >> 1)); return 0; } diff --git a/trunk/drivers/s390/net/ctcmain.c b/trunk/drivers/s390/net/ctcmain.c index 92e8a37b5022..b20fd0681733 100644 --- a/trunk/drivers/s390/net/ctcmain.c +++ b/trunk/drivers/s390/net/ctcmain.c @@ -674,7 +674,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) int first = 1; int i; unsigned long duration; - struct timespec done_stamp = current_kernel_time(); + struct timespec done_stamp = xtime; DBF_TEXT(trace, 4, __FUNCTION__); @@ -730,7 +730,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) spin_unlock(&ch->collect_lock); ch->ccw[1].count = ch->trans_skb->len; fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); - ch->prof.send_stamp = current_kernel_time(); + ch->prof.send_stamp = xtime; rc = ccw_device_start(ch->cdev, &ch->ccw[0], (unsigned long) ch, 0xff, 0); ch->prof.doios_multi++; @@ -2281,7 +2281,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) fsm_newstate(ch->fsm, CH_STATE_TX); fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); - ch->prof.send_stamp = current_kernel_time(); + ch->prof.send_stamp = xtime; rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], (unsigned long) ch, 0xff, 0); spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); diff --git a/trunk/drivers/s390/net/netiucv.c b/trunk/drivers/s390/net/netiucv.c index 268889474339..3d28e1a5bf79 100644 --- a/trunk/drivers/s390/net/netiucv.c +++ b/trunk/drivers/s390/net/netiucv.c @@ -753,7 +753,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) header.next = 0; memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); - conn->prof.send_stamp = current_kernel_time(); + conn->prof.send_stamp = xtime; txmsg.class = 0; txmsg.tag = 0; rc = iucv_message_send(conn->path, &txmsg, 0, 0, @@ -1185,7 +1185,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); fsm_newstate(conn->fsm, CONN_STATE_TX); - conn->prof.send_stamp = current_kernel_time(); + conn->prof.send_stamp = xtime; msg.tag = 1; msg.class = 0; diff --git a/trunk/drivers/serial/68328serial.c b/trunk/drivers/serial/68328serial.c index aad4012bbb30..cad426c9711e 100644 --- a/trunk/drivers/serial/68328serial.c +++ b/trunk/drivers/serial/68328serial.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -400,9 +401,9 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void do_softint(struct work_struct *work) +static void do_softint(void *private) { - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); + struct m68k_serial *info = (struct m68k_serial *) private; struct tty_struct *tty; tty = info->tty; @@ -424,9 +425,9 @@ static void do_softint(struct work_struct *work) * do_serial_hangup() -> tty->hangup() -> rs_hangup() * */ -static void do_serial_hangup(struct work_struct *work) +static void do_serial_hangup(void *private) { - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); + struct m68k_serial *info = (struct m68k_serial *) private; struct tty_struct *tty; tty = info->tty; @@ -1323,6 +1324,59 @@ static void show_serial_version(void) printk("MC68328 serial driver version 1.00\n"); } +#ifdef CONFIG_PM_LEGACY +/* Serial Power management + * The console (currently fixed at line 0) is a special case for power + * management because the kernel is so chatty. The console will be + * explicitly disabled my our power manager as the last minute, so we won't + * mess with it here. + */ +static struct pm_dev *serial_pm[NR_PORTS]; + +static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) +{ + struct m68k_serial *info = (struct m68k_serial *)dev->data; + + if(info == NULL) + return -1; + + /* special case for line 0 - pm restores it */ + if(info->line == 0) + return 0; + + switch (request) { + case PM_SUSPEND: + shutdown(info); + break; + + case PM_RESUME: + startup(info); + break; + } + return 0; +} + +void shutdown_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + + /* HACK: wait a bit for any pending printk's to be dumped */ + { + int i = 10000; + while(i--); + } + + shutdown(info); +} + +void startup_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + startup(info); +} +#endif /* CONFIG_PM_LEGACY */ + + static const struct tty_operations rs_ops = { .open = rs_open, .close = rs_close, @@ -1390,8 +1444,8 @@ rs68328_init(void) info->event = 0; info->count = 0; info->blocked_open = 0; - INIT_WORK(&info->tqueue, do_softint); - INIT_WORK(&info->tqueue_hangup, do_serial_hangup); + INIT_WORK(&info->tqueue, do_softint, info); + INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); info->line = i; @@ -1413,6 +1467,11 @@ rs68328_init(void) IRQ_FLG_STD, "M68328_UART", NULL)) panic("Unable to attach 68328 serial interrupt\n"); +#ifdef CONFIG_PM_LEGACY + serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); + if (serial_pm[i]) + serial_pm[i]->data = info; +#endif } local_irq_restore(flags); return 0; diff --git a/trunk/include/acpi/acpi_bus.h b/trunk/include/acpi/acpi_bus.h index 533ef40f7ccf..5e3dcf3299bf 100644 --- a/trunk/include/acpi/acpi_bus.h +++ b/trunk/include/acpi/acpi_bus.h @@ -131,7 +131,7 @@ struct acpi_device_ops { struct acpi_driver { char name[80]; char class[80]; - const struct acpi_device_id *ids; /* Supported Hardware IDs */ + char *ids; /* Supported Hardware IDs */ struct acpi_device_ops ops; struct device_driver drv; struct module *owner; @@ -341,8 +341,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); -int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids); +int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); @@ -366,8 +365,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) -int acpi_pm_device_sleep_state(struct device *, int, int *); - #endif /* CONFIG_ACPI */ #endif /*__ACPI_BUS_H__*/ diff --git a/trunk/include/acpi/acpi_drivers.h b/trunk/include/acpi/acpi_drivers.h index f85f77a538aa..553515912c0b 100644 --- a/trunk/include/acpi/acpi_drivers.h +++ b/trunk/include/acpi/acpi_drivers.h @@ -34,21 +34,16 @@ #define ACPI_BUS_COMPONENT 0x00010000 #define ACPI_SYSTEM_COMPONENT 0x02000000 -/* - * _HID definitions - * HIDs must conform to ACPI spec(6.1.4) - * Linux specific HIDs do not apply to this and begin with LNX: - */ +/* _HID definitions */ -#define ACPI_POWER_HID "LNXPOWER" +#define ACPI_POWER_HID "power_resource" #define ACPI_PROCESSOR_HID "ACPI0007" -#define ACPI_SYSTEM_HID "LNXSYSTM" -#define ACPI_THERMAL_HID "LNXTHERM" -#define ACPI_BUTTON_HID_POWERF "LNXPWRBN" -#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN" -#define ACPI_VIDEO_HID "LNXVIDEO" -#define ACPI_BAY_HID "LNXIOBAY" - +#define ACPI_SYSTEM_HID "acpi_system" +#define ACPI_THERMAL_HID "thermal" +#define ACPI_BUTTON_HID_POWERF "button_power" +#define ACPI_BUTTON_HID_SLEEPF "button_sleep" +#define ACPI_VIDEO_HID "video" +#define ACPI_BAY_HID "bay" /* -------------------------------------------------------------------------- PCI -------------------------------------------------------------------------- */ @@ -147,6 +142,10 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle) /*-------------------------------------------------------------------------- Suspend/Resume -------------------------------------------------------------------------- */ +#ifdef CONFIG_ACPI_SLEEP extern int acpi_sleep_init(void); +#else +#define acpi_sleep_init() do {} while (0) +#endif #endif /*__ACPI_DRIVERS_H__*/ diff --git a/trunk/include/acpi/actypes.h b/trunk/include/acpi/actypes.h index e73a38939120..fe8abc276437 100644 --- a/trunk/include/acpi/actypes.h +++ b/trunk/include/acpi/actypes.h @@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, /* Common string version of device HIDs and UIDs */ -struct acpica_device_id { +struct acpi_device_id { char value[ACPI_DEVICE_ID_LENGTH]; }; @@ -859,8 +859,8 @@ struct acpi_device_info { u32 valid; /* Indicates which fields below are valid */ u32 current_status; /* _STA value */ acpi_integer address; /* _ADR value if any */ - struct acpica_device_id hardware_id; /* _HID value if any */ - struct acpica_device_id unique_id; /* _UID value if any */ + struct acpi_device_id hardware_id; /* _HID value if any */ + struct acpi_device_id unique_id; /* _UID value if any */ u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ }; diff --git a/trunk/include/acpi/acutils.h b/trunk/include/acpi/acutils.h index a2918547c73f..a87ef1c8d46b 100644 --- a/trunk/include/acpi/acutils.h +++ b/trunk/include/acpi/acutils.h @@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, acpi_status acpi_ut_execute_HID(struct acpi_namespace_node *device_node, - struct acpica_device_id *hid); + struct acpi_device_id *hid); acpi_status acpi_ut_execute_CID(struct acpi_namespace_node *device_node, @@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, acpi_status acpi_ut_execute_UID(struct acpi_namespace_node *device_node, - struct acpica_device_id *uid); + struct acpi_device_id *uid); acpi_status acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); diff --git a/trunk/include/asm-i386/acpi.h b/trunk/include/asm-i386/acpi.h index 125179adf044..449f3f272e07 100644 --- a/trunk/include/asm-i386/acpi.h +++ b/trunk/include/asm-i386/acpi.h @@ -121,15 +121,6 @@ static inline void acpi_disable_pci(void) } extern int acpi_irq_balance_set(char *str); -/* routines for saving/restoring kernel state */ -extern int acpi_save_state_mem(void); -extern void acpi_restore_state_mem(void); - -extern unsigned long acpi_wakeup_address; - -/* early initialization routine */ -extern void acpi_reserve_bootmem(void); - #else /* !CONFIG_ACPI */ #define acpi_lapic 0 @@ -140,6 +131,20 @@ static inline void disable_acpi(void) { } #endif /* !CONFIG_ACPI */ + +#ifdef CONFIG_ACPI_SLEEP + +/* routines for saving/restoring kernel state */ +extern int acpi_save_state_mem(void); +extern void acpi_restore_state_mem(void); + +extern unsigned long acpi_wakeup_address; + +/* early initialization routine */ +extern void acpi_reserve_bootmem(void); + +#endif /*CONFIG_ACPI_SLEEP*/ + #define ARCH_HAS_POWER_INIT 1 #endif /*__KERNEL__*/ diff --git a/trunk/include/asm-i386/bootparam.h b/trunk/include/asm-i386/bootparam.h index b91b01783e4b..427d8652bfde 100644 --- a/trunk/include/asm-i386/bootparam.h +++ b/trunk/include/asm-i386/bootparam.h @@ -4,9 +4,8 @@ #include #include #include -#include #include -#include +#include #include