diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-01-13 16:13:09 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-16 03:30:49 +0000 |
commit | 29e3a2761a38f2e2d680ae5cbec6a9b01b02f8d8 (patch) | |
tree | 612785533c8b9c7945337aa5ea9955e7f23aa3cd | |
parent | 2669c65cfbc7bef081192806382a894e3d271494 (diff) | |
download | chrome-ec-29e3a2761a38f2e2d680ae5cbec6a9b01b02f8d8.tar.gz |
samus: add 200mA offset for input current limit
On samus, set the input current limit ~200mA lower than the
value we want to accomodate hardware inaccuracy.
BUG=chrome-os-partner:34938
BRANCH=samus
TEST=load on to unit and verify using "charger" command on
ec console that the input current limit is 192mA less than
expected.
Change-Id: Ia6f82a1a622975715bd36c8c2a23e9677a6f18f0
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/240751
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/samus/board.h | 2 | ||||
-rw-r--r-- | board/samus_pd/board.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/board/samus/board.h b/board/samus/board.h index 9005060f6a..876166e4b4 100644 --- a/board/samus/board.h +++ b/board/samus/board.h @@ -48,7 +48,7 @@ #define CONFIG_CHARGER_ILIM_PIN_DISABLED #define CONFIG_CHARGER_SENSE_RESISTOR 5 #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 -#define CONFIG_CHARGER_INPUT_CURRENT 448 +#define CONFIG_CHARGER_INPUT_CURRENT 320 #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1 #define CONFIG_FANS 2 diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index ce87c248fd..e9c56619cb 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -29,6 +29,9 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) +/* Amount to offset the input current limit when sending to EC */ +#define INPUT_CURRENT_LIMIT_OFFSET_MA 192 + /* Chipset power state */ static enum power_state ps; @@ -628,7 +631,8 @@ void board_set_charge_limit(int charge_ma) pwm_set_duty(PWM_CH_ILIM, pwm_duty); #endif - pd_status.curr_lim_ma = charge_ma; + pd_status.curr_lim_ma = MAX(0, charge_ma - + INPUT_CURRENT_LIMIT_OFFSET_MA); pd_send_ec_int(); CPRINTS("New ilim %d", charge_ma); |