summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2021-10-27 14:15:37 +1100
committerCommit Bot <commit-bot@chromium.org>2021-10-28 06:00:03 +0000
commite823e17df22a88e66983cac26066580fdf4a7f80 (patch)
tree74cab88c91a784aab3351695b026db8970d83143
parent20a1c99370e5af0b4a2973d14e49131befc6e426 (diff)
downloadchrome-ec-stabilize-14312.B-main.tar.gz
volteer: configure BC1.2 on type-C ports with DTstabilize-14312.B-main
This adopts the recently-added support for PI3USB9201 in Zephyr. BUG=b:202397628 TEST=builds BRANCH=None Change-Id: I87c898a4d1296090c723c2802df7cf3a27991aee Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3246636 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--board/volteer/usbc_config.c4
-rw-r--r--zephyr/boards/arm/volteer/volteer.dts4
-rw-r--r--zephyr/projects/volteer/volteer/gpio.dts4
-rw-r--r--zephyr/projects/volteer/volteer/usbc.dts19
-rw-r--r--zephyr/projects/volteer/volteer/zmake.yaml1
5 files changed, 28 insertions, 4 deletions
diff --git a/board/volteer/usbc_config.c b/board/volteer/usbc_config.c
index 0adfe98107..e03ef0e203 100644
--- a/board/volteer/usbc_config.c
+++ b/board/volteer/usbc_config.c
@@ -340,12 +340,15 @@ static void board_tcpc_init(void)
gpio_enable_interrupt(GPIO_USB_C0_TCPC_INT_ODL);
gpio_enable_interrupt(GPIO_USB_C1_TCPC_INT_ODL);
+#ifndef CONFIG_ZEPHYR
/* Enable BC1.2 interrupts. */
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL);
gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_ODL);
+#endif /* !CONFIG_ZEPHYR */
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_CHIPSET);
+#ifndef CONFIG_ZEPHYR
/******************************************************************************/
/* BC1.2 charger detect configuration */
const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
@@ -359,6 +362,7 @@ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
},
};
BUILD_ASSERT(ARRAY_SIZE(pi3usb9201_bc12_chips) == USBC_PORT_COUNT);
+#endif /* !CONFIG_ZEPHYR */
/******************************************************************************/
/* TCPC support routines */
diff --git a/zephyr/boards/arm/volteer/volteer.dts b/zephyr/boards/arm/volteer/volteer.dts
index d837f8ab55..f25363f03f 100644
--- a/zephyr/boards/arm/volteer/volteer.dts
+++ b/zephyr/boards/arm/volteer/volteer.dts
@@ -60,12 +60,12 @@
enum-name = "I2C_PORT_ACCEL";
label = "ACCEL";
};
- usb-c0 {
+ i2c_usb_c0: usb-c0 {
i2c-port = <&i2c1_0>;
enum-name = "I2C_PORT_USB_C0";
label = "USB_C0";
};
- usb-c1 {
+ i2c_usb_c1: usb-c1 {
i2c-port = <&i2c2_0>;
enum-name = "I2C_PORT_USB_C1";
label = "USB_C1";
diff --git a/zephyr/projects/volteer/volteer/gpio.dts b/zephyr/projects/volteer/volteer/gpio.dts
index 3f679fc7b5..06381d6492 100644
--- a/zephyr/projects/volteer/volteer/gpio.dts
+++ b/zephyr/projects/volteer/volteer/gpio.dts
@@ -108,7 +108,7 @@
enum-name = "GPIO_USB_C1_PPC_INT_ODL";
label = "USB_C1_PPC_INT_ODL";
};
- usb_c0_bc12_int_odl {
+ gpio_usb_c0_bc12_int_odl: usb_c0_bc12_int_odl {
gpios = <&gpioe 4 GPIO_INPUT>;
enum-name = "GPIO_USB_C0_BC12_INT_ODL";
label = "USB_C0_BC12_INT_ODL";
@@ -119,7 +119,7 @@
enum-name = "GPIO_USB_C1_MIX_INT_ODL";
label = "USB_C1_MIX_INT_ODL";
};
- usb_c1_bc12_int_odl {
+ gpio_usb_c1_bc12_int_odl: usb_c1_bc12_int_odl {
#gpio-cells = <0>;
gpios = <&gpio0 3 GPIO_INPUT>;
enum-name = "GPIO_USB_C1_BC12_INT_ODL";
diff --git a/zephyr/projects/volteer/volteer/usbc.dts b/zephyr/projects/volteer/volteer/usbc.dts
new file mode 100644
index 0000000000..35035e8bf1
--- /dev/null
+++ b/zephyr/projects/volteer/volteer/usbc.dts
@@ -0,0 +1,19 @@
+/ {
+ usbc {
+ port0: usbc-port0 {
+ bc12 {
+ compatible = "pericom,pi3usb9201";
+ port = <&i2c_usb_c0>;
+ irq = <&gpio_usb_c0_bc12_int_odl>;
+ };
+ };
+
+ port1: usbc-port1 {
+ bc12 {
+ compatible = "pericom,pi3usb9201";
+ port = <&i2c_usb_c1>;
+ irq = <&gpio_usb_c1_bc12_int_odl>;
+ };
+ };
+ };
+};
diff --git a/zephyr/projects/volteer/volteer/zmake.yaml b/zephyr/projects/volteer/volteer/zmake.yaml
index 7382d98440..d8b2ce7a61 100644
--- a/zephyr/projects/volteer/volteer/zmake.yaml
+++ b/zephyr/projects/volteer/volteer/zmake.yaml
@@ -12,6 +12,7 @@ dts-overlays:
- motionsense.dts
- pwm.dts
- pwm_leds.dts
+ - usbc.dts
supported-toolchains:
- coreboot-sdk
- zephyr