From 2b23d3ecaf2074ad640f66ff198b6043f3ea9e6e Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 5 Jun 2021 11:58:17 +0100 Subject: x1000: Allow setting IRQ handlers dynamically Avoids having to #define the names of GPIO pin interrupt handlers, as they can now be set at runtime instead. Change-Id: Ib5da1bdb475ff7b64280fe7cdd00adab63389152 --- firmware/target/mips/ingenic_x1000/gpio-x1000.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/target/mips/ingenic_x1000/gpio-x1000.h') diff --git a/firmware/target/mips/ingenic_x1000/gpio-x1000.h b/firmware/target/mips/ingenic_x1000/gpio-x1000.h index 5d147fc18f..eac5f8651f 100644 --- a/firmware/target/mips/ingenic_x1000/gpio-x1000.h +++ b/firmware/target/mips/ingenic_x1000/gpio-x1000.h @@ -57,6 +57,9 @@ #define GPIO_PC(x) GPION_CREATE(GPIO_C, x) #define GPIO_PD(x) GPION_CREATE(GPIO_D, x) +/* GPIO number to IRQ number (need to include "irq-x1000.h") */ +#define GPIO_TO_IRQ(gpio) IRQ_GPIO(GPION_PORT(gpio), GPION_PIN(gpio)) + /* Pingroup settings are used for system devices */ struct pingroup_setting { int port; -- cgit v1.2.3