Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpio: tegra186: Add support for Tegra264

Extend the existing Tegra186 GPIO controller driver with support for the
GPIO controller found on Tegra264.

Use the "wakeup-parent" phandle from the GPIO device tree node to
ensure the GPIO driver associates with the intended PMC device.
Relying only on compatible-based lookup can select an unexpected
PMC node, so fall back to compatible-based lookup when the phandle
is not present.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260128085114.1137725-2-pshete@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Prathamesh Shete and committed by
Bartosz Golaszewski
af9b4a56 b565717e

+88 -2
+88 -2
drivers/gpio/gpio-tegra186.c
··· 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 ··· 1002 1001 if (gpio->soc->num_irqs_per_bank > 1) 1003 1002 tegra186_gpio_init_route_mapping(gpio); 1004 1003 1005 - np = of_find_matching_node(NULL, tegra186_pmc_of_match); 1004 + np = of_parse_phandle(pdev->dev.of_node, "wakeup-parent", 0); 1005 + if (!np) 1006 + np = of_find_matching_node(NULL, tegra186_pmc_of_match); 1006 1007 if (np) { 1007 1008 if (of_device_is_available(np)) { 1008 1009 irq->parent_domain = irq_find_host(np); ··· 1280 1277 .has_vm_support = false, 1281 1278 }; 1282 1279 1280 + #define TEGRA264_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \ 1281 + TEGRA_GPIO_PORT(TEGRA264_MAIN, _name, _bank, _port, _pins) 1282 + 1283 + static const struct tegra_gpio_port tegra264_main_ports[] = { 1284 + TEGRA264_MAIN_GPIO_PORT(F, 3, 0, 8), 1285 + TEGRA264_MAIN_GPIO_PORT(G, 3, 1, 5), 1286 + TEGRA264_MAIN_GPIO_PORT(H, 1, 0, 8), 1287 + TEGRA264_MAIN_GPIO_PORT(J, 1, 1, 8), 1288 + TEGRA264_MAIN_GPIO_PORT(K, 1, 2, 8), 1289 + TEGRA264_MAIN_GPIO_PORT(L, 1, 3, 8), 1290 + TEGRA264_MAIN_GPIO_PORT(M, 1, 4, 6), 1291 + TEGRA264_MAIN_GPIO_PORT(P, 2, 0, 8), 1292 + TEGRA264_MAIN_GPIO_PORT(Q, 2, 1, 8), 1293 + TEGRA264_MAIN_GPIO_PORT(R, 2, 2, 8), 1294 + TEGRA264_MAIN_GPIO_PORT(S, 2, 3, 2), 1295 + TEGRA264_MAIN_GPIO_PORT(T, 0, 0, 7), 1296 + TEGRA264_MAIN_GPIO_PORT(U, 0, 1, 8), 1297 + TEGRA264_MAIN_GPIO_PORT(V, 0, 2, 8), 1298 + TEGRA264_MAIN_GPIO_PORT(W, 0, 3, 8), 1299 + TEGRA264_MAIN_GPIO_PORT(X, 0, 7, 6), 1300 + TEGRA264_MAIN_GPIO_PORT(Y, 0, 5, 8), 1301 + TEGRA264_MAIN_GPIO_PORT(Z, 0, 6, 8), 1302 + TEGRA264_MAIN_GPIO_PORT(AL, 0, 4, 3), 1303 + }; 1304 + 1305 + static const struct tegra_gpio_soc tegra264_main_soc = { 1306 + .num_ports = ARRAY_SIZE(tegra264_main_ports), 1307 + .ports = tegra264_main_ports, 1308 + .name = "tegra264-gpio", 1309 + .instance = 0, 1310 + .num_irqs_per_bank = 8, 1311 + .has_vm_support = true, 1312 + }; 1313 + 1314 + #define TEGRA264_AON_GPIO_PORT(_name, _bank, _port, _pins) \ 1315 + TEGRA_GPIO_PORT(TEGRA264_AON, _name, _bank, _port, _pins) 1316 + 1317 + static const struct tegra_gpio_port tegra264_aon_ports[] = { 1318 + TEGRA264_AON_GPIO_PORT(AA, 0, 0, 8), 1319 + TEGRA264_AON_GPIO_PORT(BB, 0, 1, 2), 1320 + TEGRA264_AON_GPIO_PORT(CC, 0, 2, 8), 1321 + TEGRA264_AON_GPIO_PORT(DD, 0, 3, 8), 1322 + TEGRA264_AON_GPIO_PORT(EE, 0, 4, 4) 1323 + }; 1324 + 1325 + static const struct tegra_gpio_soc tegra264_aon_soc = { 1326 + .num_ports = ARRAY_SIZE(tegra264_aon_ports), 1327 + .ports = tegra264_aon_ports, 1328 + .name = "tegra264-gpio-aon", 1329 + .instance = 1, 1330 + .num_irqs_per_bank = 8, 1331 + .has_vm_support = true, 1332 + }; 1333 + 1334 + #define TEGRA264_UPHY_GPIO_PORT(_name, _bank, _port, _pins) \ 1335 + TEGRA_GPIO_PORT(TEGRA264_UPHY, _name, _bank, _port, _pins) 1336 + 1337 + static const struct tegra_gpio_port tegra264_uphy_ports[] = { 1338 + TEGRA264_UPHY_GPIO_PORT(A, 0, 0, 6), 1339 + TEGRA264_UPHY_GPIO_PORT(B, 0, 1, 8), 1340 + TEGRA264_UPHY_GPIO_PORT(C, 0, 2, 3), 1341 + TEGRA264_UPHY_GPIO_PORT(D, 1, 0, 8), 1342 + TEGRA264_UPHY_GPIO_PORT(E, 1, 1, 4), 1343 + }; 1344 + 1345 + static const struct tegra_gpio_soc tegra264_uphy_soc = { 1346 + .num_ports = ARRAY_SIZE(tegra264_uphy_ports), 1347 + .ports = tegra264_uphy_ports, 1348 + .name = "tegra264-gpio-uphy", 1349 + .instance = 2, 1350 + .num_irqs_per_bank = 8, 1351 + .has_vm_support = true, 1352 + }; 1353 + 1283 1354 #define TEGRA256_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \ 1284 1355 TEGRA_GPIO_PORT(TEGRA256_MAIN, _name, _bank, _port, _pins) 1285 1356 ··· 1445 1368 }, { 1446 1369 .compatible = "nvidia,tegra256-gpio", 1447 1370 .data = &tegra256_main_soc 1371 + }, { 1372 + .compatible = "nvidia,tegra264-gpio", 1373 + .data = &tegra264_main_soc 1374 + }, { 1375 + .compatible = "nvidia,tegra264-gpio-aon", 1376 + .data = &tegra264_aon_soc 1377 + }, { 1378 + .compatible = "nvidia,tegra264-gpio-uphy", 1379 + .data = &tegra264_uphy_soc 1448 1380 }, { 1449 1381 /* sentinel */ 1450 1382 }