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