Skip to content

Commit 569a04e

Browse files
Prathamesh Shetenirmoy
authored andcommitted
gpio: tegra186: Add support for Tegra410
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra410. Tegra410 supports two GPIO controllers referred to as 'COMPUTE' and 'SYSTEM'. Co-developed-by: Nathan Hartman <nhartman@nvidia.com> Signed-off-by: Nathan Hartman <nhartman@nvidia.com> Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> (cherry picked from commit 9631a10) Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
1 parent 0d506ea commit 569a04e

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

drivers/gpio/gpio-tegra186.c

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2016-2022 NVIDIA Corporation
3+
* Copyright (c) 2016-2025 NVIDIA Corporation
44
*
55
* Author: Thierry Reding <treding@nvidia.com>
66
* Dipen Patel <dpatel@nvidia.com>
@@ -69,6 +69,30 @@
6969

7070
#define TEGRA186_GPIO_INTERRUPT_STATUS(x) (0x100 + (x) * 4)
7171

72+
/* Tegra410 GPIOs implemented by the COMPUTE GPIO controller */
73+
#define TEGRA410_COMPUTE_GPIO_PORT_A 0
74+
#define TEGRA410_COMPUTE_GPIO_PORT_B 1
75+
#define TEGRA410_COMPUTE_GPIO_PORT_C 2
76+
#define TEGRA410_COMPUTE_GPIO_PORT_D 3
77+
#define TEGRA410_COMPUTE_GPIO_PORT_E 4
78+
79+
/* Tegra410 GPIOs implemented by the SYSTEM GPIO controller */
80+
#define TEGRA410_SYSTEM_GPIO_PORT_A 0
81+
#define TEGRA410_SYSTEM_GPIO_PORT_B 1
82+
#define TEGRA410_SYSTEM_GPIO_PORT_C 2
83+
#define TEGRA410_SYSTEM_GPIO_PORT_D 3
84+
#define TEGRA410_SYSTEM_GPIO_PORT_E 4
85+
#define TEGRA410_SYSTEM_GPIO_PORT_I 5
86+
#define TEGRA410_SYSTEM_GPIO_PORT_J 6
87+
#define TEGRA410_SYSTEM_GPIO_PORT_K 7
88+
#define TEGRA410_SYSTEM_GPIO_PORT_L 8
89+
#define TEGRA410_SYSTEM_GPIO_PORT_M 9
90+
#define TEGRA410_SYSTEM_GPIO_PORT_N 10
91+
#define TEGRA410_SYSTEM_GPIO_PORT_P 11
92+
#define TEGRA410_SYSTEM_GPIO_PORT_Q 12
93+
#define TEGRA410_SYSTEM_GPIO_PORT_R 13
94+
#define TEGRA410_SYSTEM_GPIO_PORT_V 14
95+
7296
struct tegra_gpio_port {
7397
const char *name;
7498
unsigned int bank;
@@ -1267,6 +1291,54 @@ static const struct tegra_gpio_soc tegra256_main_soc = {
12671291
.has_vm_support = true,
12681292
};
12691293

1294+
#define TEGRA410_COMPUTE_GPIO_PORT(_name, _bank, _port, _pins) \
1295+
TEGRA_GPIO_PORT(TEGRA410_COMPUTE, _name, _bank, _port, _pins)
1296+
1297+
static const struct tegra_gpio_port tegra410_compute_ports[] = {
1298+
TEGRA410_COMPUTE_GPIO_PORT(A, 0, 0, 3),
1299+
TEGRA410_COMPUTE_GPIO_PORT(B, 1, 0, 8),
1300+
TEGRA410_COMPUTE_GPIO_PORT(C, 1, 1, 3),
1301+
TEGRA410_COMPUTE_GPIO_PORT(D, 2, 0, 8),
1302+
TEGRA410_COMPUTE_GPIO_PORT(E, 2, 1, 8),
1303+
};
1304+
1305+
static const struct tegra_gpio_soc tegra410_compute_soc = {
1306+
.num_ports = ARRAY_SIZE(tegra410_compute_ports),
1307+
.ports = tegra410_compute_ports,
1308+
.name = "tegra410-gpio-compute",
1309+
.num_irqs_per_bank = 8,
1310+
.instance = 0,
1311+
};
1312+
1313+
#define TEGRA410_SYSTEM_GPIO_PORT(_name, _bank, _port, _pins) \
1314+
TEGRA_GPIO_PORT(TEGRA410_SYSTEM, _name, _bank, _port, _pins)
1315+
1316+
static const struct tegra_gpio_port tegra410_system_ports[] = {
1317+
TEGRA410_SYSTEM_GPIO_PORT(A, 0, 0, 7),
1318+
TEGRA410_SYSTEM_GPIO_PORT(B, 0, 1, 8),
1319+
TEGRA410_SYSTEM_GPIO_PORT(C, 0, 2, 8),
1320+
TEGRA410_SYSTEM_GPIO_PORT(D, 0, 3, 8),
1321+
TEGRA410_SYSTEM_GPIO_PORT(E, 0, 4, 6),
1322+
TEGRA410_SYSTEM_GPIO_PORT(I, 1, 0, 8),
1323+
TEGRA410_SYSTEM_GPIO_PORT(J, 1, 1, 7),
1324+
TEGRA410_SYSTEM_GPIO_PORT(K, 1, 2, 7),
1325+
TEGRA410_SYSTEM_GPIO_PORT(L, 1, 3, 7),
1326+
TEGRA410_SYSTEM_GPIO_PORT(M, 2, 0, 7),
1327+
TEGRA410_SYSTEM_GPIO_PORT(N, 2, 1, 6),
1328+
TEGRA410_SYSTEM_GPIO_PORT(P, 2, 2, 8),
1329+
TEGRA410_SYSTEM_GPIO_PORT(Q, 2, 3, 3),
1330+
TEGRA410_SYSTEM_GPIO_PORT(R, 2, 4, 2),
1331+
TEGRA410_SYSTEM_GPIO_PORT(V, 1, 4, 2),
1332+
};
1333+
1334+
static const struct tegra_gpio_soc tegra410_system_soc = {
1335+
.num_ports = ARRAY_SIZE(tegra410_system_ports),
1336+
.ports = tegra410_system_ports,
1337+
.name = "tegra410-gpio-system",
1338+
.num_irqs_per_bank = 8,
1339+
.instance = 0,
1340+
};
1341+
12701342
static const struct of_device_id tegra186_gpio_of_match[] = {
12711343
{
12721344
.compatible = "nvidia,tegra186-gpio",
@@ -1302,6 +1374,8 @@ static const struct acpi_device_id tegra186_gpio_acpi_match[] = {
13021374
{ .id = "NVDA0408", .driver_data = (kernel_ulong_t)&tegra194_aon_soc },
13031375
{ .id = "NVDA0508", .driver_data = (kernel_ulong_t)&tegra241_main_soc },
13041376
{ .id = "NVDA0608", .driver_data = (kernel_ulong_t)&tegra241_aon_soc },
1377+
{ .id = "NVDA0708", .driver_data = (kernel_ulong_t)&tegra410_compute_soc },
1378+
{ .id = "NVDA0808", .driver_data = (kernel_ulong_t)&tegra410_system_soc },
13051379
{}
13061380
};
13071381
MODULE_DEVICE_TABLE(acpi, tegra186_gpio_acpi_match);

0 commit comments

Comments
 (0)