i2c: mv64xxx: Add atomic_xfer method to driver
authorChris Morgan <macromorgan@hotmail.com>
Wed, 30 Mar 2022 17:16:57 +0000 (12:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:24 +0000 (08:27 +0100)
commit3c8a5648a5916682992496a9b1be02e34c884d30
treec8ccbaebe382ffa2e609c48a2d4a5cc1fcf2cd6b
parente619ab4fb3e91d72e427650c068a124a0e66d5b6
i2c: mv64xxx: Add atomic_xfer method to driver

commit 544a8d75f3d6e60e160cd92dc56321484598a993 upstream.

Add an atomic_xfer method to the driver so that it behaves correctly
when controlling a PMIC that is responsible for device shutdown.

The atomic_xfer method added is similar to the one from the i2c-rk3x
driver. When running an atomic_xfer a bool flag in the driver data is
set, the interrupt is not unmasked on transfer start, and the IRQ
handler is manually invoked while waiting for pending transfers to
complete.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Cc: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-mv64xxx.c