Skip to content

Commit b565717

Browse files
Prathamesh SheteBartosz Golaszewski
authored andcommitted
dt-bindings: gpio: Add Tegra264 support
Extend the existing Tegra186 GPIO controller device tree bindings with support for the GPIO controller found on Tegra264. The number of pins is slightly different, but the programming model remains the same. Add a new header, include/dt-bindings/gpio/nvidia,tegra264-gpio.h, that defines port IDs as well as the TEGRA264_MAIN_GPIO() helper, both of which are used in conjunction to create a unique specifier for each pin. On Tegra, GPIO wake events are latched and routed via the PMC. Document the standard DT property, wakeup-parent, which is a phandle to the PMC interrupt controller that provides the parent wake interrupt domain for the GPIO controller. If the property is absent the driver falls back to a compatible-based lookup. Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20260128085114.1137725-1-pshete@nvidia.com [Bartosz: fixed whitespace errors] Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent aa7e37f commit b565717

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ properties:
8686
- nvidia,tegra234-gpio
8787
- nvidia,tegra234-gpio-aon
8888
- nvidia,tegra256-gpio
89+
- nvidia,tegra264-gpio
90+
- nvidia,tegra264-gpio-uphy
91+
- nvidia,tegra264-gpio-aon
8992

9093
reg-names:
9194
items:
@@ -110,6 +113,10 @@ properties:
110113
ports, in the order the HW manual describes them. The number of entries
111114
required varies depending on compatible value.
112115

116+
wakeup-parent:
117+
description: Phandle to the parent interrupt controller used for wake-up. On
118+
Tegra, this typically references the PMC interrupt controller.
119+
113120
gpio-controller: true
114121

115122
gpio-ranges:
@@ -157,6 +164,8 @@ allOf:
157164
- nvidia,tegra194-gpio
158165
- nvidia,tegra234-gpio
159166
- nvidia,tegra256-gpio
167+
- nvidia,tegra264-gpio
168+
- nvidia,tegra264-gpio-uphy
160169
then:
161170
properties:
162171
interrupts:
@@ -171,12 +180,25 @@ allOf:
171180
- nvidia,tegra186-gpio-aon
172181
- nvidia,tegra194-gpio-aon
173182
- nvidia,tegra234-gpio-aon
183+
- nvidia,tegra264-gpio-aon
174184
then:
175185
properties:
176186
interrupts:
177187
minItems: 1
178188
maxItems: 4
179189

190+
- if:
191+
properties:
192+
compatible:
193+
contains:
194+
enum:
195+
- nvidia,tegra264-gpio
196+
- nvidia,tegra264-gpio-uphy
197+
- nvidia,tegra264-gpio-aon
198+
then:
199+
required:
200+
- wakeup-parent
201+
180202
required:
181203
- compatible
182204
- reg
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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,tegra264-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_TEGRA264_GPIO_H
14+
#define _DT_BINDINGS_GPIO_TEGRA264_GPIO_H
15+
16+
#include <dt-bindings/gpio/gpio.h>
17+
18+
/* GPIOs implemented by main GPIO controller */
19+
#define TEGRA264_MAIN_GPIO_PORT_T 0
20+
#define TEGRA264_MAIN_GPIO_PORT_U 1
21+
#define TEGRA264_MAIN_GPIO_PORT_V 2
22+
#define TEGRA264_MAIN_GPIO_PORT_W 3
23+
#define TEGRA264_MAIN_GPIO_PORT_AL 4
24+
#define TEGRA264_MAIN_GPIO_PORT_Y 5
25+
#define TEGRA264_MAIN_GPIO_PORT_Z 6
26+
#define TEGRA264_MAIN_GPIO_PORT_X 7
27+
#define TEGRA264_MAIN_GPIO_PORT_H 8
28+
#define TEGRA264_MAIN_GPIO_PORT_J 9
29+
#define TEGRA264_MAIN_GPIO_PORT_K 10
30+
#define TEGRA264_MAIN_GPIO_PORT_L 11
31+
#define TEGRA264_MAIN_GPIO_PORT_M 12
32+
#define TEGRA264_MAIN_GPIO_PORT_P 13
33+
#define TEGRA264_MAIN_GPIO_PORT_Q 14
34+
#define TEGRA264_MAIN_GPIO_PORT_R 15
35+
#define TEGRA264_MAIN_GPIO_PORT_S 16
36+
#define TEGRA264_MAIN_GPIO_PORT_F 17
37+
#define TEGRA264_MAIN_GPIO_PORT_G 18
38+
39+
#define TEGRA264_MAIN_GPIO(port, offset) \
40+
((TEGRA264_MAIN_GPIO_PORT_##port * 8) + (offset))
41+
42+
/* GPIOs implemented by AON GPIO controller */
43+
#define TEGRA264_AON_GPIO_PORT_AA 0
44+
#define TEGRA264_AON_GPIO_PORT_BB 1
45+
#define TEGRA264_AON_GPIO_PORT_CC 2
46+
#define TEGRA264_AON_GPIO_PORT_DD 3
47+
#define TEGRA264_AON_GPIO_PORT_EE 4
48+
49+
#define TEGRA264_AON_GPIO(port, offset) \
50+
((TEGRA264_AON_GPIO_PORT_##port * 8) + (offset))
51+
52+
#define TEGRA264_UPHY_GPIO_PORT_A 0
53+
#define TEGRA264_UPHY_GPIO_PORT_B 1
54+
#define TEGRA264_UPHY_GPIO_PORT_C 2
55+
#define TEGRA264_UPHY_GPIO_PORT_D 3
56+
#define TEGRA264_UPHY_GPIO_PORT_E 4
57+
58+
#define TEGRA264_UPHY_GPIO(port, offset) \
59+
((TEGRA264_UPHY_GPIO_PORT_##port * 8) + (offset))
60+
61+
#endif

0 commit comments

Comments
 (0)