linux-mips
[Top] [All Lists]

Re: rtc_[gs]et_time()

To: Ladislav Michl <ladis@linux-mips.org>
Subject: Re: rtc_[gs]et_time()
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Tue, 15 Apr 2003 14:52:53 +0200 (MET DST)
Cc: Brian Murphy <brian@murphy.dk>, Geert Uytterhoeven <geert@linux-m68k.org>, Linux/MIPS Development <linux-mips@linux-mips.org>
In-reply-to: <20030415101238.C29593@ftp.linux-mips.org>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
On Tue, 15 Apr 2003, Ladislav Michl wrote:

> > >This makes it more complex to make drivers/char/genrtc.c work on MIPS, 
> > >since 
> > >usually the date and time have to be converted twice: once from struct 
> > >rtc_time
> > >to seconds in <asm/rtc.h>, and once from seconds to struct rtc_time in 
> > >each RTC
> > >driver.
> > >
> > >Is it OK to make rtc_[gs]et_time() always use struct rtc_time?
> > >
> > I quite like it the way it is ;-)
> 
> While I would like to see rtc_[gs]et_time() always use struct rtc_time ;)

 Note that the system time is always a monotonic count of seconds (plus a
fractional part), but the format stored in RTC chips varies.  So I think
it should be passed unchanged and the convertion left up to specific
drivers, possibly with an aid for ones that closely match 'struct
rtc_time' by means of library or inline helper functions. 

 E.g. one of the yet unsupported DECstations uses a 32bit register
counting 10ms intervals as its RTC (or actually TOY).  So maybe it's
'struct timespec' that should really be passed... 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>