diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-10-05 09:50:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-06 13:47:12 -0700 |
commit | b87fe062eca43fc00909098e716581bf2aeea7eb (patch) | |
tree | 890225b40bf562456984424adc1f243fb06ae7eb /board/samus_pd | |
parent | 02045eb040227250689caec9b9401c2cd3861363 (diff) | |
download | chrome-ec-b87fe062eca43fc00909098e716581bf2aeea7eb.tar.gz |
charge_ramp: Move ramp allowed / ilim callbacks to common code
The decision on whether to ramp (and how high) depends on the quirks of
charger identification, so move the decision out of board, into the
drivers that implement usb_charger.
Also, rename CONFIG_CHARGE_RAMP to CONFIG_CHARGE_RAMP_SW, to better
contrast with the existing CONFIG_CHARGE_RAMP_HW.
BUG=None
TEST=Manual on kevin, verify ramp occurs when port plugged into Z840
workstation.
BRANCH=None
Change-Id: I5b395274133837a18a4f4ac34b59b623287be175
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/702681
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/samus_pd')
-rw-r--r-- | board/samus_pd/board.c | 33 | ||||
-rw-r--r-- | board/samus_pd/board.h | 2 |
2 files changed, 1 insertions, 34 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index bad38ed435..fc4c22d207 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -361,39 +361,6 @@ int pd_is_max_request_allowed(void) } /** - * Return whether ramping is allowed for given supplier - */ -int board_is_ramp_allowed(int supplier) -{ - /* Don't allow ramping in RO when write protected */ - if (!system_is_in_rw() && system_is_locked()) - return 0; - else - return supplier == CHARGE_SUPPLIER_BC12_DCP || - supplier == CHARGE_SUPPLIER_BC12_SDP || - supplier == CHARGE_SUPPLIER_BC12_CDP || - supplier == CHARGE_SUPPLIER_PROPRIETARY; -} - -/** - * Return the maximum allowed input current - */ -int board_get_ramp_current_limit(int supplier, int sup_curr) -{ - switch (supplier) { - case CHARGE_SUPPLIER_BC12_DCP: - return 2000; - case CHARGE_SUPPLIER_BC12_SDP: - return 1000; - case CHARGE_SUPPLIER_BC12_CDP: - case CHARGE_SUPPLIER_PROPRIETARY: - return sup_curr; - default: - return 500; - } -} - -/** * Return if board is consuming full amount of input current */ int board_is_consuming_full_charge(void) diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h index e85fb61a1b..4aaae34fcc 100644 --- a/board/samus_pd/board.h +++ b/board/samus_pd/board.h @@ -20,7 +20,7 @@ #undef CONFIG_ADC_WATCHDOG #define CONFIG_BOARD_PRE_INIT #define CONFIG_CHARGE_MANAGER -#define CONFIG_CHARGE_RAMP +#define CONFIG_CHARGE_RAMP_SW #undef CONFIG_CMD_HASH #undef CONFIG_CMD_HCDEBUG #undef CONFIG_CMD_I2C_SCAN |