xref: /openbmc/u-boot/drivers/gpio/da8xx_gpio.h (revision b9553986)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef _GPIO_DA8XX_DEFS_H_
4 #define _GPIO_DA8XX_DEFS_H_
5 
6 struct davinci_gpio {
7 	unsigned int dir;
8 	unsigned int out_data;
9 	unsigned int set_data;
10 	unsigned int clr_data;
11 	unsigned int in_data;
12 	unsigned int set_rising;
13 	unsigned int clr_rising;
14 	unsigned int set_falling;
15 	unsigned int clr_falling;
16 	unsigned int intstat;
17 };
18 
19 struct davinci_gpio_bank {
20 	int num_gpio;
21 	unsigned int irq_num;
22 	unsigned int irq_mask;
23 	unsigned long *in_use;
24 	struct davinci_gpio *base;
25 };
26 
27 #define GPIO_NAME_SIZE		20
28 #define MAX_NUM_GPIOS		144
29 #define GPIO_BIT(gp)		((gp) & 0x1F)
30 
31 #ifdef CONFIG_DM_GPIO
32 
33 /* Information about a GPIO bank */
34 struct davinci_gpio_platdata {
35 	int bank_index;
36 	ulong base;	/* address of registers in physical memory */
37 	const char *port_name;
38 };
39 #endif
40 
41 #endif
42