summaryrefslogtreecommitdiff
path: root/zephyr/program/nissa/xivur/src/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/program/nissa/xivur/src/board.c')
-rw-r--r--zephyr/program/nissa/xivur/src/board.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/zephyr/program/nissa/xivur/src/board.c b/zephyr/program/nissa/xivur/src/board.c
new file mode 100644
index 0000000000..7fe60c8f84
--- /dev/null
+++ b/zephyr/program/nissa/xivur/src/board.c
@@ -0,0 +1,33 @@
+/* Copyright 2022 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gpio/gpio_int.h"
+#include "hooks.h"
+#include "task.h"
+
+#include <zephyr/drivers/gpio.h>
+#include <zephyr/drivers/pinctrl.h>
+#include <zephyr/init.h>
+#include <zephyr/kernel.h>
+#include <zephyr/sys/printk.h>
+
+LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL);
+
+__override uint8_t board_get_usb_pd_port_count(void)
+{
+ return 2;
+}
+/*
+ * Enable interrupts
+ */
+static void board_init(void)
+{
+ /*
+ * Enable USB-C interrupts.
+ */
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0));
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1));
+}
+DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);