summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/bobba/board.c10
-rw-r--r--board/casta/board.c9
-rw-r--r--board/fleex/board.c10
-rw-r--r--board/meep/board.c10
-rw-r--r--board/phaser/board.c10
-rw-r--r--board/yorp/board.c10
6 files changed, 59 insertions, 0 deletions
diff --git a/board/bobba/board.c b/board/bobba/board.c
index 1b6ba2feec..9e20943afe 100644
--- a/board/bobba/board.c
+++ b/board/bobba/board.c
@@ -321,3 +321,13 @@ void lid_angle_peripheral_enable(int enable)
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
}
#endif
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}
diff --git a/board/casta/board.c b/board/casta/board.c
index d5dc8833bf..124601fa75 100644
--- a/board/casta/board.c
+++ b/board/casta/board.c
@@ -88,3 +88,12 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}
diff --git a/board/fleex/board.c b/board/fleex/board.c
index c1d0f16bd6..879c4fc959 100644
--- a/board/fleex/board.c
+++ b/board/fleex/board.c
@@ -278,3 +278,13 @@ static void update_gpios_from_board_id(void)
}
DECLARE_HOOK(HOOK_INIT, update_gpios_from_board_id, HOOK_PRIO_INIT_I2C + 1);
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}
diff --git a/board/meep/board.c b/board/meep/board.c
index 85831cd85e..591e8758b9 100644
--- a/board/meep/board.c
+++ b/board/meep/board.c
@@ -330,3 +330,13 @@ const int keyboard_factory_scan_pins[][2] = {
const int keyboard_factory_scan_pins_used =
ARRAY_SIZE(keyboard_factory_scan_pins);
#endif
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}
diff --git a/board/phaser/board.c b/board/phaser/board.c
index 94e58e4e0b..ee3c8601cb 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -300,3 +300,13 @@ static void board_chipset_suspend(void)
sb_quick_charge_mode(1);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}
diff --git a/board/yorp/board.c b/board/yorp/board.c
index 1b2dccf4b1..0cfeccbd2e 100644
--- a/board/yorp/board.c
+++ b/board/yorp/board.c
@@ -240,3 +240,13 @@ static void post_old_board_warning(void)
}
DECLARE_HOOK(HOOK_INIT, post_old_board_warning, HOOK_PRIO_INIT_I2C + 1);
#endif
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}