[RFC 0/5] add rtc support
Antony Pavlov
antonynpavlov at gmail.com
Thu Jul 10 23:12:36 PDT 2014
On Fri, 11 Jul 2014 07:37:38 +0200
Sascha Hauer <s.hauer at pengutronix.de> wrote:
> On Thu, Jul 10, 2014 at 12:33:14PM +0400, Antony Pavlov wrote:
> > This patchseries imports RTC support from linux-3.15.
> >
> > User can use 'hwclock' command to see realtime clock readout.
> >
> > Tested with DS1307.
> >
> > TODOs:
> >
> > * rtc_set_time() is not realized;
> > * ds1307_set_time() is not tested;
> > * bcd lib is compiled in even if rtc support is disabled (as linux does);
> > we can make it optional;
>
> It's probably not worth it. The linker will throw it away anyway if
> unused.
Hmm, I have missed this.
In this case can we drop I2C_SMBUS Kconfig stuff
+config I2C_SMBUS
+ bool
+
+obj-$(CONFIG_I2C_SMBUS) += i2c-smbus.o
from 'add driver for PCA95[357]x, ...' series?
Anyway CONFIG_I2C_SMBUS has another meaning in linux.
>
> > * adjust include/linux/rtc.h and include/rtc.h;
> > * rtc_unregister() is not realized.
>
> Maybe an environment variable which holds the seconds since epoch would
> be useful. This way scripts could make use of the current RTC time.
So you propose to add an option to hwclock command to store RTC readout into variable,
isn't it?
I have an idea to put epoch offset (number of years into AD to which a zero year value
in the Hardware Clock refers) into "global.epoch" variable and add corresponding
Kconfig option for default epoch value.
--
Best regards,
Antony Pavlov
More information about the barebox
mailing list