|
1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
2 | 2 | /* |
3 | | - * Copyright (c) 2016-2025 NVIDIA Corporation |
| 3 | + * Copyright (c) 2016-2026 NVIDIA Corporation |
4 | 4 | * |
5 | 5 | * Author: Thierry Reding <treding@nvidia.com> |
6 | 6 | * Dipen Patel <dpatel@nvidia.com> |
|
21 | 21 | #include <dt-bindings/gpio/tegra234-gpio.h> |
22 | 22 | #include <dt-bindings/gpio/tegra241-gpio.h> |
23 | 23 | #include <dt-bindings/gpio/tegra256-gpio.h> |
| 24 | +#include <dt-bindings/gpio/nvidia,tegra264-gpio.h> |
24 | 25 |
|
25 | 26 | /* security registers */ |
26 | 27 | #define TEGRA186_GPIO_CTL_SCR 0x0c |
@@ -1001,7 +1002,9 @@ static int tegra186_gpio_probe(struct platform_device *pdev) |
1001 | 1002 | if (gpio->soc->num_irqs_per_bank > 1) |
1002 | 1003 | tegra186_gpio_init_route_mapping(gpio); |
1003 | 1004 |
|
1004 | | - np = of_find_matching_node(NULL, tegra186_pmc_of_match); |
| 1005 | + np = of_parse_phandle(pdev->dev.of_node, "wakeup-parent", 0); |
| 1006 | + if (!np) |
| 1007 | + np = of_find_matching_node(NULL, tegra186_pmc_of_match); |
1005 | 1008 | if (np) { |
1006 | 1009 | if (of_device_is_available(np)) { |
1007 | 1010 | irq->parent_domain = irq_find_host(np); |
@@ -1277,6 +1280,80 @@ static const struct tegra_gpio_soc tegra241_aon_soc = { |
1277 | 1280 | .has_vm_support = false, |
1278 | 1281 | }; |
1279 | 1282 |
|
| 1283 | +#define TEGRA264_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \ |
| 1284 | + TEGRA_GPIO_PORT(TEGRA264_MAIN, _name, _bank, _port, _pins) |
| 1285 | + |
| 1286 | +static const struct tegra_gpio_port tegra264_main_ports[] = { |
| 1287 | + TEGRA264_MAIN_GPIO_PORT(F, 3, 0, 8), |
| 1288 | + TEGRA264_MAIN_GPIO_PORT(G, 3, 1, 5), |
| 1289 | + TEGRA264_MAIN_GPIO_PORT(H, 1, 0, 8), |
| 1290 | + TEGRA264_MAIN_GPIO_PORT(J, 1, 1, 8), |
| 1291 | + TEGRA264_MAIN_GPIO_PORT(K, 1, 2, 8), |
| 1292 | + TEGRA264_MAIN_GPIO_PORT(L, 1, 3, 8), |
| 1293 | + TEGRA264_MAIN_GPIO_PORT(M, 1, 4, 6), |
| 1294 | + TEGRA264_MAIN_GPIO_PORT(P, 2, 0, 8), |
| 1295 | + TEGRA264_MAIN_GPIO_PORT(Q, 2, 1, 8), |
| 1296 | + TEGRA264_MAIN_GPIO_PORT(R, 2, 2, 8), |
| 1297 | + TEGRA264_MAIN_GPIO_PORT(S, 2, 3, 2), |
| 1298 | + TEGRA264_MAIN_GPIO_PORT(T, 0, 0, 7), |
| 1299 | + TEGRA264_MAIN_GPIO_PORT(U, 0, 1, 8), |
| 1300 | + TEGRA264_MAIN_GPIO_PORT(V, 0, 2, 8), |
| 1301 | + TEGRA264_MAIN_GPIO_PORT(W, 0, 3, 8), |
| 1302 | + TEGRA264_MAIN_GPIO_PORT(X, 0, 7, 6), |
| 1303 | + TEGRA264_MAIN_GPIO_PORT(Y, 0, 5, 8), |
| 1304 | + TEGRA264_MAIN_GPIO_PORT(Z, 0, 6, 8), |
| 1305 | + TEGRA264_MAIN_GPIO_PORT(AL, 0, 4, 3), |
| 1306 | +}; |
| 1307 | + |
| 1308 | +static const struct tegra_gpio_soc tegra264_main_soc = { |
| 1309 | + .num_ports = ARRAY_SIZE(tegra264_main_ports), |
| 1310 | + .ports = tegra264_main_ports, |
| 1311 | + .name = "tegra264-gpio", |
| 1312 | + .instance = 0, |
| 1313 | + .num_irqs_per_bank = 8, |
| 1314 | + .has_vm_support = true, |
| 1315 | +}; |
| 1316 | + |
| 1317 | +#define TEGRA264_AON_GPIO_PORT(_name, _bank, _port, _pins) \ |
| 1318 | + TEGRA_GPIO_PORT(TEGRA264_AON, _name, _bank, _port, _pins) |
| 1319 | + |
| 1320 | +static const struct tegra_gpio_port tegra264_aon_ports[] = { |
| 1321 | + TEGRA264_AON_GPIO_PORT(AA, 0, 0, 8), |
| 1322 | + TEGRA264_AON_GPIO_PORT(BB, 0, 1, 2), |
| 1323 | + TEGRA264_AON_GPIO_PORT(CC, 0, 2, 8), |
| 1324 | + TEGRA264_AON_GPIO_PORT(DD, 0, 3, 8), |
| 1325 | + TEGRA264_AON_GPIO_PORT(EE, 0, 4, 4) |
| 1326 | +}; |
| 1327 | + |
| 1328 | +static const struct tegra_gpio_soc tegra264_aon_soc = { |
| 1329 | + .num_ports = ARRAY_SIZE(tegra264_aon_ports), |
| 1330 | + .ports = tegra264_aon_ports, |
| 1331 | + .name = "tegra264-gpio-aon", |
| 1332 | + .instance = 1, |
| 1333 | + .num_irqs_per_bank = 8, |
| 1334 | + .has_vm_support = true, |
| 1335 | +}; |
| 1336 | + |
| 1337 | +#define TEGRA264_UPHY_GPIO_PORT(_name, _bank, _port, _pins) \ |
| 1338 | + TEGRA_GPIO_PORT(TEGRA264_UPHY, _name, _bank, _port, _pins) |
| 1339 | + |
| 1340 | +static const struct tegra_gpio_port tegra264_uphy_ports[] = { |
| 1341 | + TEGRA264_UPHY_GPIO_PORT(A, 0, 0, 6), |
| 1342 | + TEGRA264_UPHY_GPIO_PORT(B, 0, 1, 8), |
| 1343 | + TEGRA264_UPHY_GPIO_PORT(C, 0, 2, 3), |
| 1344 | + TEGRA264_UPHY_GPIO_PORT(D, 1, 0, 8), |
| 1345 | + TEGRA264_UPHY_GPIO_PORT(E, 1, 1, 4), |
| 1346 | +}; |
| 1347 | + |
| 1348 | +static const struct tegra_gpio_soc tegra264_uphy_soc = { |
| 1349 | + .num_ports = ARRAY_SIZE(tegra264_uphy_ports), |
| 1350 | + .ports = tegra264_uphy_ports, |
| 1351 | + .name = "tegra264-gpio-uphy", |
| 1352 | + .instance = 2, |
| 1353 | + .num_irqs_per_bank = 8, |
| 1354 | + .has_vm_support = true, |
| 1355 | +}; |
| 1356 | + |
1280 | 1357 | #define TEGRA256_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \ |
1281 | 1358 | TEGRA_GPIO_PORT(TEGRA256_MAIN, _name, _bank, _port, _pins) |
1282 | 1359 |
|
@@ -1368,6 +1445,15 @@ static const struct of_device_id tegra186_gpio_of_match[] = { |
1368 | 1445 | }, { |
1369 | 1446 | .compatible = "nvidia,tegra256-gpio", |
1370 | 1447 | .data = &tegra256_main_soc |
| 1448 | + }, { |
| 1449 | + .compatible = "nvidia,tegra264-gpio", |
| 1450 | + .data = &tegra264_main_soc |
| 1451 | + }, { |
| 1452 | + .compatible = "nvidia,tegra264-gpio-aon", |
| 1453 | + .data = &tegra264_aon_soc |
| 1454 | + }, { |
| 1455 | + .compatible = "nvidia,tegra264-gpio-uphy", |
| 1456 | + .data = &tegra264_uphy_soc |
1371 | 1457 | }, { |
1372 | 1458 | /* sentinel */ |
1373 | 1459 | } |
|
0 commit comments