• Laurent Pinchart's avatar
    media: ti-vpe: cal: Refactor interrupt enable/disable · 75c80311
    Laurent Pinchart authored
    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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: default avatarBenoit Parrot <bparrot@ti.com>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    75c80311
cal-camerarx.c 23.9 KB