media: atomisp: Compile the object codes for a generic driver
authorKate Hsuan <hpa@redhat.com>
Thu, 13 Jul 2023 10:02:29 +0000 (12:02 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 27 Sep 2023 07:40:03 +0000 (09:40 +0200)
Since a generic driver should support every type of atomisp, all the
codes need to be compiled. The ISP2401 flag controls the Makefile to build
the binary file for ISP2400 and ISP2401. Therefore, this section of
Makefile should be removed allowing all the necessary codes can be built.
Moreover, some parts of "removing #ifdef ISP2401" works are related to it
so they were also removed here.

Link: https://lore.kernel.org/r/20230713100231.308923-10-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/Makefile
drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h
drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h
drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c
drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c

index 38b3701..dcf469b 100644 (file)
@@ -150,13 +150,8 @@ atomisp-objs += \
        pci/hive_isp_css_common/host/timed_ctrl.o \
        pci/hive_isp_css_common/host/vmem.o \
        pci/hive_isp_css_shared/host/tag.o \
-       pci/system_local.o
-
-# These will be needed when clean merge CHT support nicely into the driver
-# Keep them here handy for when we get to that point
-#
-
-obj-cht = \
+       pci/system_local.o \
+       pci/runtime/isys/src/ibuf_ctrl_rmgr.o \
        pci/css_2401_system/host/csi_rx.o \
        pci/css_2401_system/host/ibuf_ctrl.o \
        pci/css_2401_system/host/isys_dma.o \
@@ -307,9 +302,6 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__
 #DEFINES += -DUSE_KMEM_CACHE
 
 ifeq ($(CONFIG_VIDEO_ATOMISP_ISP2401),y)
-atomisp-objs += \
-       $(obj-cht) \
-       pci/runtime/isys/src/ibuf_ctrl_rmgr.o
 DEFINES += -DISP2401
 endif
 
index 711a321..d067b9f 100644 (file)
 #include <system_global.h>
 #include "ia_css_isys_comm.h"
 
-#ifdef ISP2401
 /**
  * Virtual Input System. (Input System 2401)
  */
 typedef isp2401_input_system_cfg_t     ia_css_isys_descr_t;
 /* end of Virtual Input System */
-#endif
+
 
 input_system_err_t ia_css_isys_init(void);
 void ia_css_isys_uninit(void);
 enum mipi_port_id ia_css_isys_port_to_mipi_port(
     enum mipi_port_id api_port);
 
-#if defined(ISP2401)
 
 /**
  * @brief Register one (virtual) stream. This is used to track when all
@@ -74,9 +72,7 @@ int ia_css_isys_convert_compressed_format(
     struct isp2401_input_system_cfg_s *cfg);
 unsigned int ia_css_csi2_calculate_input_system_alignment(
     enum atomisp_input_format fmt_type);
-#endif
 
-#if !defined(ISP2401)
 /* CSS Receiver */
 void ia_css_isys_rx_configure(
     const rx_cfg_t *config,
@@ -93,7 +89,6 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port,
                                   unsigned int irq_infos);
 unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits);
 
-#endif /* #if !defined(ISP2401) */
 
 /* @brief Translate format and compression to format type.
  *
@@ -111,7 +106,6 @@ int ia_css_isys_convert_stream_format_to_mipi_format(
     mipi_predictor_t compression,
     unsigned int *fmt_type);
 
-#ifdef ISP2401
 /**
  * Virtual Input System. (Input System 2401)
  */
@@ -178,6 +172,5 @@ void ia_css_isys_stream2mmio_sid_rmgr_release(
     stream2mmio_sid_ID_t       *sid);
 
 /* end of Virtual Input System */
-#endif
 
 #endif                         /* __IA_CSS_ISYS_H__ */
index d80ef42..784afc8 100644 (file)
@@ -19,7 +19,6 @@
 #include <type_support.h>
 #include <input_system.h>
 
-#ifdef ISP2401
 #include <platform_support.h>          /* inline */
 #include <input_system_global.h>
 #include <ia_css_stream_public.h>      /* IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH */
@@ -50,5 +49,4 @@ static inline uint32_t ia_css_isys_generate_stream_id(
        return sp_thread_id * IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH + stream_id;
 }
 
-#endif  /* ISP2401*/
 #endif  /*_IA_CSS_ISYS_COMM_H */
index 3fc9fed..881036c 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "system_global.h"
 
-#ifdef ISP2401
 
 #include "assert_support.h"
 #include "platform_support.h"
@@ -165,4 +164,3 @@ int ia_css_isys_csi_rx_unregister_stream(
        }
        return retval;
 }
-#endif
index 261c646..4df0a91 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "system_global.h"
 
-#ifdef ISP2401
 
 #include "assert_support.h"
 #include "platform_support.h"
@@ -85,4 +84,3 @@ void ia_css_isys_dma_channel_rmgr_release(
                }
        }
 }
-#endif
index fb0cb18..b6be637 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "system_global.h"
 
-#ifdef ISP2401
 
 #include "assert_support.h"
 #include "platform_support.h"
@@ -87,4 +86,3 @@ void ia_css_isys_stream2mmio_sid_rmgr_release(
                }
        }
 }
-#endif
index def8a0b..269a811 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "system_global.h"
 
-#ifdef ISP2401
 
 #include "ia_css_isys.h"
 #include "ia_css_debug.h"
@@ -866,4 +865,3 @@ static csi_mipi_packet_type_t get_csi_mipi_packet_type(
 }
 
 /* end of Private Methods */
-#endif