summaryrefslogtreecommitdiff
path: root/common/charge_ramp.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-05-11 17:31:16 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-27 02:39:41 +0000
commit5b5f737d8f6f1be15d4ab5f42f290d20576307c4 (patch)
treebe384973f533436d9a53c46b742be35f5b377a4f /common/charge_ramp.c
parent25ce43fc3d35669500d74e44f3b7c96302ee2ade (diff)
downloadchrome-ec-5b5f737d8f6f1be15d4ab5f42f290d20576307c4.tar.gz
pd: move non-phy layer config out of usb_pd_config.h
Move parts of usb_pd_config.h that are not part of the phy layer out of usb_pd_config.h and into board.h. This cleans up the division between the TCPC and TCPM as only the TCPC needs to use usb_pd_config.h. Also cleans up the use of the CC detection voltage thresholds by creating standard macros to use based on Rp strength for the board. BUG=none BRANCH=none TEST=make -j buildall Change-Id: I946cceb38bea8233095b8a4b287102bb8a3a296d Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270337 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/charge_ramp.c')
-rw-r--r--common/charge_ramp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/charge_ramp.c b/common/charge_ramp.c
index 059648a88b..cc71f987b6 100644
--- a/common/charge_ramp.c
+++ b/common/charge_ramp.c
@@ -13,7 +13,6 @@
#include "task.h"
#include "timer.h"
#include "usb_pd.h"
-#include "usb_pd_config.h"
#include "util.h"
#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
@@ -59,8 +58,8 @@ struct oc_info {
};
/* OCP info for each over-current */
-static struct oc_info oc_info[PD_PORT_COUNT][RAMP_COUNT];
-static int oc_info_idx[PD_PORT_COUNT];
+static struct oc_info oc_info[CONFIG_USB_PD_PORT_COUNT][RAMP_COUNT];
+static int oc_info_idx[CONFIG_USB_PD_PORT_COUNT];
#define ACTIVE_OC_INFO (oc_info[active_port][oc_info_idx[active_port]])
/* Active charging information */
@@ -160,7 +159,7 @@ void chg_ramp_task(void)
int active_icl_new;
/* Clear last OCP supplier to guarantee we ramp on first connect */
- for (i = 0; i < PD_PORT_COUNT; i++)
+ for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++)
oc_info[i][0].sup = CHARGE_SUPPLIER_NONE;
while (1) {
@@ -347,7 +346,7 @@ static int command_chgramp(int argc, char **argv)
ccprintf("Chg Ramp:\nState: %d\nMin ICL: %d\nActive ICL: %d\n",
ramp_st, min_icl, active_icl);
- for (port = 0; port < PD_PORT_COUNT; port++) {
+ for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) {
ccprintf("Port %d:\n", port);
ccprintf(" OC idx:%d\n", oc_info_idx[port]);
for (i = 0; i < RAMP_COUNT; i++) {