summaryrefslogtreecommitdiff
path: root/common/charge_ramp.c
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2017-01-12 12:57:52 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-13 15:22:35 -0800
commit6a7e4a7b353c53d33d44662c71763490ffd1fdc4 (patch)
tree9ef9524663f201b8ce84b250617af2e539973e2c /common/charge_ramp.c
parent9fd2736d90c598b335d689d8db5ad727194a1991 (diff)
downloadchrome-ec-6a7e4a7b353c53d33d44662c71763490ffd1fdc4.tar.gz
charge_ramp: Adjust minimum ramp current
A valid charge port is always detected as VBUS supplier type, 'USB charger' can detect the same port as BC1.2 DCP supplier type & also 'TCPC' can detect the same port as TYPEC supplier type. Thus a valid port is detected as 2 or 3 supplier types. Depending on the supplier's priority and the power that the supplier can provide, charge manager choses the charge supplier type of the port. If the USB charger detected supplier is BC1.2 DCP and the TCPC detected supplier is TYPEC then the supplier can provide stable current from TYPEC supplier's advertised current hence start ramping from TYPEC supplier's advertised current. BUG=chrome-os-partner:61420 BRANCH=none TEST=Manually tested on reef. Donette bottom port can switch from 1.5A to 3A upon high load. Change-Id: I871eca3ae4041f00bb3fd50e6aa939643f30a1f2 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/427961 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/charge_ramp.c')
-rw-r--r--common/charge_ramp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index f6942d7516..c84e126140 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -29,7 +29,6 @@
/* Current ramp increment */
#define RAMP_CURR_INCR_MA 64
#define RAMP_CURR_DELAY (500*MSEC)
-#define RAMP_CURR_START_MA 500
/* How much to backoff the input current limit when limit has been found */
#define RAMP_ICL_BACKOFF (2*RAMP_CURR_INCR_MA)
@@ -102,7 +101,8 @@ void chg_ramp_charge_supplier_change(int port, int supplier, int current,
/* Set min and max input current limit based on if ramp is allowed */
if (board_is_ramp_allowed(active_sup)) {
- min_icl = RAMP_CURR_START_MA;
+ min_icl = charge_manager_get_ramp_start_current(active_port,
+ active_sup);
max_icl = board_get_ramp_current_limit(active_sup, current);
} else {
min_icl = max_icl = current;