summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-core.h
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-07-06 11:42:02 +0200
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-07-07 13:14:14 +0200
commit697e5a47aa12cdab6f2a8b284cc923cdf704eafc (patch)
tree3c2a9a02d436c6499896b7c9800a91c2e8185891 /drivers/rtc/rtc-core.h
parentrtc: at91rm9200: remove race condition (diff)
downloadlinux-697e5a47aa12cdab6f2a8b284cc923cdf704eafc.tar.xz
linux-697e5a47aa12cdab6f2a8b284cc923cdf704eafc.zip
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 'drivers/rtc/rtc-core.h')
-rw-r--r--drivers/rtc/rtc-core.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-core.h b/drivers/rtc/rtc-core.h
index 7a4ed2f7c7d7..ecab76a3207c 100644
--- a/drivers/rtc/rtc-core.h
+++ b/drivers/rtc/rtc-core.h
@@ -45,3 +45,11 @@ static inline const struct attribute_group **rtc_get_dev_attribute_groups(void)
return NULL;
}
#endif
+
+#ifdef CONFIG_RTC_NVMEM
+void rtc_nvmem_register(struct rtc_device *rtc);
+void rtc_nvmem_unregister(struct rtc_device *rtc);
+#else
+static inline void rtc_nvmem_register(struct rtc_device *rtc) {}
+static inline void rtc_nvmem_unregister(struct rtc_device *rtc) {}
+#endif