191100Sdes/* SPDX-License-Identifier: GPL-2.0 */
2115619Sdes/*
3228690Sdes * Copyright (c) 2016, NVIDIA CORPORATION.
491100Sdes *
591100Sdes * This header provides constants for binding nvidia,tegra186-gpio*.
691100Sdes *
799158Sdes * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below
899158Sdes * provide names for this.
999158Sdes *
1091100Sdes * The second cell contains standard flag values specified in gpio.h.
1191100Sdes */
1291100Sdes
1391100Sdes#ifndef _DT_BINDINGS_GPIO_TEGRA186_GPIO_H
1491100Sdes#define _DT_BINDINGS_GPIO_TEGRA186_GPIO_H
1591100Sdes
1691100Sdes#include <dt-bindings/gpio/gpio.h>
1791100Sdes
1891100Sdes/* GPIOs implemented by main GPIO controller */
1991100Sdes#define TEGRA_MAIN_GPIO_PORT_A 0
2091100Sdes#define TEGRA_MAIN_GPIO_PORT_B 1
2191100Sdes#define TEGRA_MAIN_GPIO_PORT_C 2
2291100Sdes#define TEGRA_MAIN_GPIO_PORT_D 3
2391100Sdes#define TEGRA_MAIN_GPIO_PORT_E 4
2491100Sdes#define TEGRA_MAIN_GPIO_PORT_F 5
2591100Sdes#define TEGRA_MAIN_GPIO_PORT_G 6
2691100Sdes#define TEGRA_MAIN_GPIO_PORT_H 7
2791100Sdes#define TEGRA_MAIN_GPIO_PORT_I 8
2891100Sdes#define TEGRA_MAIN_GPIO_PORT_J 9
2991100Sdes#define TEGRA_MAIN_GPIO_PORT_K 10
3091100Sdes#define TEGRA_MAIN_GPIO_PORT_L 11
3191100Sdes#define TEGRA_MAIN_GPIO_PORT_M 12
3291100Sdes#define TEGRA_MAIN_GPIO_PORT_N 13
3391100Sdes#define TEGRA_MAIN_GPIO_PORT_O 14
3491100Sdes#define TEGRA_MAIN_GPIO_PORT_P 15
35228690Sdes#define TEGRA_MAIN_GPIO_PORT_Q 16
3691100Sdes#define TEGRA_MAIN_GPIO_PORT_R 17
3791100Sdes#define TEGRA_MAIN_GPIO_PORT_T 18
38228690Sdes#define TEGRA_MAIN_GPIO_PORT_X 19
39228690Sdes#define TEGRA_MAIN_GPIO_PORT_Y 20
40228690Sdes#define TEGRA_MAIN_GPIO_PORT_BB 21
41228690Sdes#define TEGRA_MAIN_GPIO_PORT_CC 22
4291100Sdes
4391100Sdes#define TEGRA_MAIN_GPIO(port, offset) \
4491100Sdes	((TEGRA_MAIN_GPIO_PORT_##port * 8) + offset)
4591100Sdes
4691100Sdes/* GPIOs implemented by AON GPIO controller */
4791100Sdes#define TEGRA_AON_GPIO_PORT_S 0
4891100Sdes#define TEGRA_AON_GPIO_PORT_U 1
4991100Sdes#define TEGRA_AON_GPIO_PORT_V 2
5091100Sdes#define TEGRA_AON_GPIO_PORT_W 3
5191100Sdes#define TEGRA_AON_GPIO_PORT_Z 4
5291100Sdes#define TEGRA_AON_GPIO_PORT_AA 5
5391100Sdes#define TEGRA_AON_GPIO_PORT_EE 6
5491100Sdes#define TEGRA_AON_GPIO_PORT_FF 7
5591100Sdes
5691100Sdes#define TEGRA_AON_GPIO(port, offset) \
5791100Sdes	((TEGRA_AON_GPIO_PORT_##port * 8) + offset)
5891100Sdes
5991100Sdes#endif
6091100Sdes