blob: 849e8d2dcf3dd8e449019ee9e14f54aa754f04a7 [file] [log] [blame]
Keerthy0f3cf2b2018-10-03 17:55:14 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef _GPIO_DA8XX_DEFS_H_
4#define _GPIO_DA8XX_DEFS_H_
5
6struct 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
19struct 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
Simon Glassbcee8d62019-12-06 21:41:35 -070031#if CONFIG_IS_ENABLED(DM_GPIO)
Keerthy0f3cf2b2018-10-03 17:55:14 +053032
33/* Information about a GPIO bank */
34struct 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