1*074a1fddSStephen Warren /* 2*074a1fddSStephen Warren * Copyright (c) 2016, NVIDIA CORPORATION. 3*074a1fddSStephen Warren * 4*074a1fddSStephen Warren * SPDX-License-Identifier: GPL-2.0 5*074a1fddSStephen Warren * 6*074a1fddSStephen Warren * This header provides constants for binding nvidia,tegra186-gpio*. 7*074a1fddSStephen Warren * 8*074a1fddSStephen Warren * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below 9*074a1fddSStephen Warren * provide names for this. 10*074a1fddSStephen Warren * 11*074a1fddSStephen Warren * The second cell contains standard flag values specified in gpio.h. 12*074a1fddSStephen Warren */ 13*074a1fddSStephen Warren 14*074a1fddSStephen Warren #ifndef _DT_BINDINGS_GPIO_TEGRA186_GPIO_H 15*074a1fddSStephen Warren #define _DT_BINDINGS_GPIO_TEGRA186_GPIO_H 16*074a1fddSStephen Warren 17*074a1fddSStephen Warren #include <dt-bindings/gpio/gpio.h> 18*074a1fddSStephen Warren 19*074a1fddSStephen Warren /* GPIOs implemented by main GPIO controller */ 20*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_A 0 21*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_B 1 22*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_C 2 23*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_D 3 24*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_E 4 25*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_F 5 26*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_G 6 27*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_H 7 28*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_I 8 29*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_J 9 30*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_K 10 31*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_L 11 32*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_M 12 33*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_N 13 34*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_O 14 35*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_P 15 36*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_Q 16 37*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_R 17 38*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_T 18 39*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_X 19 40*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_Y 20 41*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_BB 21 42*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO_PORT_CC 22 43*074a1fddSStephen Warren 44*074a1fddSStephen Warren #define TEGRA_MAIN_GPIO(port, offset) \ 45*074a1fddSStephen Warren ((TEGRA_MAIN_GPIO_PORT_##port * 8) + offset) 46*074a1fddSStephen Warren 47*074a1fddSStephen Warren /* GPIOs implemented by AON GPIO controller */ 48*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_S 0 49*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_U 1 50*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_V 2 51*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_W 3 52*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_Z 4 53*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_AA 5 54*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_EE 6 55*074a1fddSStephen Warren #define TEGRA_AON_GPIO_PORT_FF 7 56*074a1fddSStephen Warren 57*074a1fddSStephen Warren #define TEGRA_AON_GPIO(port, offset) \ 58*074a1fddSStephen Warren ((TEGRA_AON_GPIO_PORT_##port * 8) + offset) 59*074a1fddSStephen Warren 60*074a1fddSStephen Warren #endif 61