X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Facpi%2Fsleep%2Fproc.c;h=5a76e5be61d5da1a1445feececba0f0a09f51bde;hb=02a93208edec0d655c9f18613d830dc6afeda7d4;hp=ccc11b33d89cd713036ae2d0f5ad98bb9a4bd3f3;hpb=905adce4094d64a6691df994e424fbf486301adc;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index ccc11b33d89..5a76e5be61d 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c @@ -60,7 +60,7 @@ acpi_system_write_sleep(struct file *file, state = simple_strtoul(str, NULL, 0); #ifdef CONFIG_SOFTWARE_SUSPEND if (state == 4) { - error = software_suspend(); + error = pm_suspend(PM_SUSPEND_DISK); goto Done; } #endif @@ -70,6 +70,14 @@ acpi_system_write_sleep(struct file *file, } #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 */ +#else +#define HAVE_ACPI_LEGACY_ALARM +#endif + +#ifdef HAVE_ACPI_LEGACY_ALARM + static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) { u32 sec, min, hr; @@ -341,6 +349,8 @@ acpi_system_write_alarm(struct file *file, end: return_VALUE(result ? result : count); } +#endif /* HAVE_ACPI_LEGACY_ALARM */ + extern struct list_head acpi_wakeup_device_list; extern spinlock_t acpi_device_lock; @@ -350,21 +360,31 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) { struct list_head *node, *next; - seq_printf(seq, "Device Sleep state Status\n"); + seq_printf(seq, "Device\tS-state\t Status Sysfs node\n"); spin_lock(&acpi_device_lock); list_for_each_safe(node, next, &acpi_wakeup_device_list) { struct acpi_device *dev = container_of(node, struct acpi_device, wakeup_list); + struct device *ldev; if (!dev->wakeup.flags.valid) continue; spin_unlock(&acpi_device_lock); - seq_printf(seq, "%4s %4d %s%8s\n", + + ldev = acpi_get_physical_device(dev->handle); + seq_printf(seq, "%s\t S%d\t%c%-8s ", dev->pnp.bus_id, (u32) dev->wakeup.sleep_state, - dev->wakeup.flags.run_wake ? "*" : "", + dev->wakeup.flags.run_wake ? '*' : ' ', dev->wakeup.state.enabled ? "enabled" : "disabled"); + if (ldev) + seq_printf(seq, "%s:%s", + ldev->bus ? ldev->bus->name : "no-bus", + ldev->bus_id); + seq_printf(seq, "\n"); + put_device(ldev); + spin_lock(&acpi_device_lock); } spin_unlock(&acpi_device_lock); @@ -454,6 +474,7 @@ static const struct file_operations acpi_system_sleep_fops = { }; #endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ +#ifdef HAVE_ACPI_LEGACY_ALARM static const struct file_operations acpi_system_alarm_fops = { .open = acpi_system_alarm_open_fs, .read = seq_read, @@ -469,8 +490,9 @@ static u32 rtc_handler(void *context) return ACPI_INTERRUPT_HANDLED; } +#endif /* HAVE_ACPI_LEGACY_ALARM */ -static int acpi_sleep_proc_init(void) +static int __init acpi_sleep_proc_init(void) { struct proc_dir_entry *entry = NULL; @@ -486,6 +508,7 @@ static int acpi_sleep_proc_init(void) entry->proc_fops = &acpi_system_sleep_fops; #endif +#ifdef HAVE_ACPI_LEGACY_ALARM /* 'alarm' [R/W] */ entry = create_proc_entry("alarm", S_IFREG | S_IRUGO | S_IWUSR, @@ -493,6 +516,9 @@ static int acpi_sleep_proc_init(void) if (entry) entry->proc_fops = &acpi_system_alarm_fops; + acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); +#endif /* HAVE_ACPI_LEGACY_ALARM */ + /* 'wakeup device' [R/W] */ entry = create_proc_entry("wakeup", S_IFREG | S_IRUGO | S_IWUSR, @@ -500,7 +526,6 @@ static int acpi_sleep_proc_init(void) if (entry) entry->proc_fops = &acpi_system_wakeup_device_fops; - acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); return 0; }