summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common/gpio_eint_v1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/common/gpio_eint_v1.c')
-rw-r--r--src/soc/mediatek/common/gpio_eint_v1.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/gpio_eint_v1.c b/src/soc/mediatek/common/gpio_eint_v1.c
new file mode 100644
index 0000000000..194dff45ad
--- /dev/null
+++ b/src/soc/mediatek/common/gpio_eint_v1.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/addressmap.h>
+#include <gpio.h>
+
+void gpio_calc_eint_pos_bit(gpio_t gpio, u32 *pos, u32 *bit)
+{
+ *pos = gpio.id / MAX_EINT_REG_BITS;
+ *bit = gpio.id % MAX_EINT_REG_BITS;
+}
+
+struct eint_regs *gpio_get_eint_reg(gpio_t gpio)
+{
+ return (struct eint_regs *)(EINT_BASE);
+}