Commit 3a5ee18d authored by Stefan Lengfeld's avatar Stefan Lengfeld Committed by Wolfram Sang

i2c: imx: implement master_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
and not call schedule(), e.g. via a sleep routine, in these cases.

With this patch the driver supports normal operation, DMA transfers and
now the polling mode or also called sleep-free or IRQ-less operation. It
makes the code not simpler or easier to read, but atomic I2C transfers
are needed on some hardware configurations, e.g. to trigger reboots on
an external PMIC chip.
Signed-off-by: default avatarStefan Lengfeld <contact@stefanchrist.eu>
[m.felsch@pengutronix.de: integrate https://patchwork.ozlabs.org/patch/1085943/ review feedback]
[m.felsch@pengutronix.de: adapt commit message]
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarStefan Agner <stefan@agner.ch>
Tested-by: default avatarStefan Lengfeld <contact@stefanchrist.eu>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent d3d3fdcc
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment