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: Support multi-socket devices

On Tegra platforms, multiple SoC instances may be present with each
defining the same GPIO name. For such devices, this results in
duplicate GPIO names.

When the device has a valid NUMA node, prepend the NUMA node ID
to the GPIO name prefix. The node ID identifies each socket,
ensuring GPIO line names remain distinct across multiple sockets.

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

authored by

Prathamesh Shete and committed by
Bartosz Golaszewski
2c299030 2423e336

+13 -3
+13 -3
drivers/gpio/gpio-tegra186.c
··· 857 857 struct device_node *np; 858 858 struct resource *res; 859 859 char **names; 860 - int err; 860 + int node, err; 861 861 862 862 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 863 863 if (!gpio) ··· 937 937 if (!names) 938 938 return -ENOMEM; 939 939 940 + node = dev_to_node(&pdev->dev); 941 + 940 942 for (i = 0, offset = 0; i < gpio->soc->num_ports; i++) { 941 943 const struct tegra_gpio_port *port = &gpio->soc->ports[i]; 942 944 char *name; 943 945 944 946 for (j = 0; j < port->pins; j++) { 945 - name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, "%sP%s.%02x", 946 - gpio->soc->prefix ?: "", port->name, j); 947 + if (node >= 0) 948 + name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, 949 + "%d-%sP%s.%02x", node, 950 + gpio->soc->prefix ?: "", 951 + port->name, j); 952 + else 953 + name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, 954 + "%sP%s.%02x", 955 + gpio->soc->prefix ?: "", 956 + port->name, j); 947 957 if (!name) 948 958 return -ENOMEM; 949 959