1 /* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ 2 /* Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. */ 3 4 /* 5 * This header provides constants for binding nvidia,tegra238-gpio*. 6 * 7 * The first cell in Tegra'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_TEGRA238_GPIO_H 14 #define _DT_BINDINGS_GPIO_TEGRA238_GPIO_H 15 16 #include <dt-bindings/gpio/gpio.h> 17 18 /* GPIOs implemented by main GPIO controller */ 19 #define TEGRA238_MAIN_GPIO_PORT_A 0 20 #define TEGRA238_MAIN_GPIO_PORT_B 1 21 #define TEGRA238_MAIN_GPIO_PORT_C 2 22 #define TEGRA238_MAIN_GPIO_PORT_D 3 23 #define TEGRA238_MAIN_GPIO_PORT_E 4 24 #define TEGRA238_MAIN_GPIO_PORT_F 5 25 #define TEGRA238_MAIN_GPIO_PORT_G 6 26 #define TEGRA238_MAIN_GPIO_PORT_H 7 27 #define TEGRA238_MAIN_GPIO_PORT_J 8 28 #define TEGRA238_MAIN_GPIO_PORT_K 9 29 #define TEGRA238_MAIN_GPIO_PORT_L 10 30 #define TEGRA238_MAIN_GPIO_PORT_M 11 31 #define TEGRA238_MAIN_GPIO_PORT_N 12 32 #define TEGRA238_MAIN_GPIO_PORT_P 13 33 #define TEGRA238_MAIN_GPIO_PORT_Q 14 34 #define TEGRA238_MAIN_GPIO_PORT_R 15 35 #define TEGRA238_MAIN_GPIO_PORT_S 16 36 #define TEGRA238_MAIN_GPIO_PORT_T 17 37 #define TEGRA238_MAIN_GPIO_PORT_U 18 38 #define TEGRA238_MAIN_GPIO_PORT_V 19 39 #define TEGRA238_MAIN_GPIO_PORT_W 20 40 #define TEGRA238_MAIN_GPIO_PORT_X 21 41 42 #define TEGRA238_MAIN_GPIO(port, offset) \ 43 ((TEGRA238_MAIN_GPIO_PORT_##port * 8) + (offset)) 44 45 /* GPIOs implemented by AON GPIO controller */ 46 #define TEGRA238_AON_GPIO_PORT_AA 0 47 #define TEGRA238_AON_GPIO_PORT_BB 1 48 #define TEGRA238_AON_GPIO_PORT_CC 2 49 #define TEGRA238_AON_GPIO_PORT_DD 3 50 #define TEGRA238_AON_GPIO_PORT_EE 4 51 #define TEGRA238_AON_GPIO_PORT_FF 5 52 #define TEGRA238_AON_GPIO_PORT_GG 6 53 #define TEGRA238_AON_GPIO_PORT_HH 7 54 55 #define TEGRA238_AON_GPIO(port, offset) \ 56 ((TEGRA238_AON_GPIO_PORT_##port * 8) + (offset)) 57 58 #endif 59