X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Frtc%2Fmx27rtc.c;h=563e8a4a3610da545394c852b5baa9dd1c00ba22;hb=4411652aead3509ce497e4598f533e2b7e4f4ba0;hp=7628dec3a9a15a00b61610cc8f238beb7e9df72a;hpb=5675b509165b67465a20e5cf71e07f40b449ef0c;p=oweals%2Fu-boot.git diff --git a/drivers/rtc/mx27rtc.c b/drivers/rtc/mx27rtc.c index 7628dec3a9..563e8a4a36 100644 --- a/drivers/rtc/mx27rtc.c +++ b/drivers/rtc/mx27rtc.c @@ -1,22 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Freescale i.MX27 RTC Driver * * Copyright (C) 2012 Philippe Reynes - * - * 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 - * */ #include @@ -43,7 +29,7 @@ int rtc_get(struct rtc_time *time) sec += min * 60 + hour * 3600 + day * 24 * 3600; - to_tm(sec, time); + rtc_to_tm(sec, time); return 0; } @@ -53,8 +39,7 @@ int rtc_set(struct rtc_time *time) struct rtc_regs *rtc_regs = (struct rtc_regs *)IMX_RTC_BASE; uint32_t day, hour, min, sec; - sec = mktime(time->tm_year, time->tm_mon, time->tm_mday, - time->tm_hour, time->tm_min, time->tm_sec); + sec = rtc_mktime(time); day = sec / (24 * 3600); sec = sec % (24 * 3600); @@ -75,9 +60,5 @@ int rtc_set(struct rtc_time *time) void rtc_reset(void) { - struct rtc_regs *rtc_regs = (struct rtc_regs *)IMX_RTC_BASE; - - writel(0, &rtc_regs->dayr); - writel(0, &rtc_regs->hourmin); - writel(0, &rtc_regs->seconds); + /* nothing to do */ }