rtc: pcf2127: add variant-specific configuration structure
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Thu, 22 Jun 2023 14:57:48 +0000 (10:57 -0400)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 27 Jul 2023 20:54:51 +0000 (22:54 +0200)
commitfd28ceb4603f9541dcb4ed12b1365cff5af38203
treefff00d00b14cc35387dd73484b21cf9d088aa97b
parent0476b6c8e8b1a6dfa3a259bc7e3c135145532c71
rtc: pcf2127: add variant-specific configuration structure

Create variant-specific configuration structures to simplify the
implementation of new variants into this driver. It will also avoid
to have too many tests for a specific variant, or a list of variants
for new devices, inside the code itself.

Add configuration options for the support of the NVMEM, bit CD0 in
register WD_CTL as well as the maximum number of registers for each
variant, instead of hardcoding the variant (PCF2127) inside the
i2c_device_id and spi_device_id structures.

Also specify a different maximum number of registers (max_register)
for the PCF2129.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20230622145800.2442116-6-hugo@hugovil.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf2127.c