summaryrefslogtreecommitdiffstats
path: root/include/rtc.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-04-20 12:37:17 -0600
committerSimon Glass <sjg@chromium.org>2015-05-05 20:58:20 -0600
commit199e87c340bdd69a89e22f12e1201d67767e91a8 (patch)
treef7e7935465d4937cf550f49fde8d259d179b574c /include/rtc.h
parentc3ec646dde0428b96a67afd8c4c7b7db9dd4ca46 (diff)
downloadtalos-obmc-uboot-199e87c340bdd69a89e22f12e1201d67767e91a8.tar.gz
talos-obmc-uboot-199e87c340bdd69a89e22f12e1201d67767e91a8.zip
dm: rtc: Rename gregorian day function
Change this function name to something more descriptive. Also return a failure code if it cannot calculate a correct value. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include/rtc.h')
-rw-r--r--include/rtc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/rtc.h b/include/rtc.h
index 54e361ea5e..96c696ad65 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -45,7 +45,6 @@ int rtc_get (struct rtc_time *);
int rtc_set (struct rtc_time *);
void rtc_reset (void);
-void GregorianDay (struct rtc_time *);
void to_tm (int, struct rtc_time *);
unsigned long mktime (unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int);
@@ -87,4 +86,15 @@ void rtc_write32(int reg, u32 value);
*/
void rtc_init(void);
+/**
+ * rtc_calc_weekday() - Work out the weekday from a time
+ *
+ * This only works for the Gregorian calendar - i.e. after 1752 (in the UK).
+ * It sets time->tm_wdaay to the correct day of the week.
+ *
+ * @time: Time to inspect. tm_wday is updated
+ * @return 0 if OK, -EINVAL if the weekday could not be determined
+ */
+int rtc_calc_weekday(struct rtc_time *time);
+
#endif /* _RTC_H_ */
OpenPOWER on IntegriCloud