Linux-RTC Archive on
 help / color / Atom feed
* [PATCH V2] rtc: ds1307: Enable battery backup on RX8130
@ 2019-09-05 13:03 Marek Vasut
  0 siblings, 0 replies; only message in thread
From: Marek Vasut @ 2019-09-05 13:03 UTC (permalink / raw)
  To: linux-rtc; +Cc: Marek Vasut, Arnaud Ebalard, Alexandre Belloni, Bastian Krause

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 <>
Cc: Arnaud Ebalard <>
Cc: Alexandre Belloni <>
Cc: Bastian Krause <>
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 1f7e8aefc1eb..f2d1e59478c2 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -121,6 +121,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
@@ -1750,6 +1752,11 @@ static int ds1307_probe(struct i2c_client *client,
 				     DS1307_REG_HOUR << 4 | 0x08, hour);
+	case rx_8130:
+		/* make sure that the backup battery is enabled */
+		regmap_write(ds1307->regmap, RX8130_REG_CONTROL1,
+			     RX8130_REG_CONTROL1_INIEN);
+		break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 13:03 [PATCH V2] rtc: ds1307: Enable battery backup on RX8130 Marek Vasut

Linux-RTC Archive on

Archives are clonable:
	git clone --mirror linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ \
	public-inbox-index linux-rtc

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox