rtc: at91sam9: make use of syscon/regmap to access GPBR registers
The GPBR registers are not part of the RTT block and thus should not be
defined in the reg property of the rtt node.
Use syscon to provide a proper DT representation and reference the GPBR
syscon device in a new "atmel,rtt-rtc-time-reg" property which store both
the syscon device phandle and the register offset within the GPBR block.
When using non DT boards, we won't be able to retrieve the syscon regmap,
hence we need to create our own regmap using the memory region defined
in the 2nd memory resource assigned to the RTT platform device.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 94ae179..7b1f592 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1111,6 +1111,7 @@
config RTC_DRV_AT91SAM9
tristate "AT91SAM9x/AT91CAP9 RTT as RTC"
depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
+ select MFD_SYSCON
help
RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT
(Real Time Timer). These timers are powered by the backup power