summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
new file mode 100644
index 00000000..cb685cc2
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
@@ -0,0 +1,55 @@
1From 6f432e1e39f276a41d600d1cc9cd17fc088877d8 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 4 Feb 2010 12:26:22 -0800
4Subject: [PATCH 16/32] RTC: add support for backup battery recharge
5
6---
7 drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
8 1 files changed, 25 insertions(+), 0 deletions(-)
9
10diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
11index f9a2799..713b8ea 100644
12--- a/drivers/rtc/rtc-twl.c
13+++ b/drivers/rtc/rtc-twl.c
14@@ -30,6 +30,23 @@
15
16 #include <linux/i2c/twl.h>
17
18+/*
19+ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER)
20+ */
21+#define REG_BB_CFG 0x12
22+
23+/* PM_RECEIVER BB_CFG bitfields */
24+#define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10
25+#define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C
26+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00
27+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04
28+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08
29+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c
30+#define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03
31+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00
32+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01
33+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02
34+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03
35
36 /*
37 * RTC block register offsets (use TWL_MODULE_RTC)
38@@ -495,6 +512,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
39 if (ret < 0)
40 goto out2;
41
42+ /* enable backup battery charging */
43+ /* use a conservative 25uA @ 3.1V */
44+ ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
45+ BIT_PM_RECEIVER_BB_CFG_BBCHEN |
46+ BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
47+ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
48+ REG_BB_CFG);
49+
50 return ret;
51
52 out2:
53--
541.6.6.1
55