diff options
Diffstat (limited to 'drivers/acpi/proc.c')
-rw-r--r-- | drivers/acpi/proc.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 1ac678d2c51c..afad67769db6 100644 --- a/drivers/acpi/proc.c +++ b/drivers/acpi/proc.c | |||
@@ -17,64 +17,11 @@ | |||
17 | 17 | ||
18 | /* | 18 | /* |
19 | * this file provides support for: | 19 | * this file provides support for: |
20 | * /proc/acpi/sleep | ||
21 | * /proc/acpi/alarm | 20 | * /proc/acpi/alarm |
22 | * /proc/acpi/wakeup | 21 | * /proc/acpi/wakeup |
23 | */ | 22 | */ |
24 | 23 | ||
25 | ACPI_MODULE_NAME("sleep") | 24 | ACPI_MODULE_NAME("sleep") |
26 | #ifdef CONFIG_ACPI_PROCFS | ||
27 | static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) | ||
28 | { | ||
29 | int i; | ||
30 | |||
31 | for (i = 0; i <= ACPI_STATE_S5; i++) { | ||
32 | if (sleep_states[i]) { | ||
33 | seq_printf(seq, "S%d ", i); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | seq_puts(seq, "\n"); | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file) | ||
43 | { | ||
44 | return single_open(file, acpi_system_sleep_seq_show, PDE(inode)->data); | ||
45 | } | ||
46 | |||
47 | static ssize_t | ||
48 | acpi_system_write_sleep(struct file *file, | ||
49 | const char __user * buffer, size_t count, loff_t * ppos) | ||
50 | { | ||
51 | char str[12]; | ||
52 | u32 state = 0; | ||
53 | int error = 0; | ||
54 | |||
55 | if (count > sizeof(str) - 1) | ||
56 | goto Done; | ||
57 | memset(str, 0, sizeof(str)); | ||
58 | if (copy_from_user(str, buffer, count)) | ||
59 | return -EFAULT; | ||
60 | |||
61 | /* Check for S4 bios request */ | ||
62 | if (!strcmp(str, "4b")) { | ||
63 | error = acpi_suspend(4); | ||
64 | goto Done; | ||
65 | } | ||
66 | state = simple_strtoul(str, NULL, 0); | ||
67 | #ifdef CONFIG_HIBERNATION | ||
68 | if (state == 4) { | ||
69 | error = hibernate(); | ||
70 | goto Done; | ||
71 | } | ||
72 | #endif | ||
73 | error = acpi_suspend(state); | ||
74 | Done: | ||
75 | return error ? error : count; | ||
76 | } | ||
77 | #endif /* CONFIG_ACPI_PROCFS */ | ||
78 | 25 | ||
79 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || !defined(CONFIG_X86) | 26 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || !defined(CONFIG_X86) |
80 | /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */ | 27 | /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */ |
@@ -463,17 +410,6 @@ static const struct file_operations acpi_system_wakeup_device_fops = { | |||
463 | .release = single_release, | 410 | .release = single_release, |
464 | }; | 411 | }; |
465 | 412 | ||
466 | #ifdef CONFIG_ACPI_PROCFS | ||
467 | static const struct file_operations acpi_system_sleep_fops = { | ||
468 | .owner = THIS_MODULE, | ||
469 | .open = acpi_system_sleep_open_fs, | ||
470 | .read = seq_read, | ||
471 | .write = acpi_system_write_sleep, | ||
472 | .llseek = seq_lseek, | ||
473 | .release = single_release, | ||
474 | }; | ||
475 | #endif /* CONFIG_ACPI_PROCFS */ | ||
476 | |||
477 | #ifdef HAVE_ACPI_LEGACY_ALARM | 413 | #ifdef HAVE_ACPI_LEGACY_ALARM |
478 | static const struct file_operations acpi_system_alarm_fops = { | 414 | static const struct file_operations acpi_system_alarm_fops = { |
479 | .owner = THIS_MODULE, | 415 | .owner = THIS_MODULE, |
@@ -495,12 +431,6 @@ static u32 rtc_handler(void *context) | |||
495 | 431 | ||
496 | int __init acpi_sleep_proc_init(void) | 432 | int __init acpi_sleep_proc_init(void) |
497 | { | 433 | { |
498 | #ifdef CONFIG_ACPI_PROCFS | ||
499 | /* 'sleep' [R/W] */ | ||
500 | proc_create("sleep", S_IFREG | S_IRUGO | S_IWUSR, | ||
501 | acpi_root_dir, &acpi_system_sleep_fops); | ||
502 | #endif /* CONFIG_ACPI_PROCFS */ | ||
503 | |||
504 | #ifdef HAVE_ACPI_LEGACY_ALARM | 434 | #ifdef HAVE_ACPI_LEGACY_ALARM |
505 | /* 'alarm' [R/W] */ | 435 | /* 'alarm' [R/W] */ |
506 | proc_create("alarm", S_IFREG | S_IRUGO | S_IWUSR, | 436 | proc_create("alarm", S_IFREG | S_IRUGO | S_IWUSR, |