summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Popa <elena.popa@nxp.com>2025-05-30 13:40:00 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2025-06-24 17:04:42 +0300
commitfa78e9b606a472495ef5b6b3d8b45c37f7727f9d (patch)
tree9494ef6d768687a82ac91cbd34832bb5f383479f
parent00a39d8652ff9088de07a6fe6e9e1893452fe0dd (diff)
downloadlinux-fa78e9b606a472495ef5b6b3d8b45c37f7727f9d.tar.xz
rtc: pcf2127: fix SPI command byte for PCF2131
PCF2131 was not responding to read/write operations using SPI. PCF2131 has a different command byte definition, compared to PCF2127/29. Added the new command byte definition when PCF2131 is detected. Fixes: afc505bf9039 ("rtc: pcf2127: add support for PCF2131 RTC") Cc: stable@vger.kernel.org Signed-off-by: Elena Popa <elena.popa@nxp.com> Acked-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20250530104001.957977-1-elena.popa@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/rtc-pcf2127.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index 31c7dca8f469..2c7917bc2a31 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -1538,6 +1538,11 @@ static int pcf2127_spi_probe(struct spi_device *spi)
variant = &pcf21xx_cfg[type];
}
+ if (variant->type == PCF2131) {
+ config.read_flag_mask = 0x0;
+ config.write_flag_mask = 0x0;
+ }
+
config.max_register = variant->max_register,
regmap = devm_regmap_init_spi(spi, &config);