summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Palsson <johan.palsson@stericsson.com>2011-01-20 14:23:05 +0100
committerMichael BRANDT <michael.brandt@stericsson.com>2011-01-20 15:23:41 +0100
commitb4f340af5537094fc72076b8e9de9b27e1c35b20 (patch)
tree0bf0789d92201f2a906186af887857a9236e68b6
parent209e97ea3f7b97bde1d1b5e7cbbf90f57416c01b (diff)
U8500: Lower cut-off voltage threshold in AB8500
The cut-off voltage for AB8500 is set too high in the OTP. To be able to start with a charger from a drained battery, we have to lower this threshold before the backlight and display is started. ST-Ericsson ID: ER320113 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ia5c8c5b749fa9cb9cf8a15072ddfe5b0d1f33f5f Signed-off-by: Johan Palsson <johan.palsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13028 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
-rw-r--r--board/st/u8500/u8500.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/board/st/u8500/u8500.c b/board/st/u8500/u8500.c
index 621a168d6..8b4609bf5 100644
--- a/board/st/u8500/u8500.c
+++ b/board/st/u8500/u8500.c
@@ -297,17 +297,42 @@ static void probe_href(void)
}
+#define BATT_OK_SEL1_TH_F_MASK 0xF0
+#define BATT_OK_SEL1_TH_F_2V71 0x70
+
/*
* board_early_access - for functionality that needs to run before
* board_late_init but after board_init and emmc init.
*/
int board_early_access(block_dev_desc_t *block_dev)
{
+ int ret;
+ int battok_regval;
/* set board_id according to HREF version */
probe_href();
/*
+ * In AB8500 rev2.0, the cut-off voltage threshold is set too low
+ * and the AB will power-off when we start with a drained battery
+ * and a charger connected when the backlight is turned on.
+ * Here we will lower the cut-off voltage threshold before
+ * power consumption goes up
+ */
+ ret = ab8500_read(AB8500_SYS_CTRL2_BLOCK, AB8500_BATT_OK_REG);
+ if (ret < 0)
+ return -EINVAL;
+
+ battok_regval = ret;
+
+ /* Mask and set BattOkSel1ThF */
+ ret = ab8500_write(AB8500_SYS_CTRL2_BLOCK, AB8500_BATT_OK_REG,
+ (battok_regval & ~BATT_OK_SEL1_TH_F_MASK) |
+ BATT_OK_SEL1_TH_F_2V71);
+ if (ret < 0)
+ return -EINVAL;
+
+ /*
* Don't load itp, modem and splash if restarted (eg crashdump).
*/
if (!(data_init_flag > 0)) {