From 16fb1d5b2bbea609bbdfa832fd99771a744aff78 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Thu, 13 Jul 2023 12:02:31 +0200 Subject: [PATCH] media: atomisp: isys_init: Initiate atomisp in a generic manner The original implementation distinguishes and initiates atomisp during compiler time. This commit allows isys_init to initiate isys for both types of atomisp in a generic manner. Link: https://lore.kernel.org/r/20230713100231.308923-12-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- .../atomisp/pci/runtime/isys/src/isys_init.c | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c index d0a43c44963c..1a7b45bb4544 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c @@ -18,13 +18,10 @@ #include "ia_css_isys.h" #include "platform_support.h" -#ifdef ISP2401 #include "isys_dma_public.h" /* isys2401_dma_set_max_burst_size() */ #include "isys_irq.h" -#endif -#if !defined(ISP2401) -input_system_err_t ia_css_isys_init(void) +input_system_err_t ia_css_isys_2400_init(void) { backend_channel_cfg_t backend_ch0; backend_channel_cfg_t backend_ch1; @@ -86,8 +83,8 @@ input_system_err_t ia_css_isys_init(void) return error; } -#elif defined(ISP2401) -input_system_err_t ia_css_isys_init(void) + +input_system_err_t ia_css_isys_2401_init(void) { ia_css_isys_csi_rx_lut_rmgr_init(); ia_css_isys_ibuf_rmgr_init(); @@ -104,19 +101,21 @@ input_system_err_t ia_css_isys_init(void) return INPUT_SYSTEM_ERR_NO_ERROR; } -#endif -#if !defined(ISP2401) +input_system_err_t ia_css_isys_init(void) +{ + if (IS_ISP2401) + return ia_css_isys_2401_init(); + + return ia_css_isys_2400_init(); +} + void ia_css_isys_uninit(void) { + if (IS_ISP2401) { + ia_css_isys_csi_rx_lut_rmgr_uninit(); + ia_css_isys_ibuf_rmgr_uninit(); + ia_css_isys_dma_channel_rmgr_uninit(); + ia_css_isys_stream2mmio_sid_rmgr_uninit(); + } } -#elif defined(ISP2401) -void ia_css_isys_uninit(void) -{ - ia_css_isys_csi_rx_lut_rmgr_uninit(); - ia_css_isys_ibuf_rmgr_uninit(); - ia_css_isys_dma_channel_rmgr_uninit(); - ia_css_isys_stream2mmio_sid_rmgr_uninit(); -} -#endif -