summaryrefslogtreecommitdiff
path: root/include/rtc.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-01-09 11:30:08 -0500
committerTom Rini <trini@konsulko.com>2023-01-09 11:30:08 -0500
commitcebdfc22da6eb81793b616e855bc4d6d89c1c7a6 (patch)
tree44eaafcbe4866712d361304882e7d56ca0ef1682 /include/rtc.h
parent62e2ad1ceafbfdf2c44d3dc1b6efc81e768a96b9 (diff)
parentfe33066d246462551f385f204690a11018336ac8 (diff)
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/rtc.h')
-rw-r--r--include/rtc.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/include/rtc.h b/include/rtc.h
index 10104e3bf5a..b6fdbb60dc2 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -15,13 +15,12 @@
#include <bcd.h>
#include <rtc_def.h>
+#include <linux/errno.h>
typedef int64_t time64_t;
-
-#ifdef CONFIG_DM_RTC
-
struct udevice;
+#if CONFIG_IS_ENABLED(DM_RTC)
struct rtc_ops {
/**
* get() - get the current time
@@ -222,6 +221,33 @@ int rtc_enable_32khz_output(int busnum, int chip_addr);
#endif
#else
+static inline int dm_rtc_get(struct udevice *dev, struct rtc_time *time)
+{
+ return -ENOSYS;
+}
+
+static inline int dm_rtc_set(struct udevice *dev, struct rtc_time *time)
+{
+ return -ENOSYS;
+}
+
+static inline int dm_rtc_reset(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int dm_rtc_read(struct udevice *dev, unsigned int reg, u8 *buf,
+ unsigned int len)
+{
+ return -ENOSYS;
+}
+
+static inline int dm_rtc_write(struct udevice *dev, unsigned int reg,
+ const u8 *buf, unsigned int len)
+{
+ return -ENOSYS;
+}
+
int rtc_get (struct rtc_time *);
int rtc_set (struct rtc_time *);
void rtc_reset (void);