xref: /linux/include/dt-bindings/gpio/uniphier-gpio.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
1*1c59d045SMasahiro Yamada /*
2*1c59d045SMasahiro Yamada  * Copyright (C) 2017 Socionext Inc.
3*1c59d045SMasahiro Yamada  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4*1c59d045SMasahiro Yamada  */
5*1c59d045SMasahiro Yamada 
6*1c59d045SMasahiro Yamada #ifndef _DT_BINDINGS_GPIO_UNIPHIER_H
7*1c59d045SMasahiro Yamada #define _DT_BINDINGS_GPIO_UNIPHIER_H
8*1c59d045SMasahiro Yamada 
9*1c59d045SMasahiro Yamada #define UNIPHIER_GPIO_LINES_PER_BANK	8
10*1c59d045SMasahiro Yamada 
11*1c59d045SMasahiro Yamada #define UNIPHIER_GPIO_IRQ_OFFSET	((UNIPHIER_GPIO_LINES_PER_BANK) * 15)
12*1c59d045SMasahiro Yamada 
13*1c59d045SMasahiro Yamada #define UNIPHIER_GPIO_PORT(bank, line)	\
14*1c59d045SMasahiro Yamada 			((UNIPHIER_GPIO_LINES_PER_BANK) * (bank) + (line))
15*1c59d045SMasahiro Yamada 
16*1c59d045SMasahiro Yamada #define UNIPHIER_GPIO_IRQ(n)		((UNIPHIER_GPIO_IRQ_OFFSET) + (n))
17*1c59d045SMasahiro Yamada 
18*1c59d045SMasahiro Yamada #endif /* _DT_BINDINGS_GPIO_UNIPHIER_H */
19