summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/pcf8563.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-30 23:49:17 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-30 23:49:17 +0200
commit1c27059a2f7158a9c9a8778535b030935d75179d (patch)
treebf577d5c9f0da21c5d57feed1091214e54c39dec /drivers/rtc/pcf8563.c
parent8f0732ac3dc3bdbbcada313dc4b4b38d5d2c376a (diff)
parent4668a086bb0a769b741e3a4ffab85f1c41c7cdb8 (diff)
downloadblackbird-obmc-uboot-1c27059a2f7158a9c9a8778535b030935d75179d.tar.gz
blackbird-obmc-uboot-1c27059a2f7158a9c9a8778535b030935d75179d.zip
Merge remote-tracking branch 'u-boot/master'
Diffstat (limited to 'drivers/rtc/pcf8563.c')
-rw-r--r--drivers/rtc/pcf8563.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c
index 339e5f6080..a028533084 100644
--- a/drivers/rtc/pcf8563.c
+++ b/drivers/rtc/pcf8563.c
@@ -72,7 +72,7 @@ int rtc_get (struct rtc_time *tmp)
tmp->tm_hour = bcd2bin (hour & 0x3F);
tmp->tm_mday = bcd2bin (mday & 0x3F);
tmp->tm_mon = bcd2bin (mon_cent & 0x1F);
- tmp->tm_year = bcd2bin (year) + ((mon_cent & 0x80) ? 2000 : 1900);
+ tmp->tm_year = bcd2bin (year) + ((mon_cent & 0x80) ? 1900 : 2000);
tmp->tm_wday = bcd2bin (wday & 0x07);
tmp->tm_yday = 0;
tmp->tm_isdst= 0;
@@ -94,7 +94,7 @@ int rtc_set (struct rtc_time *tmp)
rtc_write (0x08, bin2bcd(tmp->tm_year % 100));
- century = (tmp->tm_year >= 2000) ? 0x80 : 0;
+ century = (tmp->tm_year >= 2000) ? 0 : 0x80;
rtc_write (0x07, bin2bcd(tmp->tm_mon) | century);
rtc_write (0x06, bin2bcd(tmp->tm_wday));
OpenPOWER on IntegriCloud