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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user