• Laurent Pinchart's avatar
    media: rkisp1: Configure LSC after enabling the ISP · 4b07e2b8
    Laurent Pinchart authored
    The ISP8000Nano v18.02 (found in the i.MX8MP) requires the ISP to be
    enabled (as indicated by the ISP_CTRL.ISP_ENABLE bit) to configure the
    lens shading table in internal RAM. The driver currently configures all
    ISP initial parameters before enabling the ISP, which causes the LSC RAM
    to not be initialized properly.
    
    To fix this, split the rkisp1_params_configure() function into a
    rkisp1_params_pre_configure() and a rkisp1_params_post_configure(). The
    former configures all ISP parameters but LSC, while the latter
    configures LSC. To implement this, the rkisp1_params_apply_params_cfg()
    function is deconstructed, with two small helpers created to deal with
    the parameters buffers, which are then used in rkisp1_params_isr(),
    rkisp1_params_pre_configure() and rkisp1_params_post_configure().
    
    While this initialization ordering is only needed for the ISP8000Nano
    v18.02, it doesn't affect other ISP versions negatively, and can thus be
    followed unconditionally.
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: default avatarDafna Hirschfeld <dafna@fastmail.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
    4b07e2b8
rkisp1-common.h 19.6 KB