1 /*
2  * Xilinx Processor System MIO / EMIO GPIO controller driver
3  *
4  * Driver private data declarations, parent (IRQ handler) module
5  *
6  * Copyright (c) 2022, Weidmueller Interface GmbH & Co. KG
7  * SPDX-License-Identifier: Apache-2.0
8  */
9 
10 #ifndef _ZEPHYR_DRIVERS_GPIO_GPIO_XLNX_PS_H_
11 #define _ZEPHYR_DRIVERS_GPIO_GPIO_XLNX_PS_H_
12 
13 /* Type definitions */
14 
15 /* IRQ handler function type */
16 typedef void (*gpio_xlnx_ps_config_irq_t)(const struct device *dev);
17 
18 /**
19  * @brief Run-time modifiable device data structure.
20  *
21  * This struct contains all data of the PS GPIO controller parent
22  * (IRQ handler) which is modifiable at run-time.
23  */
24 struct gpio_xlnx_ps_dev_data {
25 	struct gpio_driver_data common;
26 
27 	DEVICE_MMIO_NAMED_RAM(reg_base);
28 	mem_addr_t base;
29 };
30 
31 /**
32  * @brief Constant device configuration data structure.
33  *
34  * This struct contains all data of the PS GPIO controller parent
35  * which is required for proper operation (such as base memory
36  * addresses, references to all associated banks etc.) which don't
37  * have to and therefore cannot be modified at run-time.
38  */
39 struct gpio_xlnx_ps_dev_cfg {
40 	struct gpio_driver_config common;
41 
42 	DEVICE_MMIO_NAMED_ROM(reg_base);
43 
44 	const struct device *const *bank_devices;
45 	uint32_t num_banks;
46 	gpio_xlnx_ps_config_irq_t config_func;
47 };
48 
49 #endif /* _ZEPHYR_DRIVERS_GPIO_GPIO_XLNX_PS_H_ */
50