Skip to content
Commit 81cfdec3 authored by Daniel Wagenknecht's avatar Daniel Wagenknecht Committed by Carles Cufí
Browse files

i2c: stm32_v2: restructure interrupt handling



This patch restructures stm32_i2c_v2 drivers Interrupts:
- NACK failures trigger an I2C event interrupt, so move
handling of NACK failure from error isr to event isr.
- Extract logic of interrupt handling to static functions. Use
isr functions (event & error OR combined) to call these. This
reduces duplication between error isr and combined isr.
- Restructure the error interrupt handling, so that it has no effect
when no errors occured and thus can be called by combined isr.
- Change interrupt logic from if/else to pure ifs for each flag.
This reduces code paths and leads to one call of the isr handling
multiple interrupt conditions, if there's more than one I2C
interrupt flags set.
This is the way it's done e.g. in linux kernels (since 4.14)
drivers/i2c/busses/i2c-stm32f7.c

Signed-off-by: default avatarDaniel Wagenknecht <wagenknecht@clage.de>
parent cc419166
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment