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 --- Changes for v2: - explicitly mentioned SPI --- drivers/rtc/rtc-pcf2127.c | 5 +++++ 1 file changed, 5 insertions(+)
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);
Replace comma with semicolon at the end of the statement when setting config.max_register.
Fixes: fd28ceb4603f ("rtc: pcf2127: add variant-specific configuration structure") Cc: stable@vger.kernel.org Cc: Elena Popa elena.popa@nxp.com Signed-off-by: Hugo Villeneuve hvilleneuve@dimonoff.com --- drivers/rtc/rtc-pcf2127.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 2c7917bc2a31..2e1ac0c42e93 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c @@ -1543,7 +1543,7 @@ static int pcf2127_spi_probe(struct spi_device *spi) config.write_flag_mask = 0x0; }
- config.max_register = variant->max_register, + config.max_register = variant->max_register;
regmap = devm_regmap_init_spi(spi, &config); if (IS_ERR(regmap)) {
Hi,
Any news on the integration of these 2 patches? rtc: pcf2127: add missing semicolon after statement rtc: pcf2127: fix SPI command byte for PCF2131
-----Original Message----- From: Elena Popa elena.popa@nxp.com Sent: Friday, May 30, 2025 1:40 PM To: alexandre.belloni@bootlin.com; hvilleneuve@dimonoff.com; r.cerrato@til-technologies.fr Cc: linux-rtc@vger.kernel.org; Elena Popa elena.popa@nxp.com; stable@vger.kernel.org Subject: [PATCH v2 2/2] rtc: pcf2127: add missing semicolon after statement
Replace comma with semicolon at the end of the statement when setting config.max_register.
Fixes: fd28ceb4603f ("rtc: pcf2127: add variant-specific configuration structure") Cc: stable@vger.kernel.org Cc: Elena Popa elena.popa@nxp.com Signed-off-by: Hugo Villeneuve hvilleneuve@dimonoff.com
drivers/rtc/rtc-pcf2127.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 2c7917bc2a31..2e1ac0c42e93 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c @@ -1543,7 +1543,7 @@ static int pcf2127_spi_probe(struct spi_device *spi) config.write_flag_mask = 0x0; }
- config.max_register = variant->max_register,
config.max_register = variant->max_register;
regmap = devm_regmap_init_spi(spi, &config); if (IS_ERR(regmap)) {
-- 2.34.1
On Fri, 30 May 2025 13:40:00 +0300, Elena Popa wrote:
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.
Applied, thanks!
[1/2] rtc: pcf2127: fix SPI command byte for PCF2131 https://git.kernel.org/abelloni/c/fa78e9b606a4
Best regards,
linux-stable-mirror@lists.linaro.org