diff options
author | Nigel Cunningham <nigel@nigel.suspend2.net> | 2007-07-19 04:47:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:43 -0400 |
commit | 5a60d6235c8352ade8f2699e72fcdfe853730456 (patch) | |
tree | cafab638df562b912e9e2a653e5c7238816d9706 /kernel/power | |
parent | bd804eba1c8597cbb7cd5a5f9fe886aae16a079a (diff) |
PM: Optional beeping during resume from suspend to RAM
Add a feature allowing the user to make the system beep during a resume from
suspend to RAM, on x86_64 and i386.
This is useful for the users with broken resume from RAM, so that they can
verify if the control reaches the kernel after a wake-up event.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 32147b57c3bf..c74a56436d8b 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -332,6 +332,27 @@ static ssize_t state_store(struct kset *kset, const char *buf, size_t n) | |||
332 | 332 | ||
333 | power_attr(state); | 333 | power_attr(state); |
334 | 334 | ||
335 | unsigned long s2ram_beep = 0; | ||
336 | |||
337 | static ssize_t s2ram_beep_show(struct kset *kset, char *buf) | ||
338 | { | ||
339 | return sprintf(buf, "%d\n", s2ram_beep); | ||
340 | } | ||
341 | |||
342 | static ssize_t | ||
343 | s2ram_beep_store(struct kset *kset, const char *buf, size_t n) | ||
344 | { | ||
345 | int val; | ||
346 | |||
347 | if (sscanf(buf, "%d", &val) > 0) { | ||
348 | s2ram_beep = val; | ||
349 | return n; | ||
350 | } | ||
351 | return -EINVAL; | ||
352 | } | ||
353 | |||
354 | power_attr(s2ram_beep); | ||
355 | |||
335 | #ifdef CONFIG_PM_TRACE | 356 | #ifdef CONFIG_PM_TRACE |
336 | int pm_trace_enabled; | 357 | int pm_trace_enabled; |
337 | 358 | ||
@@ -357,11 +378,13 @@ power_attr(pm_trace); | |||
357 | static struct attribute * g[] = { | 378 | static struct attribute * g[] = { |
358 | &state_attr.attr, | 379 | &state_attr.attr, |
359 | &pm_trace_attr.attr, | 380 | &pm_trace_attr.attr, |
381 | &s2ram_beep_attr.attr, | ||
360 | NULL, | 382 | NULL, |
361 | }; | 383 | }; |
362 | #else | 384 | #else |
363 | static struct attribute * g[] = { | 385 | static struct attribute * g[] = { |
364 | &state_attr.attr, | 386 | &state_attr.attr, |
387 | &s2ram_beep_attr.attr, | ||
365 | NULL, | 388 | NULL, |
366 | }; | 389 | }; |
367 | #endif /* CONFIG_PM_TRACE */ | 390 | #endif /* CONFIG_PM_TRACE */ |