mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 09:31:51 +00:00
driver/charger/isl923x: Make sure CONFIG_CHARGER_NARROW_VDC is set
Without this, the battery will discharge if we disallow battery charging (e.g. calling charge_request with either voltage == 0 or current == 0, either by policy, or when the battery is full). Also update config.h to set the option whenever isl923x is used. BRANCH=none BUG=b:66575472 BUG=b:35585464 TEST=make buildall -j Change-Id: Id5515d5ea82a393a3693a3da44cbdc2778296a95 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/856538 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
1caa2788c5
commit
31e68a035b
@@ -32,7 +32,6 @@
|
||||
#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
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#define CONFIG_CHARGE_RAMP_HW
|
||||
#define CONFIG_CHARGER_ISL9237
|
||||
#define CONFIG_CHARGER_MAX_INPUT_CURRENT 3000
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#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
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
#define CONFIG_CHARGER_INPUT_CURRENT 512
|
||||
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 2
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#define CONFIG_CHARGER_PROFILE_OVERRIDE
|
||||
#define CONFIG_CHARGER_PSYS
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
#define CONFIG_CHARGER_INPUT_CURRENT 512
|
||||
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 2
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#define CONFIG_CHARGER_PROFILE_OVERRIDE
|
||||
#define CONFIG_CHARGER_PSYS
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#define CONFIG_CHARGE_RAMP_HW
|
||||
#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 */
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
#define CONFIG_CHARGER_INPUT_CURRENT 512
|
||||
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 2
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#define CONFIG_CHARGER_PSYS
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#define CONFIG_CHARGE_RAMP_HW
|
||||
#define CONFIG_CHARGER_ISL9237
|
||||
#define CONFIG_CHARGER_MAX_INPUT_CURRENT 3000
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#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
|
||||
|
||||
@@ -546,7 +546,11 @@ static int charge_request(int voltage, int current)
|
||||
if (!voltage || !current) {
|
||||
#ifdef CONFIG_CHARGER_NARROW_VDC
|
||||
current = 0;
|
||||
/* With NVDC charger, keep VSYS voltage higher than battery */
|
||||
/*
|
||||
* With NVDC charger, keep VSYS voltage higher than battery,
|
||||
* otherwise the BGATE FET body diode would conduct and
|
||||
* discharge the battery.
|
||||
*/
|
||||
voltage = charger_closest_voltage(
|
||||
curr.batt.voltage + charger_get_info()->voltage_step);
|
||||
/* If the battery is full, request the max voltage. */
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#include "timer.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef CONFIG_CHARGER_NARROW_VDC
|
||||
#error "ISL9237/8 is a NVDC charger, please enable CONFIG_CHARGER_NARROW_VDC."
|
||||
#endif
|
||||
|
||||
#define DEFAULT_R_AC 20
|
||||
#define DEFAULT_R_SNS 10
|
||||
#define R_AC CONFIG_CHARGER_SENSE_RESISTOR_AC
|
||||
|
||||
@@ -584,7 +584,7 @@
|
||||
/* Minimum battery percentage for power on */
|
||||
#undef CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
|
||||
|
||||
/* Narrow VDC power path */
|
||||
/* Set this option when using a Narrow VDC (NVDC) charger, such as ISL9237/8. */
|
||||
#undef CONFIG_CHARGER_NARROW_VDC
|
||||
|
||||
/*
|
||||
@@ -3216,6 +3216,15 @@
|
||||
#define CONFIG_USB_PD_VBUS_MEASURE_CHARGER
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* Define CONFIG_CHARGER_NARROW_VDC for chargers that use a Narrow VDC power
|
||||
* architecture.
|
||||
*/
|
||||
#if defined(CONFIG_CHARGER_ISL9237) || defined(CONFIG_CHARGER_ISL9238)
|
||||
#define CONFIG_CHARGER_NARROW_VDC
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* Define CONFIG_BUTTON_TRIGGERED_RECOVERY if a board has a dedicated recovery
|
||||
|
||||
Reference in New Issue
Block a user