From 2737321ecda82335bada3aa4d6530de83a8985bb Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Mon, 26 Jan 2015 09:21:16 -0800 Subject: [PATCH] bq24773: turn off prochot warning Turn off prochot warning on bq24773 by default because our battery can always supply enough power for the whole system so we don't need to throttle the CPU if the BQ senses too much input current. BUG=chrome-os-partner:34885 BRANCH=samus TEST=force BQ into it's prochot condition on samus by setting the charging voltage temporarily below the battery voltage, which causes INA to turn off and the BQ to think IADP is > 4.1A. in this condition PROCHOT is normally asserted and CPU slows down, but with this patch PROCHOT is not asserted and the CPU does not slow down. Change-Id: I658dbe568b7bfe94944ef90d6d59656a0683c8a0 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/243231 Reviewed-by: Duncan Laurie Reviewed-by: Sameer Nanda --- driver/charger/bq24773.c | 4 ++++ driver/charger/bq24773.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/driver/charger/bq24773.c b/driver/charger/bq24773.c index 45faff9d23..fc5e7c688c 100644 --- a/driver/charger/bq24773.c +++ b/driver/charger/bq24773.c @@ -184,6 +184,10 @@ int charger_post_init(void) if (rv) return rv; + /* Turn off PROCHOT warning */ + rv = i2c_write8(I2C_PORT_CHARGER, BQ24773_ADDR, + BQ24773_PROCHOT_OPTION1, 0); + #ifdef CONFIG_CHARGER_ILIM_PIN_DISABLED /* Read the external ILIM pin enabled flag. */ rv = i2c_read16(I2C_PORT_CHARGER, BQ24773_ADDR, diff --git a/driver/charger/bq24773.h b/driver/charger/bq24773.h index 0e762624a8..d4e167ca7a 100644 --- a/driver/charger/bq24773.h +++ b/driver/charger/bq24773.h @@ -14,9 +14,9 @@ /* Chip specific commands */ #define BQ24773_CHARGE_OPTION0 0x00 #define BQ24773_CHARGE_OPTION1 0x02 -#define BQ24773_PROTECT_OPTION0 0x04 -#define BQ24773_PROTECT_OPTION1 0x06 -#define BQ24773_PROTECT_STATUS 0x08 +#define BQ24773_PROCHOT_OPTION0 0x04 +#define BQ24773_PROCHOT_OPTION1 0x06 +#define BQ24773_PROCHOT_STATUS 0x08 #define BQ24773_DEVICE_ADDRESS 0x09 #define BQ24773_CHARGE_CURRENT 0x0A #define BQ24773_MAX_CHARGE_VOLTAGE 0x0C