• David Brownell's avatar
    [PATCH] RTC framework driver for CMOS RTCs · 7be2c7c9
    David Brownell authored
    This is an "RTC framework" driver for the "CMOS" RTCs which are standard on
    PCs and some other platforms.  That's MC146818 compatible silicon.
    Advantages of this vs.  drivers/char/rtc.c (use one _or_ the other, only
    one will be able to claim the RTC irq) include:
     - This leverages both the new RTC framework and the driver model; both
       PNPACPI and platform device modes are supported.  (A separate patch
       creates a platform device on PCs where PNPACPI isn't configured.)
     - It supports common extensions like longer alarms.  (A separate patch
       exports that information from ACPI through platform_data.)
     - Likewise, system wakeup events use "real driver model support", with
       policy control via sysfs "wakeup" attributes and and using normal rtc
       ioctls to manage wakeup.  (Patch in the works.  The ACPI hooks are
       known; /proc/acpi/alarm can vanish.  Making it work with EFI will
       be a minor challenge to someone with e.g. a MiniMac.)
    It's not yet been tested on non-x86 systems, without ACPI, or with HPET.
    And the RTC framework will surely have teething pains on "mainstream"
    PC-based systems (though must embedded Linux systems use it heavily), not
    limited to sorting out the "/dev/rtc0" issue (udev easily tweaked).  Also,
    the ALSA rtctimer code doesn't use the new RTC API.
    Otherwise, this should be a no-known-regressions replacement for the old
    drivers/char/rtc.c driver, and should help the non-embedded distros (and
    the new timekeeping code) start to switch to the framework.
    Note also that any systems using "rtc-m48t86" are candidates to switch over
    to this more functional driver; the platform data is different, and the way
    bytes are read is different, but otherwise those chips should be compatible.
    [akpm@osdl.org: sparc32 fix]
    [akpm@osdl.org: sparc64 fix]
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Cc: Woody Suwalski <woodys@xandros.com>
    Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
mc146818rtc.h 3.85 KB