rtc: at91sam9: make use of syscon/regmap to access GPBR registers
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Tue, 23 Sep 2014 11:14:44 +0000 (13:14 +0200)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Thu, 13 Nov 2014 15:08:00 +0000 (16:08 +0100)
commit43e112bb3dea87f392871220fcde175c814e26ca
treebe9be4cd27b0354914d07fc060b56f41c2a23041
parent07d4d72450ef9bf317dff3d9f3bcad8d1f220f58
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>
drivers/rtc/Kconfig
drivers/rtc/rtc-at91sam9.c