]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: spacemit: introduce pio for k1
authorTroy Mitchell <troy.mitchell@linux.spacemit.com>
Sat, 7 Feb 2026 15:08:22 +0000 (23:08 +0800)
committerAndi Shyti <andi.shyti@kernel.org>
Thu, 9 Apr 2026 16:33:55 +0000 (18:33 +0200)
commit5dd75dac1b35e5b24f5051d01fc85105adcc2e15
tree30f5edd5f5de85ccbc2895e49049dba9c9e4cab2
parent5b74da8e6cf7e2b5aed0836c733238c0fd7235af
i2c: spacemit: introduce pio for k1

This patch introduces I2C PIO functionality for the Spacemit K1 SoC,
enabling the use of I2C in atomic context.

When i2c xfer_atomic is invoked, use_pio is set accordingly.

Since an atomic context is required, all interrupts are disabled when
operating in PIO mode. Even with interrupts disabled, the bits in the
ISR (Interrupt Status Register) will still be set, so error handling can
be performed by polling the relevant status bits in the ISR.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260207-b4-k3-i2c-pio-v7-2-626942d94d91@linux.spacemit.com
drivers/i2c/busses/i2c-k1.c