diff options
author | Rajagopala V <rajagopala.v@stericsson.com> | 2011-11-10 14:54:16 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:01:12 +0200 |
commit | 728cd2fbcc97cadca14c2848364ded2438971aa2 (patch) | |
tree | 7eb4e7b39b85c7a5a04c33e7dce05c8e02c6d6f2 | |
parent | 56df9125dba0d979cf7e692b5b5f193823ec2b97 (diff) |
power:ab5500-fg: Move battery threshold to plat data
Move battery low and over battery threshold to
platform data.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 372448
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I63127e9753a7ec946afc3261af4c1dad6523d7ad
Signed-off-by: Rajagopala V <rajagopala.v@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37269
Reviewed-by: QABUILD
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/board-u5500-bm.c | 3 | ||||
-rw-r--r-- | drivers/power/ab5500_fg.c | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/mach-ux500/board-u5500-bm.c b/arch/arm/mach-ux500/board-u5500-bm.c index fb181c2cb9a..1f54b0d1deb 100644 --- a/arch/arm/mach-ux500/board-u5500-bm.c +++ b/arch/arm/mach-ux500/board-u5500-bm.c @@ -437,7 +437,8 @@ static const struct abx500_fg_parameters fg = { .accu_charging = 30, .accu_high_curr = 30, .high_curr_threshold = 50, - .lowbat_threshold = 3100, + .lowbat_threshold = 3560, + .overbat_threshold = 4400, }; static const struct abx500_maxim_parameters maxi_params = { diff --git a/drivers/power/ab5500_fg.c b/drivers/power/ab5500_fg.c index c29d08bad17..ab481f53bc3 100644 --- a/drivers/power/ab5500_fg.c +++ b/drivers/power/ab5500_fg.c @@ -1565,8 +1565,8 @@ static int ab5500_fg_init_hw_registers(struct ab5500_fg *di) auto_ip->mux = MAIN_BAT_V; auto_ip->freq = MS500; - auto_ip->min = 3560; - auto_ip->max = 4500; + auto_ip->min = di->bat->fg_params->lowbat_threshold; + auto_ip->max = di->bat->fg_params->overbat_threshold; auto_ip->auto_adc_callback = ab5500_fg_bat_v_trig; di->gpadc_auto = auto_ip; ret = ab5500_gpadc_convert_auto(di->gpadc, di->gpadc_auto); @@ -1586,7 +1586,7 @@ static int ab5500_fg_bat_v_trig(int mux) di->vbat = ab5500_gpadc_convert(di->gpadc, MAIN_BAT_V); /* check if the battery voltage is below low threshold */ - if (di->vbat < 3560) { + if (di->vbat < di->bat->fg_params->lowbat_threshold) { dev_warn(di->dev, "Battery voltage is below LOW threshold\n"); di->flags.low_bat_delay = true; /* @@ -1598,7 +1598,7 @@ static int ab5500_fg_bat_v_trig(int mux) power_supply_changed(&di->fg_psy); } /* check if battery votlage is above OVV */ - else if (di->vbat > 4500) { + else if (di->vbat > di->bat->fg_params->overbat_threshold) { dev_warn(di->dev, "Battery OVV\n"); di->flags.bat_ovv = true; |