I am looking for some details on how the base gpio number is determined on Jetson TX2 system.
I am adding gpio expander connected to an I2C bus and made required changes to the device tree. The gpio_start is set to -1 in the driver and the GPIO subsystem is assigning gpio numbers automatically. In my case they are starting from 240-255. I would like to know how the number 240 is chosen.
i2c@31c0000 {
pca9555@20 {
compatible = “nxp,pca9555”;
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
gpio-base = <0>; // at the moment driver is not using this as it is deprecated
ngpio = <16>;
};
};
I wanted to set gpio-base property in the device tree and use it in the driver to define the base but this property is deprecated.
Could you provide more details on how the base gpio number is calculated.