GPIO numbers and sysfs names changed in Jetpack 5/Linux 5.10

Thanks @JerryChang for the link.

To help run user land application from JP4 to JP5, is it possible to make JP5 use the same GPIO number as JP4? I have already copied the same pinmux.cfg file that is used in JP4, but numbers still look different:

When booting my custom board into JP4:

$ sudo dmesg | grep gpiochip
[    0.909357] gpio gpiochip0: gpio-line-names specifies 210 line names but there are 224 lines on the chip
[    0.910792] gpiochip_setup_dev: registered GPIOs 288 to 511 on device: gpiochip0 (tegra-gpio)
[    0.917748] gpio gpiochip1: gpio-line-names specifies 30 line names but there are 40 lines on the chip
[    0.918125] gpiochip_setup_dev: registered GPIOs 248 to 287 on device: gpiochip1 (tegra-gpio-aon)
[    1.059489] gpiochip_setup_dev: registered GPIOs 240 to 247 on device: gpiochip2 (max77620-gpio)

When booting the same board to JP5:

$ sudo dmesg | grep gpiochip
[    3.348027] gpiochip0: registered GPIOs 504 to 511 on max77620-gpio
[    4.851219] gpiochip1: registered GPIOs 335 to 503 on tegra194-gpio
[    4.857926] gpiochip2: registered GPIOs 305 to 334 on tegra194-gpio-aon

eg: for tegra-gpio-aon, JP4 has GPIOs 248 to 287, but JP5 has GPIOs 305 to 334. Not only the numbers are different, the ranges are also different.

If there is no way to configure JP5 GPIO use the same numbering as JP4. Is there a simple number translator? We can then update our user land application to talk to the new GPIO numbers. In JP4, user land application talks to GPIO number 288, 291, 253, 254, 256, 257, 417, 420, 489, 490. What should be the corresponding numbers in JP5?