Commit Graph

14 Commits

Author SHA1 Message Date
Paul Fox 1da17ec6c1 rtcwake: ignore the tm_isdst field returned from the RTC
Signed-off-by: Paul Fox <pgf@laptop.org>
2009-09-07 12:29:37 +02:00
Karel Zak 77f5744c98 rtcwake: add S5 support
Based on patch from
   Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
at
   https://bugzilla.redhat.com/show_bug.cgi?id=449115

Piergiorgio's note about S5:
> According to the ACPI specifications, chapter 4.7.2.4 "Real Time
> Clock Alarm", the wakeup from RTC, when supported, should work from
> *sleep* state S1-S3 and, optionally, from S4.
>
> Note 3 (same chapter) says that S5 is *not* a sleep state and should
> not be supported. Actually it also says that: "The OS will disable
> the RTC_EN bit prior to entering the G2/S5 or G3 states regardless."
>
> Nevertheless, on all PC supporting the RTC wakeup I tested, all were
> able to wake from S5.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-07 12:04:26 +02:00
Daniel Mierswa 437fa54f05 replace usleep() for systems that don't have them
This function is marked obsolete in POSIX.1-2001 and removed in
POSIX.1-2008.

Conditionally replaced with nanosleep().

Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-21 09:58:17 +02:00
Marco d'Itri e4b0fc36ff rtcwake: support not suspending
People usually want to use pm-utils to suspend the system instead of
the raw kernel interface, so I added an option to just exit after
configuring the wakeup time.
Actually I think that all the suspend code should be removed from
rtcwake, since it does not really belong there.

Signed-off-by: Marco d'Itri <md@linux.it>
2009-01-26 21:22:24 +01:00
Karel Zak f8d87ab139 rtcwake: cleanup return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:36:10 +02:00
Gabriel Burt fc18118430 rtcwake: prefer RTC_WKALM_SET over RTC_ALM_SET
rtcwake: Prefer RTC_WKALM_SET over RTC_ALM_SET, fixing bug with not
waking up with new RTCs.  Also, return error if unable to set the alarm.

Signed-off-by: Gabriel Burt <gburt@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:19:46 +02:00
Paulius Zaleckas 47bf8ef7f1 rtcwake: fix the default mode to "standby"
Writing "suspend" to /sys/power/state does nothing.
Even "man rtcwake" says that default should be "standby" :)

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-09 12:49:00 +02:00
Mike Frysinger d3cf541492 rtcwake: fix typo SATE -> STATE
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-02-15 02:01:00 +01:00
Mike Frysinger c41e134067 rtcwake: include libgen.h for basename prototype
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-02-15 01:36:19 +01:00
David Brownell 1b7c164c49 rtcwake: fix UTC time usage
Timezone handling is broken in this version since it's always
passing UTC time into the kernel, even on systems where the
RTC uses the local timezone.

I think that bug must come from bugs in how the system used to
to originally develop this code handled the RTC timezone.  Both
RTCs should have been kept in UTC ... but only one of them was.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2008-02-08 01:33:39 +01:00
David Brownell 2148b05182 rtcwake: misc cleanups
Cleanups for rtcwake:

  - Minor doc updates:  highlight the framebuffer problem,
    give correct history of this code
  - Improve debug output
  - Fix some linelength bugs

Note that this code predated the sysfs "wakealarm" mechanism, and
works around several now-fixed bugs in the kernel RTC framework.

Nowadays it would make sense to make this program use only the sysfs
interface to the RTC, using "since_epoch" instead of RTC_RD_TIME and
"wakealarm" instead of the four other ioctls.  That could simplify
the mess involved in timezone handling.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-12-03 13:29:47 +01:00
Karel Zak dd12a5b9cb rtcwake: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11 14:27:08 +02:00
Karel Zak a6d35e6d68 rtcwake: fix verbose message
Just make NLS transtalors more happy. (rh#292081)

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-04 14:14:58 +02:00
Bernhard Walle 7670038954 misc-util: new rtcwake command
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-16 13:50:33 +02:00