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