summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-03-07 13:07:13 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-03-08 13:56:38 -0800
commit866e8499578263b12a712a06eeda9d7a873a0702 (patch)
tree23ab94874142edb75f637e2e274f2d7c8d473b4d
parent541de8a5a37ad35aa6eb7b4d641ef7df377f90e0 (diff)
downloadchrome-ec-866e8499578263b12a712a06eeda9d7a873a0702.tar.gz
pd: Compilation fixes for upcoming board designs
- Send host commands to TCPCs based upon CONFIG_HOSTCMD_PD, since boards with off-the-shelf TCPCs will also have a PDCMD task. - Don't log VBUS voltage if we have no VBUS ADC channel. BUG=chrome-os-partner:50819 BRANCH=None TEST=`make buildall -j` with subsequent kevin board commit. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I33347402ec31e1754ad8e9a62814d5c1f345737d Reviewed-on: https://chromium-review.googlesource.com/331343 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/charge_manager.c7
-rw-r--r--common/host_command.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c
index 6a17d9ee4a..8782d398e3 100644
--- a/common/charge_manager.c
+++ b/common/charge_manager.c
@@ -271,7 +271,12 @@ static void charge_manager_fill_power_info(int port,
if (r->role == USB_PD_PORT_POWER_SINK_NOT_CHARGING)
r->meas.voltage_now = 5000;
else
- r->meas.voltage_now = adc_read_channel(ADC_VBUS);
+ if (ADC_VBUS >= 0)
+ r->meas.voltage_now =
+ adc_read_channel(ADC_VBUS);
+ else
+ /* No VBUS ADC channel - voltage is unknown */
+ r->meas.voltage_now = 0;
}
}
#endif /* TEST_BUILD */
diff --git a/common/host_command.c b/common/host_command.c
index 0dae3bf036..97b8cc59cc 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -567,7 +567,7 @@ enum ec_status host_command_process(struct host_cmd_handler_args *args)
if (hcdebug)
host_command_debug_request(args);
-#ifdef HAS_TASK_PDCMD
+#ifdef CONFIG_HOSTCMD_PD
if (args->command >= EC_CMD_PASSTHRU_OFFSET(1) &&
args->command <= EC_CMD_PASSTHRU_MAX(1)) {
rv = pd_host_command(args->command - EC_CMD_PASSTHRU_OFFSET(1),
@@ -738,7 +738,7 @@ static int host_command_get_features(struct host_cmd_handler_args *args)
#ifdef CONFIG_PMU_POWERINFO
| EC_FEATURE_MASK_0(EC_FEATURE_PMU)
#endif
-#ifdef HAS_TASK_PDCMD
+#ifdef CONFIG_HOSTCMD_PD
| EC_FEATURE_MASK_0(EC_FEATURE_SUB_MCU)
#endif
#ifdef CONFIG_CHARGE_MANAGER