aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-04-25 15:20:10 -0400
committerLen Brown <len.brown@intel.com>2007-04-25 15:20:10 -0400
commit8aa55591bfea25c441117e82711cbfd7c274250a (patch)
tree8429241902a2aded2a93b6b7d7ddb99b778b0ddb
parentcf6c6045a06aed2ccd8ebd0a3128ce0f2f8a11aa (diff)
ACPI: make /proc/acpi/wakeup more useful
This updates /proc/acpi/wakeup to be more informative, primarily by showing the sysfs node associated with each wakeup-enabled device. Example: Device S-state Status Sysfs node PCI0 S4 disabled no-bus:pci0000:00 PS2M S4 disabled pnp:00:05 PS2K S4 disabled pnp:00:06 UAR1 S4 disabled pnp:00:08 USB1 S3 disabled pci:0000:00:03.0 USB2 S3 disabled pci:0000:00:03.1 USB3 S3 disabled USB4 S3 disabled pci:0000:00:03.3 S139 S4 disabled LAN S4 disabled pci:0000:00:04.0 MDM S4 disabled AUD S4 disabled pci:0000:00:02.7 SLPB S4 *enabled Eventually this file should be removed, but until then it's almost the only way we have to tell how the relevant ACPI tables are broken (and cope). In that example, two devices don't actually exist (USB3, S139), one can't issue wakeup events (PCI0), and two seem harmlessly (?) confused (MDM and AUD are the same PCI device, but it's the _modem_ that does wake-on-ring). In particular, we need to be sure driver model nodes are properly hooked up before we can get rid of this ACPI-only interface for wakeup events. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/sleep/proc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index ccc11b33d89c..2d912b71e543 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -350,21 +350,31 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
350{ 350{
351 struct list_head *node, *next; 351 struct list_head *node, *next;
352 352
353 seq_printf(seq, "Device Sleep state Status\n"); 353 seq_printf(seq, "Device\tS-state\t Status Sysfs node\n");
354 354
355 spin_lock(&acpi_device_lock); 355 spin_lock(&acpi_device_lock);
356 list_for_each_safe(node, next, &acpi_wakeup_device_list) { 356 list_for_each_safe(node, next, &acpi_wakeup_device_list) {
357 struct acpi_device *dev = 357 struct acpi_device *dev =
358 container_of(node, struct acpi_device, wakeup_list); 358 container_of(node, struct acpi_device, wakeup_list);
359 struct device *ldev;
359 360
360 if (!dev->wakeup.flags.valid) 361 if (!dev->wakeup.flags.valid)
361 continue; 362 continue;
362 spin_unlock(&acpi_device_lock); 363 spin_unlock(&acpi_device_lock);
363 seq_printf(seq, "%4s %4d %s%8s\n", 364
365 ldev = acpi_get_physical_device(dev->handle);
366 seq_printf(seq, "%s\t S%d\t%c%-8s ",
364 dev->pnp.bus_id, 367 dev->pnp.bus_id,
365 (u32) dev->wakeup.sleep_state, 368 (u32) dev->wakeup.sleep_state,
366 dev->wakeup.flags.run_wake ? "*" : "", 369 dev->wakeup.flags.run_wake ? '*' : ' ',
367 dev->wakeup.state.enabled ? "enabled" : "disabled"); 370 dev->wakeup.state.enabled ? "enabled" : "disabled");
371 if (ldev)
372 seq_printf(seq, "%s:%s",
373 ldev->bus ? ldev->bus->name : "no-bus",
374 ldev->bus_id);
375 seq_printf(seq, "\n");
376 put_device(ldev);
377
368 spin_lock(&acpi_device_lock); 378 spin_lock(&acpi_device_lock);
369 } 379 }
370 spin_unlock(&acpi_device_lock); 380 spin_unlock(&acpi_device_lock);