]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[PATCH] i2c: fix broken ds1337 initialization
authorDirk Eibach <eibach@gdsys.de>
Wed, 20 Dec 2006 07:34:43 +0000 (08:34 +0100)
committerChris Wright <chrisw@sous-sol.org>
Wed, 10 Jan 2007 19:05:19 +0000 (11:05 -0800)
commit2be250f7cb8b1b4ae1d4732795d952e49ea32145
tree81488efa639d300a8153e30bcff8546bc660d5a7
parentd4ea7f9f5554d94dcb8a630f470c724d05e8f112
[PATCH] i2c: fix broken ds1337 initialization

On a custom board with ds1337 RTC I found that upgrade from 2.6.15 to
2.6.18 broke RTC support.

The main problem are changes to ds1337_init_client().
When a ds1337 recognizes a problem (e.g. power or clock failure) bit 7
in status register is set. This has to be reset by writing 0 to status
register. But since there are only 16 byte written to the chip and the
first byte is interpreted as an address, the status register (which is
the 16th) is never written.
The other problem is, that initializing all registers to zero is not
valid for day, date and month register. Funny enough this is checked by
ds1337_detect(), which depends on this values not being zero. So then
treated by ds1337_init_client() the ds1337 is not detected anymore,
whereas the failure bit in the status register is still set.

Broken by commit f9e8957937ebf60d22732a5ca9130f48a7603f60 (2.6.16-rc1,
2006-01-06). This fix is in Linus' tree since 2.6.20-rc1 (commit
763d9c046a2e511ec090a8986d3f85edf7448e7e).

Signed-off-by: Dirk Stieler <stieler@gdsys.de>
Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/i2c/chips/ds1337.c