1*e67e8565SEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0 */ 2*e67e8565SEmmanuel Vadot /* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. */ 3*e67e8565SEmmanuel Vadot 4*e67e8565SEmmanuel Vadot /* 5*e67e8565SEmmanuel Vadot * This header provides constants for the nvidia,tegra241-gpio DT binding. 6*e67e8565SEmmanuel Vadot * 7*e67e8565SEmmanuel Vadot * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below 8*e67e8565SEmmanuel Vadot * provide names for this. 9*e67e8565SEmmanuel Vadot * 10*e67e8565SEmmanuel Vadot * The second cell contains standard flag values specified in gpio.h. 11*e67e8565SEmmanuel Vadot */ 12*e67e8565SEmmanuel Vadot 13*e67e8565SEmmanuel Vadot #ifndef _DT_BINDINGS_GPIO_TEGRA241_GPIO_H 14*e67e8565SEmmanuel Vadot #define _DT_BINDINGS_GPIO_TEGRA241_GPIO_H 15*e67e8565SEmmanuel Vadot 16*e67e8565SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 17*e67e8565SEmmanuel Vadot 18*e67e8565SEmmanuel Vadot /* GPIOs implemented by main GPIO controller */ 19*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_A 0 20*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_B 1 21*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_C 2 22*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_D 3 23*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_E 4 24*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_F 5 25*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_G 6 26*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_H 7 27*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_I 8 28*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_J 9 29*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_K 10 30*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO_PORT_L 11 31*e67e8565SEmmanuel Vadot 32*e67e8565SEmmanuel Vadot #define TEGRA241_MAIN_GPIO(port, offset) \ 33*e67e8565SEmmanuel Vadot ((TEGRA241_MAIN_GPIO_PORT_##port * 8) + (offset)) 34*e67e8565SEmmanuel Vadot 35*e67e8565SEmmanuel Vadot /* GPIOs implemented by AON GPIO controller */ 36*e67e8565SEmmanuel Vadot #define TEGRA241_AON_GPIO_PORT_AA 0 37*e67e8565SEmmanuel Vadot #define TEGRA241_AON_GPIO_PORT_BB 1 38*e67e8565SEmmanuel Vadot 39*e67e8565SEmmanuel Vadot #define TEGRA241_AON_GPIO(port, offset) \ 40*e67e8565SEmmanuel Vadot ((TEGRA241_AON_GPIO_PORT_##port * 8) + (offset)) 41*e67e8565SEmmanuel Vadot 42*e67e8565SEmmanuel Vadot #endif 43