media: ti-vpe: cal: Refactor interrupt enable/disable
Interrupts are enabled and disabled by the cal_camerarx_enable_irqs() and cal_camerarx_disable_irqs(). Despite their name, they deal with all interrupts, not just the CAMERARX interrupts, and they hardcode the assumption that the context index is identical to the CAMERARX index. Split the context-related interrupt management to two new functions, cal_ctx_enable_irqs() and cal_ctx_disable_irqs(), called from the cal_start_streaming() and cal_stop_streaming() functions. The explicit calls to cal_camerarx_enable_irqs() and cal_camerarx_disable_irqs() are folded with the CAMERARX .s_stream() operation to simplify the CAMERARX API. Enabling the OCPO error interrupt is moved to the PM runtime resume operation, as it's global to the device, not related to a CAMERARX or context. The VC IRQ enable and disable are removed as they're not used, the parent interrupt bit (CAL_HL_IRQ_VC_MASK) never being set. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Please register or sign in to comment