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