Skip to contentSkip to conversation

#if defined(ISP2401) removal to make driver generic

PATCH In review Kate Hsuan 2 participants 15 messages Jul 13, 2023 – Jul 15, 2023

Subsystems (4)
lore
Share & tools
lore

Kate Hsuan

author
#0 lore raw

cover #if defined(ISP2401) removal to make driver generic

This patch set is to remove #if defined(ISP2401) to make the driver generic. We focused on removing the #if defined(ISP2401) in isys and necessary files related to it.

The changes include:
1. Removed #if defined(ISP2401) in isys and related directories.
2. Removed the debug codes for dumping status.
3. Made two individual enum to define the MIPI format for both types of atomisp.
4. The input system code should include both input system (ISP2400 and ISP2401) headers since a generic driver should cover all types of devcices.
5. The initialization codes of the input system was modified to initiate atomisp input system in a generic manner.

Kate Hsuan (11):
media: atomisp: ia_css_debug: Removed debug codes for dumping status
media: atomisp: Make two individual enum to define the MIPI format
media: atomisp: Included both input system headers
media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the
driver generic
media: atomisp: isys: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to
make driver generic
media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: Compile the object codes for a generic driver
media: atomisp: rx: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: isys_init: Initiate atomisp in a generic manner

 drivers/staging/media/atomisp/Makefile        |  12 +-
 .../pci/css_2401_system/host/isys_irq_local.h |   3 -
 .../css_2401_system/host/isys_irq_private.h   |   2 -
 .../pci/css_2401_system/isys_irq_global.h     |   2 -
 .../host/input_formatter.c                    |   2 -
 .../hive_isp_css_common/host/input_system.c   |  75 -----
 .../host/isys_dma_public.h                    |   2 -
 .../host/isys_irq_public.h                    |   2 -
 .../hive_isp_css_include/host/isys_public.h   |  19 --
 .../pci/hive_isp_css_include/isys_irq.h       |   2 -
 .../media/atomisp/pci/input_system_local.h    |   7 +-
 .../media/atomisp/pci/input_system_private.h  |   7 +-
 .../media/atomisp/pci/input_system_public.h   |   4 +-
 .../atomisp/pci/isp2400_input_system_local.h  |  89 +++---
 .../pci/isp2400_input_system_private.h        |   4 +-
 .../atomisp/pci/isp2400_input_system_public.h |  13 +-
 .../atomisp/pci/isp2401_input_system_local.h  |  88 +++---
 .../pci/isp2401_input_system_private.h        | 112 +-------
 .../runtime/debug/interface/ia_css_debug.h    |   6 -
 .../pci/runtime/debug/src/ia_css_debug.c      | 256 ------------------
 .../atomisp/pci/runtime/ifmtr/src/ifmtr.c     |   2 -
 .../pci/runtime/isys/interface/ia_css_isys.h  |   9 +-
 .../runtime/isys/interface/ia_css_isys_comm.h |   2 -
 .../pci/runtime/isys/src/csi_rx_rmgr.c        |   2 -
 .../pci/runtime/isys/src/isys_dma_rmgr.c      |   2 -
 .../atomisp/pci/runtime/isys/src/isys_init.c  |  31 +--
 .../runtime/isys/src/isys_stream2mmio_rmgr.c  |   2 -
 .../media/atomisp/pci/runtime/isys/src/rx.c   | 227 ++++++++++------
 .../pci/runtime/isys/src/virtual_isys.c       |   8 +-
 .../pipeline/interface/ia_css_pipeline.h      |   2 -
 .../pci/runtime/pipeline/src/pipeline.c       |   2 -
 drivers/staging/media/atomisp/pci/sh_css.c    |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.c |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.h |   2 -
 34 files changed, 253 insertions(+), 749 deletions(-)
Signature · 1 line
2.41.0
author
#1 lore raw

PATCH 1/11 media: atomisp: ia_css_debug: Removed debug codes for dumping status

This portion of debug code was based on a structure for both ISP2400 and 2401 with the same name and controlled by #if defined(ISP2401). This structure was only used to dump the status of atomisp. So, to make the driver generic, this part of debug codes can be removed.

---
 .../hive_isp_css_common/host/input_system.c   |  60 ----
 .../hive_isp_css_include/host/isys_public.h   |  19 --
 .../atomisp/pci/isp2400_input_system_local.h  |  17 --
 .../atomisp/pci/isp2400_input_system_public.h |   4 -
 .../atomisp/pci/isp2401_input_system_local.h  |  10 +-
 .../pci/isp2401_input_system_private.h        | 108 --------
 .../runtime/debug/interface/ia_css_debug.h    |   6 -
 .../pci/runtime/debug/src/ia_css_debug.c      | 256 ------------------
 drivers/staging/media/atomisp/pci/sh_css.c    |   2 -
 9 files changed, 1 insertion(+), 481 deletions(-)
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +0 -60
index 712e01c37870..09aca4e3db22 100644
@@ -116,66 +116,6 @@ static void input_switch_cfg(
     const input_switch_cfg_t *const cfg
 );
 
-void input_system_get_state(
-    const input_system_ID_t			ID,
-    input_system_state_t			*state)
-{
-	sub_system_ID_t	sub_id;
-
-	assert(ID < N_INPUT_SYSTEM_ID);
-	assert(state);
-
-	state->str_multicastA_sel = input_system_sub_system_reg_load(ID,
-				    GPREGS_UNIT0_ID,
-				    HIVE_ISYS_GPREG_MULTICAST_A_IDX);
-	state->str_multicastB_sel = input_system_sub_system_reg_load(ID,
-				    GPREGS_UNIT0_ID,
-				    HIVE_ISYS_GPREG_MULTICAST_B_IDX);
-	state->str_multicastC_sel = input_system_sub_system_reg_load(ID,
-				    GPREGS_UNIT0_ID,
-				    HIVE_ISYS_GPREG_MULTICAST_C_IDX);
-	state->str_mux_sel = input_system_sub_system_reg_load(ID,
-			     GPREGS_UNIT0_ID,
-			     HIVE_ISYS_GPREG_MUX_IDX);
-	state->str_mon_status = input_system_sub_system_reg_load(ID,
-				GPREGS_UNIT0_ID,
-				HIVE_ISYS_GPREG_STRMON_STAT_IDX);
-	state->str_mon_irq_cond = input_system_sub_system_reg_load(ID,
-				  GPREGS_UNIT0_ID,
-				  HIVE_ISYS_GPREG_STRMON_COND_IDX);
-	state->str_mon_irq_en = input_system_sub_system_reg_load(ID,
-				GPREGS_UNIT0_ID,
-				HIVE_ISYS_GPREG_STRMON_IRQ_EN_IDX);
-	state->isys_srst = input_system_sub_system_reg_load(ID,
-			   GPREGS_UNIT0_ID,
-			   HIVE_ISYS_GPREG_SRST_IDX);
-	state->isys_slv_reg_srst = input_system_sub_system_reg_load(ID,
-				   GPREGS_UNIT0_ID,
-				   HIVE_ISYS_GPREG_SLV_REG_SRST_IDX);
-	state->str_deint_portA_cnt = input_system_sub_system_reg_load(ID,
-				     GPREGS_UNIT0_ID,
-				     HIVE_ISYS_GPREG_REG_PORT_A_IDX);
-	state->str_deint_portB_cnt = input_system_sub_system_reg_load(ID,
-				     GPREGS_UNIT0_ID,
-				     HIVE_ISYS_GPREG_REG_PORT_B_IDX);
-
-	for (sub_id = CAPTURE_UNIT0_ID; sub_id < CAPTURE_UNIT0_ID + N_CAPTURE_UNIT_ID;
-	     sub_id++) {
-		capture_unit_get_state(ID, sub_id,
-				       &state->capture_unit[sub_id - CAPTURE_UNIT0_ID]);
-	}
-	for (sub_id = ACQUISITION_UNIT0_ID;
-	     sub_id < ACQUISITION_UNIT0_ID + N_ACQUISITION_UNIT_ID; sub_id++) {
-		acquisition_unit_get_state(ID, sub_id,
-					   &state->acquisition_unit[sub_id - ACQUISITION_UNIT0_ID]);
-	}
-	for (sub_id = CTRL_UNIT0_ID; sub_id < CTRL_UNIT0_ID + N_CTRL_UNIT_ID;
-	     sub_id++) {
-		ctrl_unit_get_state(ID, sub_id,
-				    &state->ctrl_unit_state[sub_id - CTRL_UNIT0_ID]);
-	}
-}
-
 void receiver_get_state(
     const rx_ID_t				ID,
     receiver_state_t			*state)
drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_public.h +0 -19
index dac53e324118..9dacef7a5cc1 100644
@@ -16,23 +16,4 @@
 #ifndef __ISYS_PUBLIC_H_INCLUDED__
 #define __ISYS_PUBLIC_H_INCLUDED__
 
-#ifdef ISP2401
-/*! Read the state of INPUT_SYSTEM[ID]
- \param ID[in]		INPUT_SYSTEM identifier
- \param state[out]	pointer to input system state structure
- \return none, state = INPUT_SYSTEM[ID].state
- */
-STORAGE_CLASS_INPUT_SYSTEM_H input_system_err_t input_system_get_state(
-    const input_system_ID_t	ID,
-    input_system_state_t *state);
-/*! Dump the state of INPUT_SYSTEM[ID]
- \param ID[in]		INPUT_SYSTEM identifier
- \param state[in]	pointer to input system state structure
- \return none
- \depends on host supplied print function as part of ia_css_init()
- */
-STORAGE_CLASS_INPUT_SYSTEM_H void input_system_dump_state(
-    const input_system_ID_t	ID,
-    input_system_state_t *state);
-#endif /* ISP2401 */
 #endif /* __ISYS_PUBLIC_H_INCLUDED__ */
drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +0 -17
index c3ae5014a039..8701abc4c991 100644
@@ -306,23 +306,6 @@ struct ctrl_unit_state_s {
 	int	capt_reserve_one_mem_region;
 };
 
-struct input_system_state_s {
-	int	str_multicastA_sel;
-	int	str_multicastB_sel;
-	int	str_multicastC_sel;
-	int	str_mux_sel;
-	int	str_mon_status;
-	int	str_mon_irq_cond;
-	int	str_mon_irq_en;
-	int	isys_srst;
-	int	isys_slv_reg_srst;
-	int	str_deint_portA_cnt;
-	int	str_deint_portB_cnt;
-	struct capture_unit_state_s		capture_unit[N_CAPTURE_UNIT_ID];
-	struct acquisition_unit_state_s	acquisition_unit[N_ACQUISITION_UNIT_ID];
-	struct ctrl_unit_state_s		ctrl_unit_state[N_CTRL_UNIT_ID];
-};
-
 struct mipi_port_state_s {
 	int	device_ready;
 	int	irq_status;
drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +0 -4
index 85cb61e34192..ad7448744519 100644
@@ -21,7 +21,6 @@
 #include "isys_public.h"
 #else
 
-typedef struct input_system_state_s		input_system_state_t;
 typedef struct receiver_state_s			receiver_state_t;
 
 /*! Read the state of INPUT_SYSTEM[ID]
@@ -31,9 +30,6 @@ typedef struct receiver_state_s			receiver_state_t;
 
  \return none, state = INPUT_SYSTEM[ID].state
  */
-void input_system_get_state(
-    const input_system_ID_t		ID,
-    input_system_state_t		*state);
 
 /*! Read the state of RECEIVER[ID]
 
drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +1 -9
index 74bfa10e670e..7c7297b9c146 100644
@@ -66,13 +66,5 @@ typedef enum {
 
 /* The number of stores for compressed format types */
 #define	N_MIPI_COMPRESSOR_CONTEXT	(N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
-typedef struct input_system_state_s	input_system_state_t;
-struct input_system_state_s {
-	ibuf_ctrl_state_t	ibuf_ctrl_state[N_IBUF_CTRL_ID];
-	csi_rx_fe_ctrl_state_t	csi_rx_fe_ctrl_state[N_CSI_RX_FRONTEND_ID];
-	csi_rx_be_ctrl_state_t	csi_rx_be_ctrl_state[N_CSI_RX_BACKEND_ID];
-	pixelgen_ctrl_state_t	pixelgen_ctrl_state[N_PIXELGEN_ID];
-	stream2mmio_state_t	stream2mmio_state[N_STREAM2MMIO_ID];
-	isys_irqc_state_t	isys_irqc_state[N_ISYS_IRQ_ID];
-};
+
 #endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */
drivers/staging/media/atomisp/pci/isp2401_input_system_private.h +0 -108

112 lines not on this page · raw message

drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h +0 -6
index efa136294836..b74ab50ea01e 100644
@@ -261,12 +261,6 @@ void ia_css_debug_dump_all_fifo_state(void);
  */
 void ia_css_debug_dump_rx_state(void);
 
-/*! @brief Dump the input system state to the output
- * Dumps the input system state to tracing output.
- * @return	None
- */
-void ia_css_debug_dump_isys_state(void);
-
 /*! @brief Dump the frame info to the trace output
  * Dumps the frame info to tracing output.
  * @param[in]	frame		pointer to struct ia_css_frame
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c +0 -256

274 lines not on this page · raw message

drivers/staging/media/atomisp/pci/sh_css.c +0 -2
index 4b3fa6d93fe0..67c581d3c1a6 100644
@@ -7623,7 +7623,6 @@ void ia_css_stream_request_flash(struct ia_css_stream *stream)
 		if (!sh_css_write_host2sp_command(host2sp_cmd_start_flash)) {
 			IA_CSS_ERROR("Call to 'sh-css_write_host2sp_command()' failed");
 			ia_css_debug_dump_sp_sw_debug_info();
-			ia_css_debug_dump_debug_info(NULL);
 		}
 	} else {
 		IA_CSS_LOG("SP is not running!");
@@ -9035,7 +9034,6 @@ ia_css_stop_sp(void)
 	if (!sh_css_write_host2sp_command(host2sp_cmd_terminate)) {
 		IA_CSS_ERROR("Call to 'sh-css_write_host2sp_command()' failed");
 		ia_css_debug_dump_sp_sw_debug_info();
-		ia_css_debug_dump_debug_info(NULL);
 	}
 
 	sh_css_sp_set_sp_running(false);
Signature · 1 line
2.41.0
author
#2 lore raw

PATCH 2/11 media: atomisp: Make two individual enum to define the MIPI format

In reply to Kate Hsuan

The original mipi_format_t represents the MIPI format settings for both atomisp with the same name and the enum member was controlled by #if defined(ISP2401). However, if we want to make this driver generic, this enum should be individually defined for them.

Since the format type is redefined, the format setting function ia_css_isys_set_fmt_type() should be reworked for ISP2400 and ISP2401 called ia_css_isys_2400_set_fmt_type() and ia_css_isys_2401_set_fmt_type() .

Additionally, the function called is_mipi_format_yuv420() isn't used by any functions so it can be removed.

---
 .../hive_isp_css_common/host/input_system.c   |  13 -
 .../atomisp/pci/isp2400_input_system_local.h  |  68 +++---
 .../atomisp/pci/isp2400_input_system_public.h |   2 -
 .../atomisp/pci/isp2401_input_system_local.h  |  74 +++---
 .../media/atomisp/pci/runtime/isys/src/rx.c   | 226 ++++++++++++------
 .../pci/runtime/isys/src/virtual_isys.c       |   6 +-
 6 files changed, 224 insertions(+), 165 deletions(-)
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +0 -13
index 09aca4e3db22..7a74c679ed92 100644
@@ -186,19 +186,6 @@ void receiver_get_state(
 						_HRT_CSS_RECEIVER_BE_IRQ_CLEAR_REG_IDX);
 }
 
-bool is_mipi_format_yuv420(
-    const mipi_format_t			mipi_format)
-{
-	bool	is_yuv420 = (
-				(mipi_format == MIPI_FORMAT_YUV420_8) ||
-				(mipi_format == MIPI_FORMAT_YUV420_10) ||
-				(mipi_format == MIPI_FORMAT_YUV420_8_SHIFT) ||
-				(mipi_format == MIPI_FORMAT_YUV420_10_SHIFT));
-	/* MIPI_FORMAT_YUV420_8_LEGACY is not YUV420 */
-
-	return is_yuv420;
-}
-
 void receiver_set_compression(
     const rx_ID_t			ID,
     const unsigned int		cfg_ID,
drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +34 -34

74 lines not on this page · raw message

drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +0 -2
index ad7448744519..6477be44a815 100644
@@ -48,8 +48,6 @@ void receiver_get_state(
 
  \return mipi_format == YUV420
  */
-bool is_mipi_format_yuv420(
-    const mipi_format_t			mipi_format);
 
 /*! Set compression parameters for cfg[cfg_ID] of RECEIVER[ID]
 
drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +37 -37

82 lines not on this page · raw message

drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +150 -76

298 lines not on this page · raw message

drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +3 -3
index 8fc7746f8639..def8a0b1d2ec 100644
@@ -689,7 +689,7 @@ static bool calculate_be_cfg(
 		cfg->csi_mipi_cfg.comp_scheme = isys_cfg->csi_port_attr.comp_scheme;
 		cfg->csi_mipi_cfg.comp_predictor = isys_cfg->csi_port_attr.comp_predictor;
 		cfg->csi_mipi_cfg.comp_bit_idx = cfg->csi_mipi_cfg.data_type -
-						 MIPI_FORMAT_CUSTOM0;
+						 MIPI_FORMAT_2401_CUSTOM0;
 	}
 
 	return true;
@@ -856,10 +856,10 @@ static csi_mipi_packet_type_t get_csi_mipi_packet_type(
 
 	packet_type = CSI_MIPI_PACKET_TYPE_RESERVED;
 
-	if (data_type >= 0 && data_type <= MIPI_FORMAT_SHORT8)
+	if (data_type >= 0 && data_type <= MIPI_FORMAT_2401_SHORT8)
 		packet_type = CSI_MIPI_PACKET_TYPE_SHORT;
 
-	if (data_type > MIPI_FORMAT_SHORT8 && data_type <= N_MIPI_FORMAT)
+	if (data_type > MIPI_FORMAT_2401_SHORT8 && data_type <= N_MIPI_FORMAT_2401)
 		packet_type = CSI_MIPI_PACKET_TYPE_LONG;
 
 	return packet_type;
Signature · 1 line
2.41.0
author
#3 lore raw

PATCH 3/11 media: atomisp: Included both input system headers

In reply to Kate Hsuan

Included necessary input system header files (local, private, public scopes) for both types of atomisp. There is also a conflict of declaration issue so the unused input_system_state_s is removed.

---
 drivers/staging/media/atomisp/pci/input_system_local.h     | 7 ++-----
 drivers/staging/media/atomisp/pci/input_system_private.h   | 7 ++-----
 drivers/staging/media/atomisp/pci/input_system_public.h    | 4 +---
 .../staging/media/atomisp/pci/isp2400_input_system_local.h | 4 ++--
 .../media/atomisp/pci/isp2400_input_system_private.h       | 4 ++--
 .../media/atomisp/pci/isp2400_input_system_public.h        | 7 ++-----
 .../staging/media/atomisp/pci/isp2401_input_system_local.h | 4 ++--
 .../media/atomisp/pci/isp2401_input_system_private.h       | 4 ++--
 8 files changed, 15 insertions(+), 26 deletions(-)
drivers/staging/media/atomisp/pci/input_system_local.h +2 -5
index 357987d629cd..12f7acfeb79c 100644
@@ -138,8 +138,5 @@ struct rx_cfg_s {
 	bool                is_two_ppc;
 };
 
-#ifdef ISP2401
-#  include "isp2401_input_system_local.h"
-#else
-#  include "isp2400_input_system_local.h"
-#endif
+#include "isp2401_input_system_local.h"
+#include "isp2400_input_system_local.h"
drivers/staging/media/atomisp/pci/input_system_private.h +2 -5
index 889f204e77d5..148ba2ca2290 100644
@@ -4,8 +4,5 @@
  *    (c) 2020 Mauro Carvalho Chehab <[email protected]>
  */
 
-#ifdef ISP2401
-#  include "isp2401_input_system_private.h"
-#else
-#  include "isp2400_input_system_private.h"
-#endif
+#include "isp2401_input_system_private.h"
+#include "isp2400_input_system_private.h"
drivers/staging/media/atomisp/pci/input_system_public.h +1 -3
index 3f5167fd6643..06b19434b6c0 100644
@@ -4,6 +4,4 @@
  *    (c) 2020 Mauro Carvalho Chehab <[email protected]>
  */
 
-#ifndef ISP2401
-#  include "isp2400_input_system_public.h"
-#endif
+#include "isp2400_input_system_public.h"
drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +2 -2
index 847ad7554eb7..e7b84fdbb4e0 100644
@@ -13,8 +13,8 @@
  * more details.
  */
 
-#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+#ifndef __INPUT_SYSTEM_2400_LOCAL_H_INCLUDED__
+#define __INPUT_SYSTEM_2400_LOCAL_H_INCLUDED__
 
 #include "input_system_defs.h"		/* HIVE_ISYS_GPREG_MULTICAST_A_IDX,... */
 
drivers/staging/media/atomisp/pci/isp2400_input_system_private.h +2 -2
index 9c39ca2da923..e011920f00e1 100644
@@ -13,8 +13,8 @@
  * more details.
  */
 
-#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+#ifndef __INPUT_SYSTEM_2400_PRIVATE_H_INCLUDED__
+#define __INPUT_SYSTEM_2400_PRIVATE_H_INCLUDED__
 
 #include "input_system_public.h"
 
drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +2 -5
index 6477be44a815..375c0db84b55 100644
@@ -13,13 +13,11 @@
  * more details.
  */
 
-#ifndef __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
-#define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
+#ifndef __INPUT_SYSTEM_2400_PUBLIC_H_INCLUDED__
+#define __INPUT_SYSTEM_2400_PUBLIC_H_INCLUDED__
 
 #include <type_support.h>
-#ifdef ISP2401
 #include "isys_public.h"
-#else
 
 typedef struct receiver_state_s			receiver_state_t;
 
@@ -359,6 +357,5 @@ input_system_err_t	input_system_gpfifo_channel_cfg(
     u32		nof_frames,
     target_cfg2400_t	target
 );
-#endif /* #ifdef ISP2401 */
 
 #endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */
drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +2 -2
index 361a615bbcad..d9a8d575c58e 100644
@@ -13,8 +13,8 @@
  * more details.
  */
 
-#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+#ifndef __INPUT_SYSTEM_2401_LOCAL_H_INCLUDED__
+#define __INPUT_SYSTEM_2401_LOCAL_H_INCLUDED__
 
 #include "csi_rx.h"
 #include "pixelgen.h"
drivers/staging/media/atomisp/pci/isp2401_input_system_private.h +2 -2
index f3fdd9a2a5e6..845ed0add027 100644
@@ -13,8 +13,8 @@
  * more details.
  */
 
-#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+#ifndef __INPUT_SYSTEM_2401_PRIVATE_H_INCLUDED__
+#define __INPUT_SYSTEM_2401_PRIVATE_H_INCLUDED__
 
 #include "input_system_public.h"
 
Signature · 1 line
2.41.0
author
#4 lore raw

PATCH 4/11 media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic

In reply to Kate Hsuan

Removed #if defined(2401) to make the driver generic.

---
 .../media/atomisp/pci/css_2401_system/host/isys_irq_local.h    | 3 ---
 .../media/atomisp/pci/css_2401_system/host/isys_irq_private.h  | 2 --
 .../media/atomisp/pci/css_2401_system/isys_irq_global.h        | 2 --
 3 files changed, 7 deletions(-)
drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_local.h +0 -3
index a76987190292..0f585a7e0fa4 100644
@@ -18,8 +18,6 @@
 
 #include <type_support.h>
 
-#if defined(ISP2401)
-
 typedef struct isys_irqc_state_s isys_irqc_state_t;
 
 struct isys_irqc_state_s {
@@ -31,6 +29,5 @@ struct isys_irqc_state_s {
 	/*hrt_data clear;	*/	/* write-only register */
 };
 
-#endif /* defined(ISP2401) */
 
 #endif	/* __ISYS_IRQ_LOCAL_H__ */
drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h +0 -2
index fb168c25bdfc..d94c8e6add72 100644
@@ -19,7 +19,6 @@
 #include "isys_irq_global.h"
 #include "isys_irq_local.h"
 
-#if defined(ISP2401)
 
 /* -------------------------------------------------------+
  |             Native command interface (NCI)             |
@@ -102,6 +101,5 @@ hrt_data isys_irqc_reg_load(
 
 /* end of DLI */
 
-#endif /* defined(ISP2401) */
 
 #endif	/* __ISYS_IRQ_PRIVATE_H__ */
drivers/staging/media/atomisp/pci/css_2401_system/isys_irq_global.h +0 -2
index a81e4d13ac9f..16336ed73036 100644
@@ -16,7 +16,6 @@
 #ifndef __ISYS_IRQ_GLOBAL_H__
 #define __ISYS_IRQ_GLOBAL_H__
 
-#if defined(ISP2401)
 
 /* Register offset/index from base location */
 #define ISYS_IRQ_EDGE_REG_IDX		(0)
@@ -31,6 +30,5 @@
 #define ISYS_IRQ_CLEAR_REG_VALUE	(0xFFFF)
 #define ISYS_IRQ_ENABLE_REG_VALUE	(0xFFFF)
 
-#endif /* defined(ISP2401) */
 
 #endif	/* __ISYS_IRQ_GLOBAL_H__ */
Signature · 1 line
2.41.0
author
#5 lore raw

PATCH 5/11 media: atomisp: isys: Removed #if defined(ISP2401) to make driver generic

In reply to Kate Hsuan

Removed #if defined(ISP2401) to make code generic.

---
 .../atomisp/pci/hive_isp_css_include/host/isys_dma_public.h     | 2 --
 .../atomisp/pci/hive_isp_css_include/host/isys_irq_public.h     | 2 --
 .../staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h   | 2 --
 3 files changed, 6 deletions(-)
drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_dma_public.h +0 -2
index d9b6af898c06..f18a057adb0f 100644
@@ -16,7 +16,6 @@
 #ifndef __ISYS_DMA_PUBLIC_H_INCLUDED__
 #define __ISYS_DMA_PUBLIC_H_INCLUDED__
 
-#ifdef ISP2401
 
 #include "system_local.h"
 #include "type_support.h"
@@ -34,6 +33,5 @@ void isys2401_dma_set_max_burst_size(
     const isys2401_dma_ID_t dma_id,
     uint32_t		max_burst_size);
 
-#endif /* ISP2401 */
 
 #endif /* __ISYS_DMA_PUBLIC_H_INCLUDED__ */
drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_irq_public.h +0 -2
index 736cbc4e3705..2b13688256cf 100644
@@ -19,7 +19,6 @@
 #include "isys_irq_global.h"
 #include "isys_irq_local.h"
 
-#if defined(ISP2401)
 
 void isys_irqc_state_get(const isys_irq_ID_t	isys_irqc_id,
 			 isys_irqc_state_t	*state);
@@ -36,6 +35,5 @@ hrt_data isys_irqc_reg_load(const isys_irq_ID_t	isys_irqc_id,
 
 void isys_irqc_status_enable(const isys_irq_ID_t isys_irqc_id);
 
-#endif /* defined(ISP2401) */
 
 #endif	/* __ISYS_IRQ_PUBLIC_H__ */
drivers/staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h +0 -2
index 001c55ea970b..952b633fdca7 100644
@@ -19,10 +19,8 @@
 #include <type_support.h>
 #include <system_local.h>
 
-#if defined(ISP2401)
 
 #include "isys_irq_public.h"
 
-#endif /* defined(ISP2401) */
 
 #endif	/* __IA_CSS_ISYS_IRQ_H__ */
Signature · 1 line
2.41.0
author
#6 lore raw

PATCH 6/11 media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver generic

In reply to Kate Hsuan

Removed #if defined(ISP2401) to make code generic.

---
 .../media/atomisp/pci/hive_isp_css_common/host/input_system.c   | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +0 -2
index 7a74c679ed92..c60f0d5b01c6 100644
@@ -15,7 +15,6 @@
 
 #include "system_global.h"
 
-#ifndef ISP2401
 
 #include "input_system.h"
 #include <type_support.h>
@@ -1714,4 +1713,3 @@ static input_system_err_t input_system_multiplexer_cfg(
 	*flags |= INPUT_SYSTEM_CFG_FLAG_SET;
 	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
-#endif
Signature · 1 line
2.41.0
author
#7 lore raw

PATCH 7/11 media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic

In reply to Kate Hsuan

Removed #if defined(ISP2401) to make driver generic.

---
 .../atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h    | 2 --
 .../staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c   | 2 --
 2 files changed, 4 deletions(-)
drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h +0 -2
index 222c381ff3b9..5f5dab7252aa 100644
@@ -241,7 +241,6 @@ bool ia_css_pipeline_uses_params(struct ia_css_pipeline *pipeline);
  */
 bool ia_css_pipeline_get_sp_thread_id(unsigned int key, unsigned int *val);
 
-#if defined(ISP2401)
 /**
  * @brief Get the pipeline io status
  *
@@ -250,7 +249,6 @@ bool ia_css_pipeline_get_sp_thread_id(unsigned int key, unsigned int *val);
  *	Pointer to pipe_io_status
  */
 struct sh_css_sp_pipeline_io_status *ia_css_pipeline_get_pipe_io_status(void);
-#endif
 
 /**
  * @brief Map an SP thread to this pipeline
drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +0 -2
index e9e187649a65..3d8741e7d5ca 100644
@@ -454,12 +454,10 @@ bool ia_css_pipeline_has_stopped(struct ia_css_pipeline *pipeline)
 	return sp_group.pipe[thread_id].num_stages == 0;
 }
 
-#if defined(ISP2401)
 struct sh_css_sp_pipeline_io_status *ia_css_pipeline_get_pipe_io_status(void)
 {
 	return(&sh_css_sp_group.pipe_io_status);
 }
-#endif
 
 bool ia_css_pipeline_is_mapped(unsigned int key)
 {
Signature · 1 line
2.41.0
author
#8 lore raw

PATCH 8/11 media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic

In reply to Kate Hsuan

Removed #if defined(ISP2401) to make driver generic.

---
 .../atomisp/pci/hive_isp_css_common/host/input_formatter.c      | 2 --
 drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c     | 2 --
 drivers/staging/media/atomisp/pci/sh_css_sp.c                   | 2 --
 drivers/staging/media/atomisp/pci/sh_css_sp.h                   | 2 --
 4 files changed, 8 deletions(-)
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c +0 -2
index 5cd6136f21a2..e01f30f137a0 100644
@@ -15,7 +15,6 @@
 
 #include "system_global.h"
 
-#ifndef ISP2401
 
 #include "input_formatter.h"
 #include <type_support.h>
@@ -243,4 +242,3 @@ void input_formatter_bin_get_state(
 				  HIVE_STR2MEM_EN_STAT_UPDATE_ADDRESS);
 	return;
 }
-#endif
drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c +0 -2
index 6d9f47629fbc..86254888f676 100644
@@ -16,7 +16,6 @@
 #include "system_global.h"
 #include <linux/kernel.h>
 
-#ifndef ISP2401
 
 #include "ia_css_ifmtr.h"
 #include <math_support.h>
@@ -550,4 +549,3 @@ static int ifmtr_input_start_line(
 	return 0;
 }
 
-#endif
drivers/staging/media/atomisp/pci/sh_css_sp.c +0 -2
index 297e1b981720..4ef1c9e61ea8 100644
@@ -632,7 +632,6 @@ set_view_finder_buffer(const struct ia_css_frame *frame)
 	return 0;
 }
 
-#if !defined(ISP2401)
 void sh_css_sp_set_if_configs(
     const input_formatter_cfg_t	*config_a,
     const input_formatter_cfg_t	*config_b,
@@ -654,7 +653,6 @@ void sh_css_sp_set_if_configs(
 
 	return;
 }
-#endif
 
 #if !defined(ISP2401)
 void
drivers/staging/media/atomisp/pci/sh_css_sp.h +0 -2
index f69a79b0b0da..b052c40e69bc 100644
@@ -149,13 +149,11 @@ sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state);
 
 #endif
 
-#if !defined(ISP2401)
 void
 sh_css_sp_set_if_configs(
     const input_formatter_cfg_t	*config_a,
     const input_formatter_cfg_t	*config_b,
     const uint8_t		if_config_index);
-#endif
 
 void
 sh_css_sp_program_input_circuit(int fmt_type,
Signature · 1 line
2.41.0
author
#9 lore raw

PATCH 9/11 media: atomisp: Compile the object codes for a generic driver

In reply to Kate Hsuan

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.

---
 drivers/staging/media/atomisp/Makefile               | 12 ++----------
 .../atomisp/pci/runtime/isys/interface/ia_css_isys.h |  9 +--------
 .../pci/runtime/isys/interface/ia_css_isys_comm.h    |  2 --
 .../media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c |  2 --
 .../atomisp/pci/runtime/isys/src/isys_dma_rmgr.c     |  2 --
 .../pci/runtime/isys/src/isys_stream2mmio_rmgr.c     |  2 --
 .../atomisp/pci/runtime/isys/src/virtual_isys.c      |  2 --
 7 files changed, 3 insertions(+), 28 deletions(-)
drivers/staging/media/atomisp/Makefile +2 -10
index 38b370124109..dcf469bf1cb4 100644
@@ -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
 
drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h +1 -8
index 711a321e9a3f..d067b9fc43c7 100644
@@ -24,20 +24,18 @@
 #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__ */
drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h +0 -2
index d80ef42c7a64..784afc82c8d2 100644
@@ -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 */
drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c +0 -2
index 3fc9fed1e516..881036c67baf 100644
@@ -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
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c +0 -2
index 261c6460e970..4df0a9188ee6 100644
@@ -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
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c +0 -2
index fb0cb183f701..b6be63746c3e 100644
@@ -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
drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +0 -2
index def8a0b1d2ec..269a81190577 100644
@@ -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
Signature · 1 line
2.41.0
author
#10 lore raw

PATCH 10/11 media: atomisp: rx: Removed #if defined(ISP2401) to make driver generic

In reply to Kate Hsuan

The conflicts of variable declarations were resolved through previous commits so the #if defined(ISP2401) can be removed.

---
 .../media/atomisp/pci/runtime/isys/src/rx.c   | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +4 -15
index b58f4fd4a35c..c8316e0965d0 100644
@@ -20,7 +20,6 @@
 #include "ia_css_irq.h"
 #include "sh_css_internal.h"
 
-#if !defined(ISP2401)
 void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port)
 {
 	hrt_data bits = receiver_port_reg_load(RX0_ID,
@@ -209,9 +208,7 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port,
 
 	return;
 }
-#endif /* #if !defined(ISP2401) */
 
-#if !defined(ISP2401)
 static int ia_css_isys_2400_set_fmt_type(enum atomisp_input_format input_format,
 					 unsigned int *fmt_type)
 {
@@ -283,9 +280,7 @@ static int ia_css_isys_2400_set_fmt_type(enum atomisp_input_format input_format,
 	}
 	return 0;
 }
-#endif /* #ifndef ISP2401 */
 
-#if defined(ISP2401)
 static int ia_css_isys_2401_set_fmt_type(enum atomisp_input_format input_format,
 					 unsigned int *fmt_type)
 {
@@ -373,7 +368,6 @@ static int ia_css_isys_2401_set_fmt_type(enum atomisp_input_format input_format,
 	}
 	return 0;
 }
-#endif /* #ifdef ISP2401 */
 
 int ia_css_isys_convert_stream_format_to_mipi_format(
     enum atomisp_input_format input_format,
@@ -423,14 +417,12 @@ int ia_css_isys_convert_stream_format_to_mipi_format(
 	 *
 	 * MW: For some reason the mapping is not 1-to-1
 	 */
-#if defined(ISP2401)
-	return ia_css_isys_2401_set_fmt_type(input_format, fmt_type);
-#else
-	return ia_css_isys_2400_set_fmt_type(input_format, fmt_type);
-#endif
+	if (IS_ISP2401)
+		return ia_css_isys_2401_set_fmt_type(input_format, fmt_type);
+	else
+		return ia_css_isys_2400_set_fmt_type(input_format, fmt_type);
 }
 
-#if defined(ISP2401)
 static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor(
     enum ia_css_csi2_compression_type type)
 {
@@ -547,9 +539,7 @@ unsigned int ia_css_csi2_calculate_input_system_alignment(
 	return memory_alignment_in_bytes;
 }
 
-#endif
 
-#if !defined(ISP2401)
 static const mipi_lane_cfg_t MIPI_PORT_LANES[N_RX_MODE][N_MIPI_PORT_ID] = {
 	{MIPI_4LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
 	{MIPI_3LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
@@ -671,4 +661,3 @@ void ia_css_isys_rx_disable(void)
 	}
 	return;
 }
-#endif /* if !defined(ISP2401) */
Signature · 1 line
2.41.0
author
#11 lore raw

PATCH 11/11 media: atomisp: isys_init: Initiate atomisp in a generic manner

In reply to Kate Hsuan

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.

---
 .../atomisp/pci/runtime/isys/src/isys_init.c  | 31 +++++++++----------
 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c +15 -16
index d0a43c44963c..1a7b45bb4544 100644
@@ -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)
-void ia_css_isys_uninit(void)
+input_system_err_t ia_css_isys_init(void)
 {
+	if (IS_ISP2401)
+		return ia_css_isys_2401_init();
+
+	return ia_css_isys_2400_init();
 }
-#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();
+	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();
+	}
 }
-#endif
-
Signature · 1 line
2.41.0
Reviewed-by on the v1 series
#12 lore raw
In reply to Kate Hsuan

Hi Kate,

Quoted 4 lines · Kate Hsuan

This patch set is to remove #if defined(ISP2401) to make the driver generic. We focused on removing the #if defined(ISP2401) in isys and necessary files related to it.

Quoted 10 lines

The changes include:
1. Removed #if defined(ISP2401) in isys and related directories.
2. Removed the debug codes for dumping status.
3. Made two individual enum to define the MIPI format for both types of atomisp.
4. The input system code should include both input system (ISP2400 and ISP2401) headers since a generic driver should cover all types of devcices.
5. The initialization codes of the input system was modified to initiate atomisp input system in a generic manner.

Thank you very much for all your hard work on this.

The entire series looks good to me:

for the series. I'll merge this into my media-atomisp branch when I can make some time to do so.

Regards,

Hans

Quoted 57 lines

Kate Hsuan (11):
media: atomisp: ia_css_debug: Removed debug codes for dumping status
media: atomisp: Make two individual enum to define the MIPI format
media: atomisp: Included both input system headers
media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the
driver generic
media: atomisp: isys: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to
make driver generic
media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: Compile the object codes for a generic driver
media: atomisp: rx: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: isys_init: Initiate atomisp in a generic manner

 drivers/staging/media/atomisp/Makefile        |  12 +-
 .../pci/css_2401_system/host/isys_irq_local.h |   3 -
 .../css_2401_system/host/isys_irq_private.h   |   2 -
 .../pci/css_2401_system/isys_irq_global.h     |   2 -
 .../host/input_formatter.c                    |   2 -
 .../hive_isp_css_common/host/input_system.c   |  75 -----
 .../host/isys_dma_public.h                    |   2 -
 .../host/isys_irq_public.h                    |   2 -
 .../hive_isp_css_include/host/isys_public.h   |  19 --
 .../pci/hive_isp_css_include/isys_irq.h       |   2 -
 .../media/atomisp/pci/input_system_local.h    |   7 +-
 .../media/atomisp/pci/input_system_private.h  |   7 +-
 .../media/atomisp/pci/input_system_public.h   |   4 +-
 .../atomisp/pci/isp2400_input_system_local.h  |  89 +++---
 .../pci/isp2400_input_system_private.h        |   4 +-
 .../atomisp/pci/isp2400_input_system_public.h |  13 +-
 .../atomisp/pci/isp2401_input_system_local.h  |  88 +++---
 .../pci/isp2401_input_system_private.h        | 112 +-------
 .../runtime/debug/interface/ia_css_debug.h    |   6 -
 .../pci/runtime/debug/src/ia_css_debug.c      | 256 ------------------
 .../atomisp/pci/runtime/ifmtr/src/ifmtr.c     |   2 -
 .../pci/runtime/isys/interface/ia_css_isys.h  |   9 +-
 .../runtime/isys/interface/ia_css_isys_comm.h |   2 -
 .../pci/runtime/isys/src/csi_rx_rmgr.c        |   2 -
 .../pci/runtime/isys/src/isys_dma_rmgr.c      |   2 -
 .../atomisp/pci/runtime/isys/src/isys_init.c  |  31 +--
 .../runtime/isys/src/isys_stream2mmio_rmgr.c  |   2 -
 .../media/atomisp/pci/runtime/isys/src/rx.c   | 227 ++++++++++------
 .../pci/runtime/isys/src/virtual_isys.c       |   8 +-
 .../pipeline/interface/ia_css_pipeline.h      |   2 -
 .../pci/runtime/pipeline/src/pipeline.c       |   2 -
 drivers/staging/media/atomisp/pci/sh_css.c    |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.c |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.h |   2 -
 34 files changed, 253 insertions(+), 749 deletions(-)
author
#13 lore raw

Hi Hans

Quoted 19 lines · Hans de Goede

Hi Kate,

Quoted 4 lines · Kate Hsuan

This patch set is to remove #if defined(ISP2401) to make the driver generic. We focused on removing the #if defined(ISP2401) in isys and necessary files related to it.

Quoted 10 lines

The changes include:
1. Removed #if defined(ISP2401) in isys and related directories.
2. Removed the debug codes for dumping status.
3. Made two individual enum to define the MIPI format for both types of atomisp.
4. The input system code should include both input system (ISP2400 and ISP2401) headers since a generic driver should cover all types of devcices.
5. The initialization codes of the input system was modified to initiate atomisp input system in a generic manner.

Quoted 9 lines

Thank you very much for all your hard work on this.

The entire series looks good to me:

for the series. I'll merge this into my media-atomisp branch when I can make some time to do so.

Thank you for reviewing

Quoted 64 lines

Regards,

Hans

Quoted 57 lines

Kate Hsuan (11):
media: atomisp: ia_css_debug: Removed debug codes for dumping status
media: atomisp: Make two individual enum to define the MIPI format
media: atomisp: Included both input system headers
media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the
driver generic
media: atomisp: isys: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to
make driver generic
media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: Compile the object codes for a generic driver
media: atomisp: rx: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: isys_init: Initiate atomisp in a generic manner

 drivers/staging/media/atomisp/Makefile        |  12 +-
 .../pci/css_2401_system/host/isys_irq_local.h |   3 -
 .../css_2401_system/host/isys_irq_private.h   |   2 -
 .../pci/css_2401_system/isys_irq_global.h     |   2 -
 .../host/input_formatter.c                    |   2 -
 .../hive_isp_css_common/host/input_system.c   |  75 -----
 .../host/isys_dma_public.h                    |   2 -
 .../host/isys_irq_public.h                    |   2 -
 .../hive_isp_css_include/host/isys_public.h   |  19 --
 .../pci/hive_isp_css_include/isys_irq.h       |   2 -
 .../media/atomisp/pci/input_system_local.h    |   7 +-
 .../media/atomisp/pci/input_system_private.h  |   7 +-
 .../media/atomisp/pci/input_system_public.h   |   4 +-
 .../atomisp/pci/isp2400_input_system_local.h  |  89 +++---
 .../pci/isp2400_input_system_private.h        |   4 +-
 .../atomisp/pci/isp2400_input_system_public.h |  13 +-
 .../atomisp/pci/isp2401_input_system_local.h  |  88 +++---
 .../pci/isp2401_input_system_private.h        | 112 +-------
 .../runtime/debug/interface/ia_css_debug.h    |   6 -
 .../pci/runtime/debug/src/ia_css_debug.c      | 256 ------------------
 .../atomisp/pci/runtime/ifmtr/src/ifmtr.c     |   2 -
 .../pci/runtime/isys/interface/ia_css_isys.h  |   9 +-
 .../runtime/isys/interface/ia_css_isys_comm.h |   2 -
 .../pci/runtime/isys/src/csi_rx_rmgr.c        |   2 -
 .../pci/runtime/isys/src/isys_dma_rmgr.c      |   2 -
 .../atomisp/pci/runtime/isys/src/isys_init.c  |  31 +--
 .../runtime/isys/src/isys_stream2mmio_rmgr.c  |   2 -
 .../media/atomisp/pci/runtime/isys/src/rx.c   | 227 ++++++++++------
 .../pci/runtime/isys/src/virtual_isys.c       |   8 +-
 .../pipeline/interface/ia_css_pipeline.h      |   2 -
 .../pci/runtime/pipeline/src/pipeline.c       |   2 -
 drivers/staging/media/atomisp/pci/sh_css.c    |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.c |   2 -
 drivers/staging/media/atomisp/pci/sh_css_sp.h |   2 -
 34 files changed, 253 insertions(+), 749 deletions(-)
Signature · 2 lines
BR,
Kate
#14 lore raw
In reply to Kate Hsuan

Hi,

Quoted 26 lines · Kate Hsuan

This patch set is to remove #if defined(ISP2401) to make the driver generic. We focused on removing the #if defined(ISP2401) in isys and necessary files related to it.

The changes include:
1. Removed #if defined(ISP2401) in isys and related directories.
2. Removed the debug codes for dumping status.
3. Made two individual enum to define the MIPI format for both types of atomisp.
4. The input system code should include both input system (ISP2400 and ISP2401) headers since a generic driver should cover all types of devcices.
5. The initialization codes of the input system was modified to initiate atomisp input system in a generic manner.

Kate Hsuan (11):
media: atomisp: ia_css_debug: Removed debug codes for dumping status
media: atomisp: Make two individual enum to define the MIPI format
media: atomisp: Included both input system headers
media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the
driver generic
media: atomisp: isys: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to
make driver generic

Quoted 8 lines

media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: Compile the object codes for a generic driver
media: atomisp: rx: Removed #if defined(ISP2401) to make driver
generic
media: atomisp: isys_init: Initiate atomisp in a generic manner

Thanks, I've merged this into my media-atomisp branch now:

https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp

Please base any further patches on top of this branch.

Regards,

Hans