media: rcar-vin: Check for correct capture interrupt event
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Mon, 16 Jun 2025 18:57:21 +0000 (20:57 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 18 Jun 2025 07:20:45 +0000 (09:20 +0200)
commit82bdeae10e3e0e88770f34813c7a0c67b1737d5e
tree887ca6fc9b5f978042a910ed32470807a622b56b
parent8e5e3da9c63295e5a21ba70e63f17f2a790529c6
media: rcar-vin: Check for correct capture interrupt event

Depending on if the capture session deals with fields or whole frames
interrupts can be generated at an end of field, or end of frame event.
The interrupt mask is setup to generate an interrupt on one of the two
events depending on what is needed when the VIN is started. The end of
field bit is set in both cases so controlling the mask that generates an
interrupt have been enough to control the two use-cases.

Before extending the interrupt handler to deal with other types of
interrupt events it is needs to extended to "capture complete" check for
correct the use-case in operation. Without this the simplification in
the handler can result in corrupted frames when the mask on what type of
events can generate an interrupt generated can no longer be assumed to
only be an "capture complete" event.

Which bit is checked matches which bit is enabled at configuration time
as which event can generate an interrupt for "capture complete". There
is no functional change.

While at it switch to use the BIT() macro to describe the bit positions
for the interrupt functions.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250616185722.980722-3-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-dma.c