Re: Kernel Real Time Clock (RTC) Support for I2C Devices

From: Wolfgang Denk (wd@denx.de)
Date: Wed Apr 18 2001 - 14:40:32 EST


Dear Grant,

in message <Pine.SOL.4.20.0104181408540.10793-100000@garnet.tc.umn.edu> you wrote:
>
> >From the looks of drivers/char/rtc.c it would appear that this kernel
> driver only supports bus-attached RTCs such as the mentioned MC146818. Is
> this correct?

This is correct; however, you can replace this driver by one of your
own (see for instance drivers/char/ip860_rtc.c in our version of the
2.4.x Linux sources which implements the RTC driver for a V3021 RTC
on a IP860 VMEBus system [MPC860 based]).

Right now I'm writing another driver for the Philips PCF8563 RTC,
which is much closer to what you have in mind.

> What is the correct access method / kernel tie-in for supporting such an
> I2C-based RTC device using the "standard" interfaces?

Assuming you have a working I2C driver, just add the necessary "glue"
code to provide the same interface as that of drivers/char/rtc.c .

> My hope is to use 'hwclock' from util-linux w/o modification. Is this
> reasonable?

Yes, this will work (it does for me on the MPC8xx).

Hope this helps,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
The universe does not have laws - it has habits, and  habits  can  be
broken.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:28 EST