1*c66ec88fSEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0 */ 2*c66ec88fSEmmanuel Vadot /* 3*c66ec88fSEmmanuel Vadot * This header provides constants for binding nvidia,tegra*-gpio. 4*c66ec88fSEmmanuel Vadot * 5*c66ec88fSEmmanuel Vadot * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below 6*c66ec88fSEmmanuel Vadot * provide names for this. 7*c66ec88fSEmmanuel Vadot * 8*c66ec88fSEmmanuel Vadot * The second cell contains standard flag values specified in gpio.h. 9*c66ec88fSEmmanuel Vadot */ 10*c66ec88fSEmmanuel Vadot 11*c66ec88fSEmmanuel Vadot #ifndef _DT_BINDINGS_GPIO_TEGRA_GPIO_H 12*c66ec88fSEmmanuel Vadot #define _DT_BINDINGS_GPIO_TEGRA_GPIO_H 13*c66ec88fSEmmanuel Vadot 14*c66ec88fSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_A 0 17*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_B 1 18*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_C 2 19*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_D 3 20*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_E 4 21*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_F 5 22*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_G 6 23*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_H 7 24*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_I 8 25*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_J 9 26*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_K 10 27*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_L 11 28*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_M 12 29*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_N 13 30*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_O 14 31*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_P 15 32*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_Q 16 33*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_R 17 34*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_S 18 35*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_T 19 36*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_U 20 37*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_V 21 38*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_W 22 39*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_X 23 40*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_Y 24 41*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_Z 25 42*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_AA 26 43*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_BB 27 44*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_CC 28 45*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_DD 29 46*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_EE 30 47*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO_PORT_FF 31 48*c66ec88fSEmmanuel Vadot 49*c66ec88fSEmmanuel Vadot #define TEGRA_GPIO(port, offset) \ 50*c66ec88fSEmmanuel Vadot ((TEGRA_GPIO_PORT_##port * 8) + offset) 51*c66ec88fSEmmanuel Vadot 52*c66ec88fSEmmanuel Vadot #endif 53