]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-bsp/linux/linux-omap/base/0023-RTC-add-support-for-backup-battery-recharge.patch
TI BSP: add support for the OMAP4430 pandaboard
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / base / 0023-RTC-add-support-for-backup-battery-recharge.patch
1 From 27f251ad46eeda205c220f89b4f9fbeaf930ae54 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <steve@sakoman.com>
3 Date: Thu, 4 Feb 2010 12:26:22 -0800
4 Subject: [PATCH 23/26] RTC: add support for backup battery recharge
6 ---
7  drivers/rtc/rtc-twl.c |   25 +++++++++++++++++++++++++
8  1 files changed, 25 insertions(+), 0 deletions(-)
10 diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
11 index ed1b868..33a8598 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 @@ -508,6 +525,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 -- 
54 1.6.6.1