3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
9 * Generic RTC interface.
14 /* bcd<->bin functions are needed by almost all the RTC drivers, let's include
15 * it there instead of in evey single driver */
20 * The struct used to pass data from the generic interface code to
21 * the hardware dependend low-level code ande vice versa. Identical
22 * to struct rtc_time used by the Linux kernel.
24 * Note that there are small but significant differences to the
25 * common "struct time":
27 * struct time: struct rtc_time:
28 * tm_mon 0 ... 11 1 ... 12
29 * tm_year years since 1900 years since 0
44 int rtc_get (struct rtc_time *);
45 int rtc_set (struct rtc_time *);
46 void rtc_reset (void);
48 void GregorianDay (struct rtc_time *);
49 void to_tm (int, struct rtc_time *);
50 unsigned long mktime (unsigned int, unsigned int, unsigned int,
51 unsigned int, unsigned int, unsigned int);
54 * rtc_read8() - Read an 8-bit register
56 * @reg: Register to read
59 int rtc_read8(int reg);
62 * rtc_write8() - Write an 8-bit register
64 * @reg: Register to write
65 * @value: Value to write
67 void rtc_write8(int reg, uchar val);
70 * rtc_read32() - Read a 32-bit value from the RTC
72 * @reg: Offset to start reading from
75 u32 rtc_read32(int reg);
78 * rtc_write32() - Write a 32-bit value to the RTC
80 * @reg: Register to start writing to
81 * @value: Value to write
83 void rtc_write32(int reg, u32 value);
86 * rtc_init() - Set up the real time clock ready for use