chg: add narrow VDC power path support

Under NVDC, BGATE natively has a body diode. Hence there's a discharging
path if VSYS is lower than VBAT. This change keeps VSYS voltage when
turning off charging.

BRANCH=none
BUG=chrome-os-partner:46698
TEST=manual
  make buildall -j
  load on boards with isl9237 charger.
  charge the battery to full, and check charging voltage and current.

Change-Id: I8a6046444dd40a3b57f034be124b9e8fe281de40
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/309289
Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
Rong Chang
2015-10-28 18:02:23 +08:00
committed by chrome-bot
parent 41235ac25a
commit f9ffa951c1
8 changed files with 18 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#define CONFIG_CHARGER_ILIM_PIN_DISABLED
#define CONFIG_CHARGER_INPUT_CURRENT 512
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20

View File

@@ -30,6 +30,7 @@
#define CONFIG_CHARGER_ILIM_PIN_DISABLED
#define CONFIG_CHARGER_INPUT_CURRENT 512
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_CHARGER_PROFILE_OVERRIDE
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20

View File

@@ -32,6 +32,7 @@
#ifndef BOARD_KUNIMITSU_V3
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#endif
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_CHARGER_PSYS
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20

View File

@@ -25,6 +25,7 @@
#define CONFIG_CHARGER_INPUT_CURRENT 512
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_TRICKLE_CHARGING
/* PSYS register 8.25KOhm */
#define CHARGER_PSYS_REGISTER 8250

View File

@@ -30,6 +30,7 @@
#else
#define CONFIG_CHARGER_ISL9237
#define CONFIG_CHARGER_MAX_INPUT_CURRENT 2250
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
#endif /* BOARD_REV */

View File

@@ -28,6 +28,7 @@
#define CONFIG_CHARGER_ILIM_PIN_DISABLED
#define CONFIG_CHARGER_INPUT_CURRENT 512
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_NARROW_VDC
#define CONFIG_CHARGER_PROFILE_OVERRIDE
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20

View File

@@ -373,7 +373,16 @@ static int charge_request(int voltage, int current)
static int prev_volt, prev_curr;
if (!voltage || !current)
#ifdef CONFIG_CHARGER_NARROW_VDC
current = 0;
/* With NVDC charger, keep VSYS voltage higher than battery */
voltage = charger_closest_voltage(
curr.batt.voltage + charger_get_info()->voltage_step);
/* And handle dead battery case */
voltage = MAX(voltage, battery_get_info()->voltage_min);
#else
voltage = current = 0;
#endif
if (curr.ac) {
if (prev_volt != voltage || prev_curr != current)

View File

@@ -399,6 +399,9 @@
/* Minimum battery percentage for power on */
#undef CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
/* Narrow VDC power path */
#undef CONFIG_CHARGER_NARROW_VDC
/*
* Low energy thresholds - when battery level is below BAT_PCT and an external
* charger provides less than CHG_MW of power, inform the AP of the situation