tests: drivers: gpio: Add NCT38xx gpio-alert

Add support for the NCT38xx GPIO alert driver in the build all test.

This fixes issue:
https://github.com/zephyrproject-rtos/zephyr/issues/61436

Signed-off-by: Keith Short <keithshort@google.com>
This commit is contained in:
Keith Short 2023-08-11 14:53:14 -06:00 committed by Fabio Baltieri
commit ee0c5f9161
4 changed files with 12 additions and 4 deletions

View file

@ -60,7 +60,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_ANDES_ATCGPIO100 gpio_andes_atcgpio100.
zephyr_library_sources_ifdef(CONFIG_GPIO_NEORV32 gpio_neorv32.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NEORV32 gpio_neorv32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx_port.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx_port.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX_INTERRUPT gpio_nct38xx_alert.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX_ALERT gpio_nct38xx_alert.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_TEST gpio_test.c) zephyr_library_sources_ifdef(CONFIG_GPIO_TEST gpio_test.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_GD32 gpio_gd32.c) zephyr_library_sources_ifdef(CONFIG_GPIO_GD32 gpio_gd32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_XLNX_PS gpio_xlnx_ps.c gpio_xlnx_ps_bank.c) zephyr_library_sources_ifdef(CONFIG_GPIO_XLNX_PS gpio_xlnx_ps.c gpio_xlnx_ps_bank.c)

View file

@ -27,15 +27,17 @@ config GPIO_NCT38XX_PORT_INIT_PRIORITY
Device driver initialization priority. The priority should be lower Device driver initialization priority. The priority should be lower
than I2C & GPIO_NCT38XX_INIT_PRIORITY device. than I2C & GPIO_NCT38XX_INIT_PRIORITY device.
config GPIO_NCT38XX_INTERRUPT config GPIO_NCT38XX_ALERT
bool "NCT38XX GPIO interrupt" bool "NCT38XX GPIO interrupt"
default y
depends on DT_HAS_NUVOTON_NCT38XX_GPIO_ALERT_ENABLED
help help
Enable interrupt support in NCT38XX driver. Enable interrupt support in NCT38XX driver.
config GPIO_NCT38XX_ALERT_INIT_PRIORITY config GPIO_NCT38XX_ALERT_INIT_PRIORITY
int "NCT38XX GPIO alert handler init priority" int "NCT38XX GPIO alert handler init priority"
default 40 default 40
depends on GPIO_NCT38XX_INTERRUPT depends on GPIO_NCT38XX_ALERT
help help
NCT38XX alert handler initialization priority. This initialization NCT38XX alert handler initialization priority. This initialization
must take place after the alert GPIO device is initialized. must take place after the alert GPIO device is initialized.

View file

@ -69,7 +69,7 @@ static int nct38xx_gpio_init(const struct device *dev)
return -ENODEV; return -ENODEV;
} }
if (IS_ENABLED(CONFIG_GPIO_NCT38XX_INTERRUPT)) { if (IS_ENABLED(CONFIG_GPIO_NCT38XX_ALERT)) {
nct38xx_init_interrupt(dev); nct38xx_init_interrupt(dev);
} }

View file

@ -174,6 +174,12 @@
}; };
}; };
nct3807_alert_1 {
compatible = "nuvoton,nct38xx-gpio-alert";
irq-gpios = <&test_gpio 0 0>;
nct38xx-dev = <&test_i2c_nct3808_p1 &test_i2c_nct3808_p2>;
};
test_spi: spi@33334444 { test_spi: spi@33334444 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;