[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250526161234.13236-1-giampiero@sferalabs.cc>
Date: Mon, 26 May 2025 18:12:34 +0200
From: Giampiero Baggiani <giampiero@...ralabs.cc>
To: alexandre.belloni@...tlin.com
Cc: Giampiero Baggiani <giampiero@...ralabs.cc>,
linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] rtc: pcf2127: align power management configuration
The PCF2131 comes with the following default settings:
- battery switch-over function is disabled;
- battery low detection function is disabled.
These defaults differ from those of other models supported by this driver.
This commit aligns the behavior across all supported models, configuring
them to the settings typically expected from an RTC.
Signed-off-by: Giampiero Baggiani <giampiero@...ralabs.cc>
---
drivers/rtc/rtc-pcf2127.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index 31c7dca8f469..cbdf7f23e6a6 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -1312,8 +1312,15 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
* Clear battery interrupt flags which can block new trigger events.
* Note: This is the default chip behaviour but added to ensure
* correct tamper timestamp and interrupt function.
+ *
+ * Power management functions set to:
+ * - battery switch-over function is enabled in standard mode;
+ * - battery low detection function is enabled;
+ * - extra power fail detection function is enabled.
+ * Note: This is the default configuration except for pcf2131.
*/
ret = regmap_update_bits(pcf2127->regmap, PCF2127_REG_CTRL3,
+ PCF2127_CTRL3_PM |
PCF2127_BIT_CTRL3_BTSE |
PCF2127_BIT_CTRL3_BIE |
PCF2127_BIT_CTRL3_BLIE, 0);
--
2.39.2 (Apple Git-143)
Powered by blists - more mailing lists