1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(C) 2021 Marvell. 3 */ 4 5 #ifndef _CNXK_GPIO_H_ 6 #define _CNXK_GPIO_H_ 7 8 struct cnxk_gpiochip; 9 10 struct cnxk_gpio { 11 struct cnxk_gpiochip *gpiochip; 12 void *rsp; 13 int num; 14 void (*handler)(int gpio, void *data); 15 void *data; 16 int cpu; 17 }; 18 19 struct cnxk_gpiochip { 20 int num; 21 int base; 22 int num_gpios; 23 int num_queues; 24 struct cnxk_gpio **gpios; 25 int *allowlist; 26 }; 27 28 int cnxk_gpio_selftest(uint16_t dev_id); 29 30 int cnxk_gpio_irq_init(struct cnxk_gpiochip *gpiochip); 31 void cnxk_gpio_irq_fini(void); 32 int cnxk_gpio_irq_request(int gpio, int cpu); 33 int cnxk_gpio_irq_free(int gpio); 34 35 #endif /* _CNXK_GPIO_H_ */ 36