summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-11-15 10:10:57 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-19 19:13:58 -0800
commit34747dbadded27fa5c76b0d3e1e607a81908c718 (patch)
tree844d30ce11cbd15f2c47a241f1e8c59719a35ce2 /baseboard
parenta253f5c60a32f7a82d57a1ed07983925e1e2c8bc (diff)
downloadchrome-ec-34747dbadded27fa5c76b0d3e1e607a81908c718.tar.gz
ocotpus: move VBUS_ADC config to base
All boards but yorp have added the ADC hardware support back for VBUS ADC measurements. Move code to common baseboard BRANCH=none BUG=none TEST=ADC measurements still works on phaser and fleex Change-Id: I36a7ba92df21de4c1188613c6a12da83fdba6eb6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1337456 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/octopus/baseboard.c12
-rw-r--r--baseboard/octopus/baseboard.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 37b467e005..7dc7c47e07 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -182,6 +182,18 @@ int board_is_i2c_port_powered(int port)
/******************************************************************************/
/* Power Delivery and charing functions */
+#ifdef CONFIG_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
+enum adc_channel board_get_vbus_adc(int port)
+{
+ if (port == 0)
+ return ADC_VBUS_C0;
+ if (port == 1)
+ return ADC_VBUS_C1;
+ CPRINTSUSB("Unknown vbus adc port id: %d", port);
+ return ADC_VBUS_C0;
+}
+#endif /* CONFIG_USB_PD_VBUS_MEASURE_ADC_EACH_PORT */
+
void baseboard_tcpc_init(void)
{
int port;
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index af34b348a0..dace7bdbcf 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -195,7 +195,7 @@
#define CONFIG_USBC_SS_MUX
#define CONFIG_USBC_VCONN
#define CONFIG_USBC_VCONN_SWAP
-#define CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT
+#define CONFIG_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
#define CONFIG_USB_PD_TCPM_MUX
#define CONFIG_USB_PD_TCPM_TCPCI
#define CONFIG_BC12_DETECT_MAX14637