]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/rtc/pcf8563.c
arm: mx6: use imx6_thermal driver
[karo-tx-uboot.git] / drivers / rtc / pcf8563.c
index 339e5f60801d8301cc93cb24ceccf2fbaf767c5f..25fa7c5b118eb2383dc246f3ab364db493260beb 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2001
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -72,7 +56,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 +78,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));