Dynamic I2C Slave Address Configuration on i.MX95 LPI2C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic I2C Slave Address Configuration on i.MX95 LPI2C

36 Views
arun16598
Contributor II

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:

  1. Does the i.MX95 LPI2C hardware support changing the I2C slave address dynamically at runtime?
  2. Does the NXP BSP/Linux LPI2C slave driver support updating the slave address after boot, or would it require driver modifications?
  3. Is there any recommended mechanism from the SoC or BSP perspective to select the slave address based on an external GPIO before or during slave registration?
  4. Are there any reference implementations or examples demonstrating dynamic I2C slave address configuration?

Any guidance or recommended approach would be appreciated.

BR,

Arun Kumar

0 Kudos
Reply
1 Reply

5 Views
JorgeCas
NXP TechSupport
NXP TechSupport

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.

https://github.com/nxp-imx/linux-imx/blob/b096ce610e956cc2596006343df8a2a26ed6e019/drivers/i2c/busse...

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:

https://github.com/nxp-imx/linux-imx/blob/74521e3f425001c27a54323ee8de4f7c59ee88dc/arch/arm64/boot/d...

Best regards.

0 Kudos
Reply