drivers: i2c: i2c_mcux_lpi2c: fix base address declarations

With commit 734adf52c6, the MCUX LPI2C config structure no longer
contains a direct base address pointer. The base address must be
accessed via DEVICE_MMIO_NAMED_GET. Some declarations in the LPCI2C
target mode handler still used the old method of accessing the base
address, causing a build failure. Fix these accesses to use the local
declaration of the "base" variable.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse
2024-01-08 17:45:10 +00:00
parent fe75bb950f
commit 1d7476af5e

View File

@@ -338,7 +338,7 @@ static void mcux_lpi2c_slave_irq_handler(const struct device *dev)
if (flags & kLPI2C_SlaveRxReadyFlag) {
/* RX data is available, read it and issue callback */
i2c_data = (uint8_t)config->base->SRDR;
i2c_data = (uint8_t)base->SRDR;
if (data->first_tx) {
data->first_tx = false;
if (target_cb->write_requested) {
@@ -372,7 +372,7 @@ static void mcux_lpi2c_slave_irq_handler(const struct device *dev)
data->read_active = false;
} else {
/* Send I2C data */
config->base->STDR = i2c_data;
base->STDR = i2c_data;
}
}
} else if (data->read_active) {
@@ -384,7 +384,7 @@ static void mcux_lpi2c_slave_irq_handler(const struct device *dev)
data->read_active = false;
} else {
/* Send I2C data */
config->base->STDR = i2c_data;
base->STDR = i2c_data;
}
}
}