Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Marc Jones | 3cc685f | 2014-12-29 21:31:44 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef _RTC_H_ |
| 4 | #define _RTC_H_ |
| 5 | |
Lee Leahy | 6625ecc | 2017-03-07 15:11:07 -0800 | [diff] [blame] | 6 | struct rtc_time { |
Marc Jones | 3cc685f | 2014-12-29 21:31:44 -0700 | [diff] [blame] | 7 | int sec; |
| 8 | int min; |
| 9 | int hour; |
| 10 | int mday; |
| 11 | int mon; |
| 12 | int year; |
| 13 | int wday; |
| 14 | }; |
| 15 | |
Simon Glass | 2cf99e1 | 2016-06-10 20:58:24 -0600 | [diff] [blame] | 16 | /* Implemented by the RTC driver (there can be only one) */ |
Gabe Black | 03abaee21 | 2014-04-30 21:31:44 -0700 | [diff] [blame] | 17 | int rtc_set(const struct rtc_time *time); |
| 18 | int rtc_get(struct rtc_time *time); |
Marc Jones | 3cc685f | 2014-12-29 21:31:44 -0700 | [diff] [blame] | 19 | |
Simon Glass | 2cf99e1 | 2016-06-10 20:58:24 -0600 | [diff] [blame] | 20 | /* Common functions */ |
| 21 | int rtc_to_tm(int tim, struct rtc_time *tm); |
| 22 | unsigned long rtc_mktime(const struct rtc_time *tm); |
| 23 | void rtc_display(const struct rtc_time *tm); |
Werner Zeh | 1724b74 | 2021-05-25 14:19:50 +0200 | [diff] [blame] | 24 | int rtc_invalid(const struct rtc_time *tm); |
Simon Glass | 2cf99e1 | 2016-06-10 20:58:24 -0600 | [diff] [blame] | 25 | |
Marc Jones | 3cc685f | 2014-12-29 21:31:44 -0700 | [diff] [blame] | 26 | #endif /* _RTC_H_ */ |