Hello Experts,
I am working on the i.MX95 platform and using the LPI2C controller in I2C slave mode under Linux.
Currently, the I2C slave address is defined statically in the Device Tree. My requirement is to determine the slave address dynamically based on an external GPIO input (for example, a board ID or address-select GPIO) instead of hardcoding it in the Device Tree.
I would like to know:
Any guidance or recommended approach would be appreciated.
BR,
Arun Kumar
Hello,
1. Yes, is possible with LPI2C module of i.MX95.
2. No, driver modifications are needed.
The current NXP BSP Linux driver supports both master and slave modes but, the slave address is read once from the Device Tree.
3. The best approach for this modify driver to read the GPIO address and change line during probe.
4. We have an slave DTS example that uses i2c-imx-lpi2c.c driver but the address cannot be changed in runtime using GPIOs. You can take a look in the next link:
Best regards.