MCP7941x RTC

Started by ulink, September 21, 2014, 09:10:52 PM

Previous topic - Next topic

ulink

I wanted to use a MCP7941x RTC attached at TWI1. I disabled the sunxi rtc driver in kernel config and script.bin and activated the DS1307 driver (which can handle MCP7941x RTCs too).

So far, Linux finds and uses the RTC (first 2 lines  are from RTC debug mode):
[    7.795538] rtc-ds1307 1-006f: read: c7 47 17 09 21 09 14
[    7.822012] rtc-ds1307 1-006f: read secs=47, mins=47, hours=17, mday=21, mon=8, year=114, wday=0
[    7.865765] rtc-ds1307 1-006f: rtc core: registered mcp7941x as rtc0
[    7.887572] rtc-ds1307 1-006f: 64 bytes nvram

The Linux driver also creates the /dev/rtc and /dev/rtc0 devices:
lrwxrwxrwx 1 root root      4 Jan  1  1970 /dev/rtc -> rtc0
crw------- 1 root root 254, 0 Jan  1  1970 /dev/rtc0

Everything seems ok, RTC is found and date/time was read.

BUT: hwclock can't acces the RTC (says "Timed out waiting for time change").
Even "cat /proc/driver/rtc" shows now time changes too because it can't access the RTC hardware.

WTF? Seems that Linux' own RTC driver prevents Linux from accessing the RTC hardware?