mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
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:
parent
735ae2056b
commit
697e5a47aa
7 changed files with 143 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue