X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Frtc%2Fds1306.c;h=02d617e09c92df3f678bc21e7f5f553b7056b4ed;hb=f91fb7242a308d986574ec35281edcda1c149b4c;hp=1ec1837cb4e1e79405d6ba7357d8fc0b51f307f0;hpb=aaf5e825606a70ddc8fca8e366d8c16a6fd3cc7c;p=oweals%2Fu-boot.git diff --git a/drivers/rtc/ds1306.c b/drivers/rtc/ds1306.c index 1ec1837cb4..02d617e09c 100644 --- a/drivers/rtc/ds1306.c +++ b/drivers/rtc/ds1306.c @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2002 SIXNET, dge@sixnetio.com. * * (C) Copyright 2004, Li-Pro.Net * Stephan Linz - * - * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -20,8 +19,6 @@ #include #include -#if defined(CONFIG_CMD_DATE) - #define RTC_SECONDS 0x00 #define RTC_MINUTES 0x01 #define RTC_HOURS 0x02 @@ -110,7 +107,7 @@ int rtc_get (struct rtc_time *tmp) immap->im_cpm.cp_pbdat &= ~PB_SPI_CE; /* Disable DS1306 Chip */ udelay (10); - GregorianDay (tmp); /* Determine the day of week */ + rtc_calc_weekday(tmp); /* Determine the day of week */ debug ("Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, @@ -180,8 +177,7 @@ int rtc_set (struct rtc_time *tmp) { ulong tim; - tim = mktime (tmp->tm_year, tmp->tm_mon, tmp->tm_mday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + tim = rtc_mktime(tmp); immap->im_sitk.sitk_rtck = KAPWR_KEY; immap->im_sit.sit_rtc = tim; @@ -439,5 +435,3 @@ static void rtc_write (unsigned char reg, unsigned char val) } #endif /* end of code exclusion (see #ifdef CONFIG_SXNI855T above) */ - -#endif