linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v2 1/3] rtc: ds1307: Enable battery backup on RX8130
@ 2020-04-15 16:36 Bastian Krause
  2020-04-15 16:37 ` [PATCH 2/3] dt-bindings: rtc: add chargeable flag for rx8130 Bastian Krause
  2020-04-15 16:37 ` [PATCH 3/3] rtc: ds1307: make backup battery chargeable optionally Bastian Krause
  0 siblings, 2 replies; 10+ messages in thread
From: Bastian Krause @ 2020-04-15 16:36 UTC (permalink / raw)
  To: linux-rtc
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Arnaud Ebalard,
	Marek Vasut, devicetree, kernel, Bastian Krause

From: Marek Vasut <marex@denx.de>

The battery backup can be disabled on this RTC, e.g. if populated right
out of production. Force the battery backup bit on to enable it.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Bastian Krause <bst@pengutronix.de>
--
v2: Drop the custom offset, let regmap handle that
---
 drivers/rtc/rtc-ds1307.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 49702942bb08..5f0df60a71d1 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -122,6 +122,8 @@ enum ds_type {
 #define RX8130_REG_FLAG_AF		BIT(3)
 #define RX8130_REG_CONTROL0		0x1e
 #define RX8130_REG_CONTROL0_AIE		BIT(3)
+#define RX8130_REG_CONTROL1		0x1f
+#define RX8130_REG_CONTROL1_INIEN	BIT(4)
 
 #define MCP794XX_REG_CONTROL		0x07
 #	define MCP794XX_BIT_ALM0_EN	0x10
@@ -1875,6 +1877,11 @@ static int ds1307_probe(struct i2c_client *client,
 				     DS1307_REG_HOUR << 4 | 0x08, hour);
 		}
 		break;
+	case rx_8130:
+		/* make sure that the backup battery is enabled */
+		regmap_write(ds1307->regmap, RX8130_REG_CONTROL1,
+			     RX8130_REG_CONTROL1_INIEN);
+		break;
 	default:
 		break;
 	}
-- 
2.26.0.rc2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-02 19:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 16:36 [RESEND PATCH v2 1/3] rtc: ds1307: Enable battery backup on RX8130 Bastian Krause
2020-04-15 16:37 ` [PATCH 2/3] dt-bindings: rtc: add chargeable flag for rx8130 Bastian Krause
2020-04-15 16:44   ` Uwe Kleine-König
2020-04-15 18:56   ` Alexandre Belloni
2020-08-24 11:31     ` Bastian Krause
2020-08-24 13:32       ` Bastian Krause
2020-08-25 15:32         ` Alexandre Belloni
2020-08-26  8:13           ` Bastian Krause
2020-09-02 19:18             ` Alexandre Belloni
2020-04-15 16:37 ` [PATCH 3/3] rtc: ds1307: make backup battery chargeable optionally Bastian Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).