blob: 6d562f76b068969c3274504783c559b36641e1ef [file] [log] [blame]
Angel Pons32859fc2020-04-02 23:48:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Marc Jones3cc685f2014-12-29 21:31:44 -07002
3#ifndef _RTC_H_
4#define _RTC_H_
5
Lee Leahy6625ecc2017-03-07 15:11:07 -08006struct rtc_time {
Marc Jones3cc685f2014-12-29 21:31:44 -07007 int sec;
8 int min;
9 int hour;
10 int mday;
11 int mon;
12 int year;
13 int wday;
14};
15
Simon Glass2cf99e12016-06-10 20:58:24 -060016/* Implemented by the RTC driver (there can be only one) */
Gabe Black03abaee212014-04-30 21:31:44 -070017int rtc_set(const struct rtc_time *time);
18int rtc_get(struct rtc_time *time);
Marc Jones3cc685f2014-12-29 21:31:44 -070019
Simon Glass2cf99e12016-06-10 20:58:24 -060020/* Common functions */
21int rtc_to_tm(int tim, struct rtc_time *tm);
22unsigned long rtc_mktime(const struct rtc_time *tm);
23void rtc_display(const struct rtc_time *tm);
Werner Zeh1724b742021-05-25 14:19:50 +020024int rtc_invalid(const struct rtc_time *tm);
Simon Glass2cf99e12016-06-10 20:58:24 -060025
Marc Jones3cc685f2014-12-29 21:31:44 -070026#endif /* _RTC_H_ */