isl9238: Don't reread PROG pin or reload ILIM.

The ISL9238 has a functionality where it will reload the adapter current
limit from a strap which is read from the PROG pin.  This is problematic
when we decide to set the current limit prior to AC actually being
inserted.  This commit disables this functionality from the charger.

It seems however that the charger will read the PROG pin and reload the
ILIM at least once before respecting the bits.

BUG=b:67120928, b:66017697
BRANCH=None
TEST=Plug and unplug and then plug again AC.  Verify that the default
current limit is not set by the charger automatically.

Change-Id: Ia8e8742843f6ceb286635b31e0fe5c070a2b6dfe
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/759693
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Shamile Khan <shamile.khan@intel.corp-partner.google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Aseda Aboagye
2017-11-06 17:12:58 -08:00
committed by chrome-bot
parent adf00a969f
commit 358e249916
2 changed files with 24 additions and 0 deletions

View File

@@ -339,6 +339,24 @@ static void isl923x_init(void)
goto init_fail;
#endif /* defined(CONFIG_CHARGE_RAMP_HW) */
#ifdef CONFIG_CHARGER_ISL9238
/*
* Don't reread the prog pin and don't reload the ILIM on ACIN.
*/
if (raw_read16(ISL9238_REG_CONTROL3, &reg))
goto init_fail;
reg |= ISL9238_C3_NO_RELOAD_ACLIM_ON_ACIN |
ISL9238_C3_NO_REREAD_PROG_PIN;
if (raw_write16(ISL9238_REG_CONTROL3, reg))
goto init_fail;
/*
* Initialize the input current limit to the board's default.
*/
if (charger_set_input_current(CONFIG_CHARGER_INPUT_CURRENT))
goto init_fail;
#endif /* defined(CONFIG_CHARGER_ISL9238) */
return;
init_fail:
CPRINTF("isl923x_init failed!");

View File

@@ -210,6 +210,12 @@
/* Control3: PSYS gain in uA/W (ISL9238 only) */
#define ISL9238_C3_PSYS_GAIN (1 << 9)
/* Control3: Don't reload ACLIM on ACIN. */
#define ISL9238_C3_NO_RELOAD_ACLIM_ON_ACIN (1 << 14)
/* Control3: Don't reread PROG pin. */
#define ISL9238_C3_NO_REREAD_PROG_PIN (1 << 15)
/* OTG voltage limit in mV, current limit in mA */
#define ISL9237_OTG_VOLTAGE_MIN 4864
#define ISL9237_OTG_VOLTAGE_MAX 5376