diff options
author | Bruce <Bruce.Wan@quantatw.com> | 2016-12-08 11:06:47 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-12-08 16:38:32 -0800 |
commit | b65e2a895a0622ed323033c9c710a4044b71e869 (patch) | |
tree | 9f877d3b3c2e241ba11adb5027697e84268fa3c1 | |
parent | a0f1cda90197bad78a98dfbe288779378327c690 (diff) | |
download | chrome-ec-b65e2a895a0622ed323033c9c710a4044b71e869.tar.gz |
pyro/snappy: BD9995X: Suspend DC-DC converter when discharging on AC
When the battery is fully charged or not charging, upon removal of
the AC, discharge takes long time. To overcome this issue suspend
the DC-DC converter when discharging on AC.
(Refers Reef CL:413153)
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: Iebfcb95d0469be552283d17eb1aea0310eccbcb9
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/417428
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | board/pyro/battery.c | 26 | ||||
-rw-r--r-- | board/snappy/battery.c | 26 |
2 files changed, 50 insertions, 2 deletions
diff --git a/board/pyro/battery.c b/board/pyro/battery.c index 1b816cadd1..a87c514f51 100644 --- a/board/pyro/battery.c +++ b/board/pyro/battery.c @@ -231,8 +231,32 @@ int charger_profile_override(struct charge_state_data *curr) /* Current and previous battery voltage */ int batt_voltage; static int prev_batt_voltage; + int disch_on_ac; - charger_discharge_on_ac(!(curr->batt.flags & BATT_FLAG_WANT_CHARGE)); + /* + * In light load (<450mA being withdrawn from VSYS) the DCDC of the + * charger operates intermittently i.e. DCDC switches continuously + * and then stops to regulate the output voltage and current, and + * sometimes to prevent reverse current from flowing to the input. + * This causes a slight voltage ripple on VSYS that falls in the + * audible noise frequency (single digit kHz range). This small + * ripple generates audible noise in the output ceramic capacitors + * (caps on VSYS and any input of DCDC under VSYS). + * + * To overcome this issue enable the battery learning operation + * and suspend USB charging and DC/DC converter. + */ + disch_on_ac = curr->batt.is_present == BP_YES && + !battery_is_cut_off() && + !(curr->batt.flags & BATT_FLAG_WANT_CHARGE) && + curr->batt.status & STATUS_FULLY_CHARGED; + + charger_discharge_on_ac(disch_on_ac); + + if (disch_on_ac) { + curr->state = ST_DISCHARGE; + return 0; + } /* * Determine temperature range. The five ranges are: diff --git a/board/snappy/battery.c b/board/snappy/battery.c index 4abdff5534..5ba4c0ac28 100644 --- a/board/snappy/battery.c +++ b/board/snappy/battery.c @@ -159,8 +159,32 @@ int charger_profile_override(struct charge_state_data *curr) /* Current and previous battery voltage */ int batt_voltage; static int prev_batt_voltage; + int disch_on_ac; - charger_discharge_on_ac(!(curr->batt.flags & BATT_FLAG_WANT_CHARGE)); + /* + * In light load (<450mA being withdrawn from VSYS) the DCDC of the + * charger operates intermittently i.e. DCDC switches continuously + * and then stops to regulate the output voltage and current, and + * sometimes to prevent reverse current from flowing to the input. + * This causes a slight voltage ripple on VSYS that falls in the + * audible noise frequency (single digit kHz range). This small + * ripple generates audible noise in the output ceramic capacitors + * (caps on VSYS and any input of DCDC under VSYS). + * + * To overcome this issue enable the battery learning operation + * and suspend USB charging and DC/DC converter. + */ + disch_on_ac = curr->batt.is_present == BP_YES && + !battery_is_cut_off() && + !(curr->batt.flags & BATT_FLAG_WANT_CHARGE) && + curr->batt.status & STATUS_FULLY_CHARGED; + + charger_discharge_on_ac(disch_on_ac); + + if (disch_on_ac) { + curr->state = ST_DISCHARGE; + return 0; + } /* * Determine temperature range. The five ranges are: |