summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/nvmem.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: nvmem: don't use IS_ERR_OR_NULLUwe Kleine-König2018-05-211-1/+1
| | | | | | | nvmem_register() never returns NULL, so IS_ERR is good enough here. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: export rtc_nvmem_register() to driversAlexandre Belloni2018-03-011-2/+1
| | | | | | | Export rtc_nvmem_register() so it can be called from drivers instead of only the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: nvmem: allow registering the nvmem device before the rtcAlexandre Belloni2018-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Switch the parent of the nvmem device to the parent of the rtc device so it can be registered before the RTC. This is a small change in the ABI as the nvmem moves out of the /sys/class/rtc/rtcX folder to be under the parent device folder (that is where the previous nvram files where registered). However, it is still available under its correct location, /sys/bus/nvmem/devices which is the one that should be used by userspace applications. The other benefit is that the nvmem device can stay registered even if the rtc registration fails. Or it is possible to not register the rtc if the nvmem registration failed. Finally, it makes a lot of sense for devices that actually have different i2c or spi addresses for the RTC and the EEPROM. That is basically how it would end up when using MFD or even completely separate devices. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: nvmem: disallow registering nvmem more than onceAlexandre Belloni2018-02-141-0/+3
| | | | | | | Make rtc_nvmem_register return -EBUSY when an nvmem is already registered for that RTC. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: nvmem: return error valuesAlexandre Belloni2018-02-141-4/+6
| | | | | | | In case of error, make rtc_nvmem_register() able to return an error value to its caller. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: nvmem: pass nvmem_config to rtc_nvmem_register()Alexandre Belloni2018-02-141-8/+9
| | | | | | | To be able to remove nvmem_config from struct rtc_device, pass it as a parameter to rtc_nvmem_register. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: add generic nvmem supportAlexandre Belloni2017-07-071-0/+113
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>
OpenPOWER on IntegriCloud