From: Wolfgang Denk Date: Sun, 02 Sep 2012 17:31:12 +0200 Subject: [U-Boot] [PATCH] rtc: pcf8563: Make century compatible with Linux In-Reply-To: <2136837803.335794.1342793136811.JavaMail.root@advansee.com> References: <2136837803.335794.1342793136811.JavaMail.root@advansee.com> Message-ID: <20120902153112.12343203B2F@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Beno?t Th?baudeau, In message <2136837803.335794.1342793136811.JavaMail.root@advansee.com> you wrote: > This driver uses the century bit of this RTC in the opposite way Linux does> . > From Linux's rtc-pcf8563.c: > /* > * The meaning of MO_C bit varies by the chip type. > * From PCF8563 datasheet: this bit is toggled when the years > * register overflows from 99 to 00 > * 0 indicates the century is 20xx > * 1 indicates the century is 19xx > * From RTC8564 datasheet: this bit indicates change of > * century. When the year digit data overflows from 99 to 00, > * this bit is set. By presetting it to 0 while still in the > * 20th century, it will be set in year 2000, ... > * There seems no reliable way to know how the system use this > * bit. So let's do it heuristically, assuming we are live in > * 1970...2069. > */ > > As U-Boot's PCF8563 driver does not say it is supposed to support the RTC85> 64, > make this driver compatible with Linux's by giving the opposite meaning to > the > century bit. > > Signed-off-by: Beno?t Th?baudeau > Cc: Wolfgang Denk > --- > .../drivers/rtc/pcf8563.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160) O, throw away the worser part of it, And live the purer with the other half.