i2c: lpi2c: implement xfer_atomic callback
authorEmanuele Ghidoli <emanuele.ghidoli@toradex.com>
Fri, 18 Jul 2025 13:34:29 +0000 (15:34 +0200)
committerAndi Shyti <andi.shyti@linux.intel.com>
Fri, 25 Jul 2025 21:15:39 +0000 (23:15 +0200)
commit85b9dd6e90b92f5cb7c47991421ceb4925ba2a87
treef1720eb8813e7bda43501a07942d28c22174076b
parent8336f9de21f73bf4e7b4c2d641d82cd2f9b53e39
i2c: lpi2c: implement xfer_atomic callback

Rework the read and write code paths in the driver to support operation
in atomic contexts. To achieve this, the driver must not rely on IRQs
or perform any scheduling, e.g., via a sleep or schedule routine.

Implement atomic, sleep-free, and IRQ-less operation. This increases
complexity but is necessary for atomic I2C transfers required by some
hardware configurations, e.g., to trigger reboots on an external PMIC chip.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Carlos Song <carlos.song@nxp.com>
Tested-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250718133429.67219-3-francesco@dolcini.it
drivers/i2c/busses/i2c-imx-lpi2c.c