]> git.itanic.dy.fi Git - linux-stable/commit
rtc: abx80x: Add nvmem support
authorSean Anderson <sean.anderson@seco.com>
Thu, 22 Dec 2022 21:45:31 +0000 (16:45 -0500)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 23 Feb 2023 23:02:30 +0000 (00:02 +0100)
commite90ff8ede777b98b44611b416b1ae6be94258335
treecc7345663666ddbc8a033c9a5d9a08da3c37952e
parent38892c48e54760be41f16519456d868e14933789
rtc: abx80x: Add nvmem support

This adds support for the 256-byte internal RAM. There are two windows
which can be used to access this RAM: 64 bytes at 0x40 (the "standard"
address space) and 128 bytes at 0x80 (the "alternate" address space). We
use the standard address space because it is also accessible over SPI
(if such a port is ever done). We are limited to 32-byte reads for SMBus
compatibility, so there's no advantage to using the alternate address
space.

There are some reserved bits in the EXTRAM register, and the datasheet
doesn't say what to do with them. I've opted to skip a read/modify/write
and just write the whole thing. If this driver is ever converted to
regmap, this would be a good place to use regmap_update_bits.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20221222214532.1873718-1-sean.anderson@seco.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-abx80x.c