1*a7d1ecb6SJoel Stanley /* SPDX-License-Identifier: GPL-2.0+ */ 2*a7d1ecb6SJoel Stanley /* 3*a7d1ecb6SJoel Stanley * This header provides constants for binding aspeed,*-gpio. 4*a7d1ecb6SJoel Stanley * 5*a7d1ecb6SJoel Stanley * The first cell in Aspeed's GPIO specifier is the GPIO ID. The macros below 6*a7d1ecb6SJoel Stanley * provide names for this. 7*a7d1ecb6SJoel Stanley * 8*a7d1ecb6SJoel Stanley * The second cell contains standard flag values specified in gpio.h. 9*a7d1ecb6SJoel Stanley */ 10*a7d1ecb6SJoel Stanley 11*a7d1ecb6SJoel Stanley #ifndef _DT_BINDINGS_GPIO_ASPEED_GPIO_H 12*a7d1ecb6SJoel Stanley #define _DT_BINDINGS_GPIO_ASPEED_GPIO_H 13*a7d1ecb6SJoel Stanley 14*a7d1ecb6SJoel Stanley #include <dt-bindings/gpio/gpio.h> 15*a7d1ecb6SJoel Stanley 16*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_A 0 17*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_B 1 18*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_C 2 19*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_D 3 20*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_E 4 21*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_F 5 22*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_G 6 23*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_H 7 24*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_I 8 25*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_J 9 26*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_K 10 27*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_L 11 28*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_M 12 29*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_N 13 30*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_O 14 31*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_P 15 32*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_Q 16 33*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_R 17 34*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_S 18 35*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_T 19 36*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_U 20 37*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_V 21 38*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_W 22 39*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_X 23 40*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_Y 24 41*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_Z 25 42*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_AA 26 43*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_AB 27 44*a7d1ecb6SJoel Stanley #define ASPEED_GPIO_PORT_AC 28 45*a7d1ecb6SJoel Stanley 46*a7d1ecb6SJoel Stanley #define ASPEED_GPIO(port, offset) \ 47*a7d1ecb6SJoel Stanley ((ASPEED_GPIO_PORT_##port * 8) + offset) 48*a7d1ecb6SJoel Stanley 49*a7d1ecb6SJoel Stanley #endif 50