1 /*
2  * Copyright (c) 2015 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_DRIVERS_GPIO_GPIO_DW_H_
8 #define ZEPHYR_DRIVERS_GPIO_GPIO_DW_H_
9 
10 #include <zephyr/types.h>
11 #include <zephyr/drivers/gpio.h>
12 #include "gpio_dw_registers.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 typedef void (*gpio_config_irq_t)(const struct device *port);
19 
20 struct gpio_dw_config {
21 	/* gpio_driver_config needs to be first */
22 	struct gpio_driver_config common;
23 	uint32_t ngpios;
24 	uint32_t irq_num; /* set to 0 if GPIO port cannot interrupt */
25 	gpio_config_irq_t config_func;
26 };
27 
28 struct gpio_dw_runtime {
29 	/* gpio_driver_data needs to be first */
30 	struct gpio_driver_data common;
31 	uint32_t base_addr;
32 	sys_slist_t callbacks;
33 };
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif /* ZEPHYR_DRIVERS_GPIO_GPIO_DW_H_ */
40