aboutsummaryrefslogtreecommitdiff
path: root/include/linux/rtc.h
diff options
context:
space:
mode:
authorAlexandre Belloni2017-07-06 11:42:02 +0200
committerAlexandre Belloni2017-07-07 13:14:14 +0200
commit697e5a47aa12cdab6f2a8b284cc923cdf704eafc (patch)
tree3c2a9a02d436c6499896b7c9800a91c2e8185891 /include/linux/rtc.h
parent735ae2056b3c7296bb188d079c020f606a679c4a (diff)
rtc: add generic nvmem support
Many RTCs have an on board non volatile storage. It can be battery backed RAM or an EEPROM. Use the nvmem subsystem to export it to both userspace and in-kernel consumers. This stays compatible with the previous (non documented) ABI that was using /sys/class/rtc/rtcx/device/nvram to export that memory. But will warn about the deprecation. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'include/linux/rtc.h')
-rw-r--r--include/linux/rtc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 8e4a5f44f59e..d53ecdc060cf 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/interrupt.h>
+#include <linux/nvmem-provider.h>
#include <uapi/linux/rtc.h>
extern int rtc_month_days(unsigned int month, unsigned int year);
@@ -144,6 +145,12 @@ struct rtc_device {
bool registered;
+ struct nvmem_config *nvmem_config;
+ struct nvmem_device *nvmem;
+ /* Old ABI support */
+ bool nvram_old_abi;
+ struct bin_attribute *nvram;
+
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
struct work_struct uie_task;
struct timer_list uie_timer;