linux-yocto/drivers/i2c
Clément Le Goffic 6aae87fe7f i2c: stm32f7: unmap DMA mapped buffer
Before each I2C transfer using DMA, the I2C buffer is DMA'pped to make
sure the memory buffer is DMA'able. This is handle in the function
`stm32_i2c_prep_dma_xfer()`.
If the transfer fails for any reason the I2C buffer must be unmap.
Use the dma_callback to factorize the code and fix this issue.

Note that the `stm32f7_i2c_dma_callback()` is now called in case of DMA
transfer success and error and that the `complete()` on the dma_complete
completion structure is done inconditionnally in case of transfer
success or error as well as the `dmaengine_terminate_async()`.
This is allowed as a `complete()` in case transfer error has no effect
as well as a `dmaengine_terminate_async()` on a transfer success.

Also fix the unneeded cast and remove not more needed variables.

Fixes: 7ecc8cfde5 ("i2c: i2c-stm32f7: Add DMA support")
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Cc: <stable@vger.kernel.org> # v4.18+
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250704-i2c-upstream-v4-2-84a095a2c728@foss.st.com
2025-07-10 11:58:33 +02:00
..
algos i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
busses i2c: stm32f7: unmap DMA mapped buffer 2025-07-10 11:58:33 +02:00
muxes i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-atr.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz 2025-01-14 13:01:31 +01:00
i2c-core-base.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02:00
i2c-core-of-prober.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-core-of.c i2c: core: Do not dereference fwnode in struct device 2025-04-16 18:08:32 +02:00
i2c-core-slave.c i2c: core: Unify the firmware node type check 2025-04-16 18:05:47 +02:00
i2c-core-smbus.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02:00
i2c-core.h i2c: Unexport i2c_of_match_device() 2025-02-13 16:47:52 +01:00
i2c-dev.c i2c: dev: Fix memory leak when underlying adapter does not support I2C 2024-11-14 11:22:57 +01:00
i2c-mux.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-slave-eeprom.c i2c: slave-eeprom: Constify 'struct bin_attribute' 2025-01-09 10:48:44 +01:00
i2c-slave-testunit.c i2c: testunit: on errors, repeat NACK until STOP 2025-01-15 19:44:21 +01:00
i2c-smbus.c i2c: smbus: introduce Write Disable-aware SPD instantiating functions 2025-05-19 22:23:57 +02:00
i2c-stub.c
Kconfig i2c: Remove I2C_COMPAT config symbol and related code 2024-09-07 18:31:28 +02:00
Makefile i2c: Introduce OF component probe function 2024-11-27 12:04:10 +01:00