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