Skip to content

Commit 673d5b4

Browse files
lenbLinus Torvalds
authored andcommitted
ACPI: restore CONFIG_ACPI_SLEEP
Restore the 2.6.22 CONFIG_ACPI_SLEEP build option, but now shadowing the new CONFIG_PM_SLEEP option. Signed-off-by: Len Brown <len.brown@intel.com> [ Modified to work with the PM config setup changes. ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 296699d commit 673d5b4

13 files changed

Lines changed: 25 additions & 10 deletions

File tree

‎arch/i386/kernel/acpi/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o
22
ifneq ($(CONFIG_PCI),)
33
obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
44
endif
5-
obj-$(CONFIG_ACPI) += sleep.o wakeup.o
5+
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
66

77
ifneq ($(CONFIG_ACPI_PROCESSOR),)
88
obj-y += cstate.o processor.o

‎arch/i386/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void)
422422
*/
423423
reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
424424
#endif
425-
#ifdef CONFIG_ACPI
425+
#ifdef CONFIG_ACPI_SLEEP
426426
/*
427427
* Reserve low memory region for sleep support.
428428
*/

‎arch/x86_64/kernel/acpi/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
obj-y := boot.o
22
boot-y := ../../../i386/kernel/acpi/boot.o
3-
obj-y += sleep.o wakeup.o
3+
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
44

55
ifneq ($(CONFIG_ACPI_PROCESSOR),)
66
obj-y += processor.o

‎arch/x86_64/kernel/head.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ident_complete:
120120
addq %rbp, trampoline_level4_pgt + 0(%rip)
121121
addq %rbp, trampoline_level4_pgt + (511*8)(%rip)
122122
#endif
123-
#ifdef CONFIG_ACPI
123+
#ifdef CONFIG_ACPI_SLEEP
124124
addq %rbp, wakeup_level4_pgt + 0(%rip)
125125
addq %rbp, wakeup_level4_pgt + (511*8)(%rip)
126126
#endif

‎arch/x86_64/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p)
333333
reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE);
334334
#endif
335335

336-
#ifdef CONFIG_ACPI
336+
#ifdef CONFIG_ACPI_SLEEP
337337
/*
338338
* Reserve low memory region for sleep support.
339339
*/

‎drivers/acpi/Kconfig‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ menuconfig ACPI
4242

4343
if ACPI
4444

45+
config ACPI_SLEEP
46+
bool
47+
depends on PM_SLEEP
48+
default y
49+
4550
config ACPI_PROCFS
4651
bool "Deprecated /proc/acpi files"
4752
depends on PROC_FS

‎drivers/acpi/sleep/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
obj-y := poweroff.o wakeup.o
2-
obj-$(CONFIG_PM_SLEEP) += main.o
3-
obj-$(CONFIG_X86) += proc.o
2+
obj-$(CONFIG_ACPI_SLEEP) += main.o
3+
obj-$(CONFIG_ACPI_SLEEP) += proc.o
44

55
EXTRA_CFLAGS += $(ACPI_CFLAGS)

‎drivers/acpi/sleep/poweroff.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
int acpi_sleep_prepare(u32 acpi_state)
2020
{
21+
#ifdef CONFIG_ACPI_SLEEP
2122
/* do we have a wakeup address for S2 and S3? */
2223
if (acpi_state == ACPI_STATE_S3) {
2324
if (!acpi_wakeup_address) {
@@ -30,6 +31,7 @@ int acpi_sleep_prepare(u32 acpi_state)
3031
}
3132
ACPI_FLUSH_CPU_CACHE();
3233
acpi_enable_wakeup_device_prep(acpi_state);
34+
#endif
3335
acpi_gpe_sleep_prepare(acpi_state);
3436
acpi_enter_sleep_state_prep(acpi_state);
3537
return 0;

‎drivers/acpi/sleep/proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ acpi_system_write_sleep(struct file *file,
7878
}
7979
#endif /* CONFIG_ACPI_PROCFS_SLEEP */
8080

81-
#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)
81+
#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || !defined(CONFIG_X86)
8282
/* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */
8383
#else
8484
#define HAVE_ACPI_LEGACY_ALARM

‎drivers/pci/pci-acpi.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
220220
}
221221
EXPORT_SYMBOL(pci_osc_control_set);
222222

223+
#ifdef CONFIG_ACPI_SLEEP
223224
/*
224225
* _SxD returns the D-state with the highest power
225226
* (lowest D-state number) supported in the S-state "x".
@@ -267,6 +268,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
267268
}
268269
return PCI_POWER_ERROR;
269270
}
271+
#endif
270272

271273
static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
272274
{
@@ -340,7 +342,9 @@ static int __init acpi_pci_init(void)
340342
ret = register_acpi_bus_type(&acpi_pci_bus);
341343
if (ret)
342344
return 0;
345+
#ifdef CONFIG_ACPI_SLEEP
343346
platform_pci_choose_state = acpi_pci_choose_state;
347+
#endif
344348
platform_pci_set_power_state = acpi_pci_set_power_state;
345349
return 0;
346350
}

0 commit comments

Comments
 (0)