i2c: core: introduce callbacks for atomic transfers
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 3 Apr 2019 12:40:10 +0000 (14:40 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 16 Apr 2019 11:08:11 +0000 (13:08 +0200)
commit63b96983a5ddfedd7daea72dbbc08ea873c54f27
treedcb74bf00cfff708620b95b6e0d1e7328f8d2106
parent83c42212d2544625b85f44a07d0ad96323e69250
i2c: core: introduce callbacks for atomic transfers

We had the request to access devices very late when interrupts are not
available anymore multiple times now. Mostly to prepare shutdown or
reboot. Allow adapters to specify a specific callback for this case.
Note that we fall back to the generic {master|smbus}_xfer callback if
this new atomic one is not present. This is intentional to preserve the
previous behaviour and avoid regressions. Because there are drivers not
using interrupts or because it might have worked "accidently" before.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Stefan Lengfeld <contact@stefanchrist.eu>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c
drivers/i2c/i2c-core-smbus.c
drivers/i2c/i2c-core.h
include/linux/i2c.h