13 Mar, 2010

1 commit

  • Without this patch /sys/class/rtc/$CONFIG_RTC_HCTOSYS_DEVICE/hctosys
    contains a 1 (meaning "This rtc was used to initialize the system clock")
    even if reading the time at bootup failed.

    Moreover change error handling in rtc_hctosys() to use goto and so reduce
    the indention level.

    Signed-off-by: Uwe Kleine-König
    Cc: Paul Gortmaker
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     

23 Sep, 2009

1 commit

  • CONFIG_RTC_HCTOSYS allows the kernel to read the system time from the RTC
    at boot and resume, avoiding the need for userspace to do so.
    Unfortunately userspace currently has no way to know whether this
    configuration option is enabled and thus cannot sensibly choose whether to
    run hwclock itself or not. Add a hctosys sysfs attribute which indicates
    whether a given RTC set the system clock.

    Signed-off-by: Matthew Garrett
    Acked-by: Alessandro Zummo
    Cc: Mark Brown
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Garrett
     

28 Apr, 2008

1 commit

  • In current kernel if we want to set the alarm time, the absolute time the
    seconds relative to 1970-01-01 00:00:00) should be written into
    /sys/class/rtc/rtc0/wakealarm. It is not convenient.

    It is more reasonable to add the support for the alarm time relative to
    current RTC time.(the unit is second)

    For example:
    If the RTC is required to generate alarm after 2 minutes, the following
    will be OK.
    echo +120 > /sys/class/rtc/rtc0/wakealarm
    or echo +0x78 > /sys/class/rtc/rtc0/wakealarm

    Signed-off-by: Zhao Yakui
    Signed-off-by: Zhang Rui
    Signed-off-by: David Brownell
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhao Yakui
     

07 Feb, 2008

1 commit

  • Start making the rtc-cmos alarm act more like a oneshot alarm by disabling
    that alarm after its IRQ fires. (ACPI hooks are also needed.)

    The Linux RTC framework has previously been a bit vague in this area, but
    any other behavior is problematic and not very portable. RTCs with full
    YYYY-MM-DD HH:MM[:SS] alarms won't have a problem here. Only ones with
    partial match criteria, with the most visible example being the PC RTC, get
    confused. (Because the criteria will match repeatedly.)

    Update comments relating to that oneshot behavior and timezone handling.
    (Timezones are another issue that's mostly visible with rtc-cmos. That's
    because PCs often dual-boot MS-Windows, which likes its RTC to match local
    wall-clock time instead of UTC.)

    Signed-off-by: David Brownell
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

19 Oct, 2007

1 commit

  • Found these while looking at printk uses.

    Add missing newlines to dev_ uses
    Add missing KERN_ prefixes to multiline dev_s
    Fixed a wierd->weird spelling typo
    Added a newline to a printk

    Signed-off-by: Joe Perches
    Cc: "Luck, Tony"
    Cc: Jens Axboe
    Cc: Mark M. Hoffman
    Cc: Roland Dreier
    Cc: Tilman Schmidt
    Cc: David Woodhouse
    Cc: Jeff Garzik
    Cc: Stephen Hemminger
    Cc: Greg KH
    Cc: Jeremy Fitzhardinge
    Cc: Geert Uytterhoeven
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: James Smart
    Cc: Andrew Vasquez
    Cc: "Antonino A. Daplas"
    Cc: Evgeniy Polyakov
    Cc: Russell King
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

17 Oct, 2007

1 commit

  • drivers/char/rtc.c exposed a sysctl to change the maximum frequency at
    which a non-root user could ask the RTC to generate interrupts (via the
    RTC_IRQP_SET ioctl). This value is no longer available under the new RTC
    subsystem, so add it to sysfs for each RTC device.

    Works for me on x86_64 (both reads and writes), using rtc-cmos.

    Signed-off-by: Bryan Kadzban
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bryan Kadzban
     

09 May, 2007

3 commits

  • Finish converting the RTC framework so it no longer uses class_device.

    Signed-off-by: David Brownell
    Acked-by: Greg Kroah-Hartman
    Acked-By: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • This simplifies the RTC sysfs support by removing the class_interface that
    hooks it into the rtc core. If it's configured, then sysfs support is now
    part of the RTC core, and is never a separate module.

    It's another step towards being able to remove "struct class_device".

    Signed-off-by: David Brownell
    Acked-by: Greg Kroah-Hartman
    Acked-By: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • This patch removes class_device from the programming interface that the RTC
    framework exposes to the rest of the kernel. Now an rtc_device is passed,
    which is more type-safe and streamlines all the relevant code.

    Signed-off-by: David Brownell
    Acked-by: Greg Kroah-Hartman
    Acked-By: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

13 Feb, 2007

1 commit

  • This adds a new "wakealarm" sysfs attribute to RTC class devices which support
    alarm operations and are wakeup-capable:

    - It reads as either empty, or the scheduled alarm time as seconds
    since the POSIX epoch. (That time may already have passed, since
    nothing currently enforces one-shot alarm semantics.)

    - It can be written with an alarm time in the future, again seconds
    since the POSIX epoch, which enables the alarm.

    - It can be written with an alarm time not in the future (such as 0,
    the start of the POSIX epoch) to disable the alarm.

    Usage examples (some need GNU date) after "cd /sys/class/rtc/rtcN":

    alarm after 10 minutes:
    # echo $(( $(cat since_epoch) + 10 * 60 )) > wakealarm
    alarm tuesday evening 10pm:
    # date -d '10pm tuesday' "+%s" > wakealarm
    disable alarm:
    # echo 0 > wakealarm

    This resembles the /proc/acpi/alarm file in that nothing happens when the
    alarm triggers ... except possibly waking the system from sleep. It's also
    like that in a nasty way: not much can be done to prevent one task from
    clobbering another task's alarm settings.

    It differs from that file in that there's no in-kernel date parser.

    Note that a few RTCs ignore rtc_wkalrm.enabled when setting alarms, or aren't
    set up correctly, so they won't yet behave with this attribute.

    Signed-off-by: David Brownell
    Acked-by: Pavel Machek
    Cc: Alessandro Zummo
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

27 Jan, 2007

1 commit


14 Dec, 2006

1 commit


02 Oct, 2006

1 commit


01 Oct, 2006

1 commit

  • This makes RTC core components use "subsys_init" instead of "module_init", as
    appropriate for subsystem infrastructure. This is mostly useful for
    statically linking drivers in other parts of the tree that may provide an RTC
    interface as a secondary functionality (e.g. part of a multifunction chip);
    they won't need to worry so much about drivers/Makefile link order.

    Signed-off-by: David Brownell
    Cc: Alessandro Zummo
    Acked-by: Oleg Verych
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

28 Mar, 2006

1 commit

  • This patch adds the sysfs interface to the RTC subsystem.

    Each RTC client will have his own entry under /sys/classs/rtc/rtcN .

    Within this entry some attributes are exported by the subsystem, like date and
    time.

    Signed-off-by: Alessandro Zummo
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alessandro Zummo