Skip to content

RFC RTC subsystem

Alessandro Zummo lkml 1 version In review

Get series with b4
b4 am 20051220214343.79d5ee91@inspiron

Versions newest first

  1. v1 RFC Latest6 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6RTC subsystem, classdrivers/Kconfig drivers/Makefile drivers/rtc/Kconfig +5 more+343 -013 replies
2/6RTC subsystem, ARM cleanuparch/arm/Kconfig arch/arm/common/rtctime.c+14 -950 replies
3/6RTC subsystem, sysfs interfacedrivers/rtc/Kconfig drivers/rtc/Makefile drivers/rtc/rtc-sysfs.c+113 -00 replies
4/6RTC subsystem, proc interfacedrivers/rtc/Kconfig drivers/rtc/Makefile drivers/rtc/rtc-proc.c+144 -00 replies
5/6RTC subsystem, dev interfacedrivers/rtc/Kconfig drivers/rtc/Makefile drivers/rtc/rtc-dev.c+348 -00 replies
6/6RTC subsystem, X1205 driverdrivers/rtc/Kconfig drivers/rtc/Makefile drivers/rtc/rtc-x1205.c+749 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/6] RTC subsystem

Hello,

this is a proposal for the implementation of a kernel-wide
RTC subsystem.

The current state of RTCs under linux is that each one
of the current drivers is actually self-contained and has a lot of redundant functions [1].

The lack of a kernel-wide subsystem is particulary important
on embedded devices, where the RTC is usually implemented on an I2C chip.

Of the current I2C RTC drivers, no-one actually interfaces
with the kernel [2]: the driver is actually useless without further patches that are probably provided as part of an external project.

When new driver are to be implemented [3], I've noticed
authors are often confused on how to do it, resulting in drivers that will not work on different architectures and that will probably never be merged in the kernel.

They also happen to use ioctls over (struct i2c_client *)->command,
which has recently been deprecated [4].

The architecture is quite simple. Each RTC device should
register to the RTC class, providing a set of pointers to functions. The class will provide access to the RTC to the whole kernel and userspace.

For this purpose, the class supports multiple interfaces,
like sysfs, proc and dev.

The user has complete control over which interfaces
gets added using the standard Kconfig mechanism.

proc and dev, due to their nature, will only expose
the first RTC that registers to the subsystem.

The RTC code is derived from the one of the ARM subsystem.

This patchset has been verify to properly work under Linux/ARM
on several NSLU2s (http://www.linux-nslu2.org) and applies successfully on the 2.6.15-rc6 kernel . If this is the right way to go, I will port the x86 rtc driver in order to get broader testing.

I'd appreciate receiving feedback on this proposal.

Thanks in advance.

--

Best regards,

Alessandro Zummo,
Tower Technologies - Turin, Italy

http://www.towertech.it

[1]

	http://lkml.org/lkml/2005/11/17/180

[2]

	drivers/i2c/chips/m41t00.c
	drivers/i2c/chips/rtc8564.c
	drivers/i2c/chips/ds1337.c
	drivers/i2c/chips/ds1374.c

[3]

	http://lists.lm-sensors.org/pipermail/lm-sensors/2005-November/014428.html
	http://lists.lm-sensors.org/pipermail/lm-sensors/2005-November/014386.html

[4]

	http://lists.lm-sensors.org/pipermail/lm-sensors/2005-December/014688.html
	http://lists.lm-sensors.org/pipermail/lm-sensors/2005-November/014369.html