diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-07-06 11:42:02 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-07-07 13:14:14 +0200 |
commit | 697e5a47aa12cdab6f2a8b284cc923cdf704eafc (patch) | |
tree | 3c2a9a02d436c6499896b7c9800a91c2e8185891 /drivers/rtc/rtc-core.h | |
parent | rtc: at91rm9200: remove race condition (diff) | |
download | linux-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.h | 8 |
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 |