summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2022-02-07 17:08:31 -0800
committerCommit Bot <commit-bot@chromium.org>2022-02-16 10:19:53 +0000
commit52147d1eb7416a17578bf6fec6ff1be4e77100fb (patch)
tree85270aa959be4bb8b04c9ead0c1acde821dc8b9a
parentd2a8e607787a694d4ae3d46b2ec82f45b0407caa (diff)
downloadchrome-ec-52147d1eb7416a17578bf6fec6ff1be4e77100fb.tar.gz
zephyr: Create Kconfig.pd_meas_vbus
Split PD Measure VBUS Kconfig options from Kconfig.usbc and place in a separate file named Kconfig.pd_meas_vbus. BUG=b:194432779 TEST=Verified Kconfig options with menuconfig BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ic6587cfc6d419f5b9d61969d1fd78fd8efb9b019 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3445452 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/Kconfig.pd_meas_vbus44
-rw-r--r--zephyr/Kconfig.usbc36
2 files changed, 45 insertions, 35 deletions
diff --git a/zephyr/Kconfig.pd_meas_vbus b/zephyr/Kconfig.pd_meas_vbus
new file mode 100644
index 0000000000..ad40ea239f
--- /dev/null
+++ b/zephyr/Kconfig.pd_meas_vbus
@@ -0,0 +1,44 @@
+# Copyright 2022 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+if PLATFORM_EC_USBC
+if PLATFORM_EC_USB_POWER_DELIVERY
+
+choice "Measuring VBUS voltage"
+ prompt "Select how VBUS voltage is measured"
+
+config PLATFORM_EC_USB_PD_VBUS_MEASURE_NOT_PRESENT
+ bool "VBUS voltage cannot be read"
+ help
+ Enable this if the board does not provide any mechanism for the EC to
+ read the analog VBUS voltage.
+
+config PLATFORM_EC_USB_PD_VBUS_MEASURE_CHARGER
+ bool "On-board charger supports VBUS measurement"
+ help
+ Enable this if the VBUS voltage can be read using a charger on the
+ board.
+
+config PLATFORM_EC_USB_PD_VBUS_MEASURE_TCPC
+ bool "Type-C Port Controller supports VBUS measurement"
+ help
+ Enable this if the VBUS voltage can be read using the on-board
+ TCPC.
+
+config PLATFORM_EC_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
+ bool "VBUS on each port is measured using an ADC channel"
+ help
+ Enable this if there is a separate ADC channel for each USB-C VBUS
+ voltage.
+
+config PLATFORM_EC_USB_PD_VBUS_MEASURE_BY_BOARD
+ bool "VBUS on each port is measured per board specific"
+ help
+ Enable this if there are different VBUS measurement approaches on
+ the board, and also `board_get_vbus_voltage()` has to be implemented.
+
+endchoice # Measuring VBUS voltage
+
+endif # PLATFORM_EC_USB_POWER_DELIVERY
+endif # PLATFORM_EC_USBC
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 570d82ac9b..21ffbdbf82 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -16,6 +16,7 @@ menuconfig PLATFORM_EC_USBC
rsource "Kconfig.retimer"
rsource "Kconfig.pd_int_shared"
+rsource "Kconfig.pd_meas_vbus"
if PLATFORM_EC_USBC
@@ -183,41 +184,6 @@ config PLATFORM_EC_USB_PD_5V_CHARGER_CTRL
The function charger_is_sourcing_otg_power is called
to determine if VBUS is enabled on the source port.
-choice "Measuring VBUS voltage"
- prompt "Select how VBUS voltage is measured"
-
-config PLATFORM_EC_USB_PD_VBUS_MEASURE_NOT_PRESENT
- bool "VBUS voltage cannot be read"
- help
- Enable this if the board does not provide any mechanism for the EC to
- read the analog VBUS voltage.
-
-config PLATFORM_EC_USB_PD_VBUS_MEASURE_CHARGER
- bool "On-board charger supports VBUS measurement"
- help
- Enable this if the VBUS voltage can be read using a charger on the
- board.
-
-config PLATFORM_EC_USB_PD_VBUS_MEASURE_TCPC
- bool "Type-C Port Controller supports VBUS measurement"
- help
- Enable this if the VBUS voltage can be read using the on-board
- TCPC.
-
-config PLATFORM_EC_USB_PD_VBUS_MEASURE_ADC_EACH_PORT
- bool "VBUS on each port is measured using an ADC channel"
- help
- Enable this if there is a separate ADC channel for each USB-C VBUS
- voltage.
-
-config PLATFORM_EC_USB_PD_VBUS_MEASURE_BY_BOARD
- bool "VBUS on each port is measured per board specific"
- help
- Enable this if there are different VBUS measurement approaches on
- the board, and also `board_get_vbus_voltage()` has to be implemented.
-
-endchoice # Measuring VBUS voltage
-
config PLATFORM_EC_USBC_VCONN
bool "Support USB Type-C VCONN"
default y