From patchwork Thu Jul 13 10:02:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE239C0015E for ; Thu, 13 Jul 2023 10:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbjGMKEc (ORCPT ); Thu, 13 Jul 2023 06:04:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234569AbjGMKEG (ORCPT ); Thu, 13 Jul 2023 06:04:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E4326AF for ; Thu, 13 Jul 2023 03:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uS8K+yfO7UzWoVE9gOEq5LpVufWYAbuiGyt8V8rSVTc=; b=T3u3/LtWVv1OR2h0sSYhJmcpnli8EQXxwFsgYa+C8He+Srk1va/3mEb5QMGOP6uj/CIC9d MPI6Qpo8qftGmRa2j7RAzquC7y4Brx7d3XyOh97gu25OERq21L3PSD7I8oeFj0um6gdyyX aBjP0Q1QAUZxwXFTJ3x3pg+GQlhoWBk= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-idWJGwMuOu6xRCAQ0kNr0g-1; Thu, 13 Jul 2023 06:02:51 -0400 X-MC-Unique: idWJGwMuOu6xRCAQ0kNr0g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 361B63C0D848; Thu, 13 Jul 2023 10:02:51 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91955111E3EC; Thu, 13 Jul 2023 10:02:46 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 01/11] media: atomisp: ia_css_debug: Removed debug codes for dumping status Date: Thu, 13 Jul 2023 18:02:21 +0800 Message-ID: <20230713100231.308923-2-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c index 712e01c37870..09aca4e3db22 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c @@ -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) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_public.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_public.h index dac53e324118..9dacef7a5cc1 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_public.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_public.h @@ -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__ */ diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h index c3ae5014a039..8701abc4c991 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h @@ -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; diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h index 85cb61e34192..ad7448744519 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h @@ -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] diff --git a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h index 74bfa10e670e..7c7297b9c146 100644 --- a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h @@ -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__ */ diff --git a/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h b/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h index e4c76428f6dd..f3fdd9a2a5e6 100644 --- a/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h +++ b/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h @@ -231,112 +231,4 @@ static inline void ibuf_ctrl_dump_state(const ibuf_ctrl_ID_t ID, } } -static inline input_system_err_t -input_system_get_state(const input_system_ID_t ID, - input_system_state_t *state) -{ - u32 i; - - (void)(ID); - - /* get the states of all CSI RX frontend devices */ - for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) { - csi_rx_fe_ctrl_get_state( - (csi_rx_frontend_ID_t)i, - &state->csi_rx_fe_ctrl_state[i]); - } - - /* get the states of all CIS RX backend devices */ - for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) { - csi_rx_be_ctrl_get_state( - (csi_rx_backend_ID_t)i, - &state->csi_rx_be_ctrl_state[i]); - } - - /* get the states of all pixelgen devices */ - for (i = 0; i < N_PIXELGEN_ID; i++) { - pixelgen_ctrl_get_state( - (pixelgen_ID_t)i, - &state->pixelgen_ctrl_state[i]); - } - - /* get the states of all stream2mmio devices */ - for (i = 0; i < N_STREAM2MMIO_ID; i++) { - stream2mmio_get_state( - (stream2mmio_ID_t)i, - &state->stream2mmio_state[i]); - } - - /* get the states of all ibuf-controller devices */ - for (i = 0; i < N_IBUF_CTRL_ID; i++) { - ibuf_ctrl_get_state( - (ibuf_ctrl_ID_t)i, - &state->ibuf_ctrl_state[i]); - } - - /* get the states of all isys irq controllers */ - for (i = 0; i < N_ISYS_IRQ_ID; i++) { - isys_irqc_state_get((isys_irq_ID_t)i, &state->isys_irqc_state[i]); - } - - /* TODO: get the states of all ISYS2401 DMA devices */ - for (i = 0; i < N_ISYS2401_DMA_ID; i++) { - } - - return INPUT_SYSTEM_ERR_NO_ERROR; -} - -static inline void input_system_dump_state(const input_system_ID_t ID, - input_system_state_t *state) -{ - u32 i; - - (void)(ID); - - /* dump the states of all CSI RX frontend devices */ - for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) { - csi_rx_fe_ctrl_dump_state( - (csi_rx_frontend_ID_t)i, - &state->csi_rx_fe_ctrl_state[i]); - } - - /* dump the states of all CIS RX backend devices */ - for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) { - csi_rx_be_ctrl_dump_state( - (csi_rx_backend_ID_t)i, - &state->csi_rx_be_ctrl_state[i]); - } - - /* dump the states of all pixelgen devices */ - for (i = 0; i < N_PIXELGEN_ID; i++) { - pixelgen_ctrl_dump_state( - (pixelgen_ID_t)i, - &state->pixelgen_ctrl_state[i]); - } - - /* dump the states of all st2mmio devices */ - for (i = 0; i < N_STREAM2MMIO_ID; i++) { - stream2mmio_dump_state( - (stream2mmio_ID_t)i, - &state->stream2mmio_state[i]); - } - - /* dump the states of all ibuf-controller devices */ - for (i = 0; i < N_IBUF_CTRL_ID; i++) { - ibuf_ctrl_dump_state( - (ibuf_ctrl_ID_t)i, - &state->ibuf_ctrl_state[i]); - } - - /* dump the states of all isys irq controllers */ - for (i = 0; i < N_ISYS_IRQ_ID; i++) { - isys_irqc_state_dump((isys_irq_ID_t)i, &state->isys_irqc_state[i]); - } - - /* TODO: dump the states of all ISYS2401 DMA devices */ - for (i = 0; i < N_ISYS2401_DMA_ID; i++) { - } - - return; -} #endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h index efa136294836..b74ab50ea01e 100644 --- a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h +++ b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c index cf66a40bd6a4..d40ed9c60f1d 100644 --- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c +++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c @@ -1799,258 +1799,6 @@ void ia_css_debug_dump_sp_sw_debug_info(void) return; } -#if !defined(ISP2401) -static void debug_print_isys_capture_unit_state(capture_unit_state_t *state) -{ - assert(state); - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Packet_Length", state->Packet_Length); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Received_Length", state->Received_Length); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Received_Short_Packets", - state->Received_Short_Packets); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Received_Long_Packets", - state->Received_Long_Packets); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Last_Command", state->Last_Command); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Next_Command", state->Next_Command); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Last_Acknowledge", state->Last_Acknowledge); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Next_Acknowledge", state->Next_Acknowledge); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "FSM_State_Info", state->FSM_State_Info); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "StartMode", state->StartMode); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Start_Addr", state->Start_Addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Mem_Region_Size", state->Mem_Region_Size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Num_Mem_Regions", state->Num_Mem_Regions); - return; -} - -static void debug_print_isys_acquisition_unit_state( - acquisition_unit_state_t *state) -{ - assert(state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Received_Short_Packets", - state->Received_Short_Packets); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Received_Long_Packets", - state->Received_Long_Packets); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Last_Command", state->Last_Command); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Next_Command", state->Next_Command); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Last_Acknowledge", state->Last_Acknowledge); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Next_Acknowledge", state->Next_Acknowledge); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "FSM_State_Info", state->FSM_State_Info); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Int_Cntr_Info", state->Int_Cntr_Info); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Start_Addr", state->Start_Addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Mem_Region_Size", state->Mem_Region_Size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "Num_Mem_Regions", state->Num_Mem_Regions); -} - -static void debug_print_isys_ctrl_unit_state(ctrl_unit_state_t *state) -{ - assert(state); - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", "last_cmd", state->last_cmd); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", "next_cmd", state->next_cmd); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", "last_ack", state->last_ack); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", "next_ack", state->next_ack); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "top_fsm_state", state->top_fsm_state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captA_fsm_state", state->captA_fsm_state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captB_fsm_state", state->captB_fsm_state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captC_fsm_state", state->captC_fsm_state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "acq_fsm_state", state->acq_fsm_state); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captA_start_addr", state->captA_start_addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captB_start_addr", state->captB_start_addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captC_start_addr", state->captC_start_addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captA_mem_region_size", - state->captA_mem_region_size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captB_mem_region_size", - state->captB_mem_region_size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captC_mem_region_size", - state->captC_mem_region_size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captA_num_mem_regions", - state->captA_num_mem_regions); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captB_num_mem_regions", - state->captB_num_mem_regions); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "captC_num_mem_regions", - state->captC_num_mem_regions); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "acq_start_addr", state->acq_start_addr); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "acq_mem_region_size", state->acq_mem_region_size); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "acq_num_mem_regions", state->acq_num_mem_regions); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "capt_reserve_one_mem_region", - state->capt_reserve_one_mem_region); - - return; -} - -static void debug_print_isys_state(input_system_state_t *state) -{ - int i; - - assert(state); - ia_css_debug_dtrace(2, "InputSystem State:\n"); - - /* configuration */ - ia_css_debug_dtrace(2, "\tConfiguration:\n"); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_multiCastA_sel", state->str_multicastA_sel); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_multicastB_sel", state->str_multicastB_sel); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_multicastC_sel", state->str_multicastC_sel); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_mux_sel", state->str_mux_sel); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_mon_status", state->str_mon_status); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_mon_irq_cond", state->str_mon_irq_cond); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_mon_irq_en", state->str_mon_irq_en); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "isys_srst", state->isys_srst); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "isys_slv_reg_srst", state->isys_slv_reg_srst); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_deint_portA_cnt", state->str_deint_portA_cnt); - - ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", - "str_deint_portB_cnd", state->str_deint_portB_cnt); - /* end of configuration */ - - /* capture unit state */ - for (i = 0; i < N_CAPTURE_UNIT_ID; i++) { - capture_unit_state_t *capture_unit_state; - - ia_css_debug_dtrace(2, "\tCaptureUnit %d State:\n", i); - - capture_unit_state = &state->capture_unit[i]; - debug_print_isys_capture_unit_state(capture_unit_state); - } - /* end of capture unit state */ - - /* acquisition unit state */ - for (i = 0; i < N_ACQUISITION_UNIT_ID; i++) { - acquisition_unit_state_t *acquisition_unit_state; - - ia_css_debug_dtrace(2, "\tAcquisitionUnit %d State:\n", i); - - acquisition_unit_state = &state->acquisition_unit[i]; - debug_print_isys_acquisition_unit_state(acquisition_unit_state); - } - /* end of acquisition unit state */ - - /* control unit state */ - for (i = 0; i < N_CTRL_UNIT_ID; i++) { - ia_css_debug_dtrace(2, "\tControlUnit %d State:\n", i); - - debug_print_isys_ctrl_unit_state(&state->ctrl_unit_state[i]); - } - /* end of control unit state */ -} -#endif - -void ia_css_debug_dump_isys_state(void) -{ - static input_system_state_t state; - - input_system_get_state(INPUT_SYSTEM0_ID, &state); - -#ifndef ISP2401 - debug_print_isys_state(&state); -#else - input_system_dump_state(INPUT_SYSTEM0_ID, &state); -#endif -} - void ia_css_debug_dump_debug_info(const char *context) { if (!context) @@ -2075,8 +1823,6 @@ void ia_css_debug_dump_debug_info(const char *context) if (!IS_ISP2401) { struct irq_controller_state state; - ia_css_debug_dump_isys_state(); - irq_controller_get_state(IRQ2_ID, &state); ia_css_debug_dtrace(2, "\t%-32s:\n", @@ -2097,8 +1843,6 @@ void ia_css_debug_dump_debug_info(const char *context) ia_css_debug_dtrace(2, "\t\t%-32s: %d\n", "irq_level_not_pulse", state.irq_level_not_pulse); - } else { - ia_css_debug_dump_isys_state(); } ia_css_debug_tagger_state(); diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 4b3fa6d93fe0..67c581d3c1a6 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -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); From patchwork Thu Jul 13 10:02:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18B57C001DF for ; Thu, 13 Jul 2023 10:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234241AbjGMKEd (ORCPT ); Thu, 13 Jul 2023 06:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234570AbjGMKEG (ORCPT ); Thu, 13 Jul 2023 06:04:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99344271C for ; Thu, 13 Jul 2023 03:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KlWx6kDyWobCiLLjoRh2n4jR1/usV6E+i8uFNdA00+E=; b=WoJ+1sLQLC72L3Yg2RL/NG+yws95VlirVPq4GQX4joEsTKtiGS96VekhzPg6oRXCSxP/rQ oFfIUjJxgY9XXooGV3Mk4vhKrXZW2ljll3d4xlLiTEunHr+7WcRizbhaGXY6ILTHINT2/2 /zjjzM+z9NJNMrKhkMGr0TNphZI9DbY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-y1521lq6Nk6J19bC3kUmZA-1; Thu, 13 Jul 2023 06:02:59 -0400 X-MC-Unique: y1521lq6Nk6J19bC3kUmZA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32FDE185A792; Thu, 13 Jul 2023 10:02:59 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8BE11120ABB; Thu, 13 Jul 2023 10:02:54 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 02/11] media: atomisp: Make two individual enum to define the MIPI format Date: Thu, 13 Jul 2023 18:02:22 +0800 Message-ID: <20230713100231.308923-3-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c index 09aca4e3db22..7a74c679ed92 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c @@ -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, diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h index 8701abc4c991..847ad7554eb7 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h @@ -168,40 +168,40 @@ typedef struct acquisition_unit_state_s acquisition_unit_state_t; typedef struct ctrl_unit_state_s ctrl_unit_state_t; typedef enum { - MIPI_FORMAT_RGB888 = 0, - MIPI_FORMAT_RGB555, - MIPI_FORMAT_RGB444, - MIPI_FORMAT_RGB565, - MIPI_FORMAT_RGB666, - MIPI_FORMAT_RAW8, /* 5 */ - MIPI_FORMAT_RAW10, - MIPI_FORMAT_RAW6, - MIPI_FORMAT_RAW7, - MIPI_FORMAT_RAW12, - MIPI_FORMAT_RAW14, /* 10 */ - MIPI_FORMAT_YUV420_8, - MIPI_FORMAT_YUV420_10, - MIPI_FORMAT_YUV422_8, - MIPI_FORMAT_YUV422_10, - MIPI_FORMAT_CUSTOM0, /* 15 */ - MIPI_FORMAT_YUV420_8_LEGACY, - MIPI_FORMAT_EMBEDDED, - MIPI_FORMAT_CUSTOM1, - MIPI_FORMAT_CUSTOM2, - MIPI_FORMAT_CUSTOM3, /* 20 */ - MIPI_FORMAT_CUSTOM4, - MIPI_FORMAT_CUSTOM5, - MIPI_FORMAT_CUSTOM6, - MIPI_FORMAT_CUSTOM7, - MIPI_FORMAT_YUV420_8_SHIFT, /* 25 */ - MIPI_FORMAT_YUV420_10_SHIFT, - MIPI_FORMAT_RAW16, - MIPI_FORMAT_RAW18, - N_MIPI_FORMAT, -} mipi_format_t; - -#define MIPI_FORMAT_JPEG MIPI_FORMAT_CUSTOM0 -#define MIPI_FORMAT_BINARY_8 MIPI_FORMAT_CUSTOM0 + MIPI_FORMAT_2400_RGB888 = 0, + MIPI_FORMAT_2400_RGB555, + MIPI_FORMAT_2400_RGB444, + MIPI_FORMAT_2400_RGB565, + MIPI_FORMAT_2400_RGB666, + MIPI_FORMAT_2400_RAW8, /* 5 */ + MIPI_FORMAT_2400_RAW10, + MIPI_FORMAT_2400_RAW6, + MIPI_FORMAT_2400_RAW7, + MIPI_FORMAT_2400_RAW12, + MIPI_FORMAT_2400_RAW14, /* 10 */ + MIPI_FORMAT_2400_YUV420_8, + MIPI_FORMAT_2400_YUV420_10, + MIPI_FORMAT_2400_YUV422_8, + MIPI_FORMAT_2400_YUV422_10, + MIPI_FORMAT_2400_CUSTOM0, /* 15 */ + MIPI_FORMAT_2400_YUV420_8_LEGACY, + MIPI_FORMAT_2400_EMBEDDED, + MIPI_FORMAT_2400_CUSTOM1, + MIPI_FORMAT_2400_CUSTOM2, + MIPI_FORMAT_2400_CUSTOM3, /* 20 */ + MIPI_FORMAT_2400_CUSTOM4, + MIPI_FORMAT_2400_CUSTOM5, + MIPI_FORMAT_2400_CUSTOM6, + MIPI_FORMAT_2400_CUSTOM7, + MIPI_FORMAT_2400_YUV420_8_SHIFT, /* 25 */ + MIPI_FORMAT_2400_YUV420_10_SHIFT, + MIPI_FORMAT_2400_RAW16, + MIPI_FORMAT_2400_RAW18, + N_MIPI_FORMAT_2400, +} mipi_format_2400_t; + +#define MIPI_FORMAT_JPEG MIPI_FORMAT_2400_CUSTOM0 +#define MIPI_FORMAT_BINARY_8 MIPI_FORMAT_2400_CUSTOM0 #define N_MIPI_FORMAT_CUSTOM 8 /* The number of stores for compressed format types */ diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h index ad7448744519..6477be44a815 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h @@ -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] diff --git a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h index 7c7297b9c146..361a615bbcad 100644 --- a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h @@ -22,45 +22,45 @@ #include "isys_irq.h" typedef enum { - MIPI_FORMAT_SHORT1 = 0x08, - MIPI_FORMAT_SHORT2, - MIPI_FORMAT_SHORT3, - MIPI_FORMAT_SHORT4, - MIPI_FORMAT_SHORT5, - MIPI_FORMAT_SHORT6, - MIPI_FORMAT_SHORT7, - MIPI_FORMAT_SHORT8, - MIPI_FORMAT_EMBEDDED = 0x12, - MIPI_FORMAT_YUV420_8 = 0x18, - MIPI_FORMAT_YUV420_10, - MIPI_FORMAT_YUV420_8_LEGACY, - MIPI_FORMAT_YUV420_8_SHIFT = 0x1C, - MIPI_FORMAT_YUV420_10_SHIFT, - MIPI_FORMAT_YUV422_8 = 0x1E, - MIPI_FORMAT_YUV422_10, - MIPI_FORMAT_RGB444 = 0x20, - MIPI_FORMAT_RGB555, - MIPI_FORMAT_RGB565, - MIPI_FORMAT_RGB666, - MIPI_FORMAT_RGB888, - MIPI_FORMAT_RAW6 = 0x28, - MIPI_FORMAT_RAW7, - MIPI_FORMAT_RAW8, - MIPI_FORMAT_RAW10, - MIPI_FORMAT_RAW12, - MIPI_FORMAT_RAW14, - MIPI_FORMAT_CUSTOM0 = 0x30, - MIPI_FORMAT_CUSTOM1, - MIPI_FORMAT_CUSTOM2, - MIPI_FORMAT_CUSTOM3, - MIPI_FORMAT_CUSTOM4, - MIPI_FORMAT_CUSTOM5, - MIPI_FORMAT_CUSTOM6, - MIPI_FORMAT_CUSTOM7, + MIPI_FORMAT_2401_SHORT1 = 0x08, + MIPI_FORMAT_2401_SHORT2, + MIPI_FORMAT_2401_SHORT3, + MIPI_FORMAT_2401_SHORT4, + MIPI_FORMAT_2401_SHORT5, + MIPI_FORMAT_2401_SHORT6, + MIPI_FORMAT_2401_SHORT7, + MIPI_FORMAT_2401_SHORT8, + MIPI_FORMAT_2401_EMBEDDED = 0x12, + MIPI_FORMAT_2401_YUV420_8 = 0x18, + MIPI_FORMAT_2401_YUV420_10, + MIPI_FORMAT_2401_YUV420_8_LEGACY, + MIPI_FORMAT_2401_YUV420_8_SHIFT = 0x1C, + MIPI_FORMAT_2401_YUV420_10_SHIFT, + MIPI_FORMAT_2401_YUV422_8 = 0x1E, + MIPI_FORMAT_2401_YUV422_10, + MIPI_FORMAT_2401_RGB444 = 0x20, + MIPI_FORMAT_2401_RGB555, + MIPI_FORMAT_2401_RGB565, + MIPI_FORMAT_2401_RGB666, + MIPI_FORMAT_2401_RGB888, + MIPI_FORMAT_2401_RAW6 = 0x28, + MIPI_FORMAT_2401_RAW7, + MIPI_FORMAT_2401_RAW8, + MIPI_FORMAT_2401_RAW10, + MIPI_FORMAT_2401_RAW12, + MIPI_FORMAT_2401_RAW14, + MIPI_FORMAT_2401_CUSTOM0 = 0x30, + MIPI_FORMAT_2401_CUSTOM1, + MIPI_FORMAT_2401_CUSTOM2, + MIPI_FORMAT_2401_CUSTOM3, + MIPI_FORMAT_2401_CUSTOM4, + MIPI_FORMAT_2401_CUSTOM5, + MIPI_FORMAT_2401_CUSTOM6, + MIPI_FORMAT_2401_CUSTOM7, //MIPI_FORMAT_RAW16, /*not supported by 2401*/ //MIPI_FORMAT_RAW18, - N_MIPI_FORMAT -} mipi_format_t; + N_MIPI_FORMAT_2401 +} mipi_format_2401_t; #define N_MIPI_FORMAT_CUSTOM 8 diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c index af153c3fb86d..b58f4fd4a35c 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c @@ -211,142 +211,160 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port, } #endif /* #if !defined(ISP2401) */ -int ia_css_isys_convert_stream_format_to_mipi_format( - enum atomisp_input_format input_format, - mipi_predictor_t compression, - unsigned int *fmt_type) +#if !defined(ISP2401) +static int ia_css_isys_2400_set_fmt_type(enum atomisp_input_format input_format, + unsigned int *fmt_type) { - assert(fmt_type); - /* - * Custom (user defined) modes. Used for compressed - * MIPI transfers - * - * Checkpatch thinks the indent before "if" is suspect - * I think the only suspect part is the missing "else" - * because of the return. - */ - if (compression != MIPI_PREDICTOR_NONE) { - switch (input_format) { - case ATOMISP_INPUT_FORMAT_RAW_6: - *fmt_type = 6; - break; - case ATOMISP_INPUT_FORMAT_RAW_7: - *fmt_type = 7; - break; - case ATOMISP_INPUT_FORMAT_RAW_8: - *fmt_type = 8; - break; - case ATOMISP_INPUT_FORMAT_RAW_10: - *fmt_type = 10; - break; - case ATOMISP_INPUT_FORMAT_RAW_12: - *fmt_type = 12; - break; - case ATOMISP_INPUT_FORMAT_RAW_14: - *fmt_type = 14; - break; - case ATOMISP_INPUT_FORMAT_RAW_16: - *fmt_type = 16; - break; - default: - return -EINVAL; - } - return 0; - } - /* - * This mapping comes from the Arasan CSS function spec - * (CSS_func_spec1.08_ahb_sep29_08.pdf). - * - * MW: For some reason the mapping is not 1-to-1 - */ switch (input_format) { case ATOMISP_INPUT_FORMAT_RGB_888: - *fmt_type = MIPI_FORMAT_RGB888; + *fmt_type = MIPI_FORMAT_2400_RGB888; break; case ATOMISP_INPUT_FORMAT_RGB_555: - *fmt_type = MIPI_FORMAT_RGB555; + *fmt_type = MIPI_FORMAT_2400_RGB555; break; case ATOMISP_INPUT_FORMAT_RGB_444: - *fmt_type = MIPI_FORMAT_RGB444; + *fmt_type = MIPI_FORMAT_2400_RGB444; break; case ATOMISP_INPUT_FORMAT_RGB_565: - *fmt_type = MIPI_FORMAT_RGB565; + *fmt_type = MIPI_FORMAT_2400_RGB565; break; case ATOMISP_INPUT_FORMAT_RGB_666: - *fmt_type = MIPI_FORMAT_RGB666; + *fmt_type = MIPI_FORMAT_2400_RGB666; break; case ATOMISP_INPUT_FORMAT_RAW_8: - *fmt_type = MIPI_FORMAT_RAW8; + *fmt_type = MIPI_FORMAT_2400_RAW8; break; case ATOMISP_INPUT_FORMAT_RAW_10: - *fmt_type = MIPI_FORMAT_RAW10; + *fmt_type = MIPI_FORMAT_2400_RAW10; break; case ATOMISP_INPUT_FORMAT_RAW_6: - *fmt_type = MIPI_FORMAT_RAW6; + *fmt_type = MIPI_FORMAT_2400_RAW6; break; case ATOMISP_INPUT_FORMAT_RAW_7: - *fmt_type = MIPI_FORMAT_RAW7; + *fmt_type = MIPI_FORMAT_2400_RAW7; break; case ATOMISP_INPUT_FORMAT_RAW_12: - *fmt_type = MIPI_FORMAT_RAW12; + *fmt_type = MIPI_FORMAT_2400_RAW12; break; case ATOMISP_INPUT_FORMAT_RAW_14: - *fmt_type = MIPI_FORMAT_RAW14; + *fmt_type = MIPI_FORMAT_2400_RAW14; break; case ATOMISP_INPUT_FORMAT_YUV420_8: - *fmt_type = MIPI_FORMAT_YUV420_8; + *fmt_type = MIPI_FORMAT_2400_YUV420_8; break; case ATOMISP_INPUT_FORMAT_YUV420_10: - *fmt_type = MIPI_FORMAT_YUV420_10; + *fmt_type = MIPI_FORMAT_2400_YUV420_10; break; case ATOMISP_INPUT_FORMAT_YUV422_8: - *fmt_type = MIPI_FORMAT_YUV422_8; + *fmt_type = MIPI_FORMAT_2400_YUV422_8; break; case ATOMISP_INPUT_FORMAT_YUV422_10: - *fmt_type = MIPI_FORMAT_YUV422_10; + *fmt_type = MIPI_FORMAT_2400_YUV422_10; break; case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: - *fmt_type = MIPI_FORMAT_YUV420_8_LEGACY; + *fmt_type = MIPI_FORMAT_2400_YUV420_8_LEGACY; break; case ATOMISP_INPUT_FORMAT_EMBEDDED: - *fmt_type = MIPI_FORMAT_EMBEDDED; + *fmt_type = MIPI_FORMAT_2400_EMBEDDED; break; -#ifndef ISP2401 case ATOMISP_INPUT_FORMAT_RAW_16: /* This is not specified by Arasan, so we use * 17 for now. */ - *fmt_type = MIPI_FORMAT_RAW16; + *fmt_type = MIPI_FORMAT_2400_RAW16; break; case ATOMISP_INPUT_FORMAT_BINARY_8: *fmt_type = MIPI_FORMAT_BINARY_8; break; -#else + case ATOMISP_INPUT_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV422_16: + default: + return -EINVAL; + } + 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) +{ + switch (input_format) { + case ATOMISP_INPUT_FORMAT_RGB_888: + *fmt_type = MIPI_FORMAT_2401_RGB888; + break; + case ATOMISP_INPUT_FORMAT_RGB_555: + *fmt_type = MIPI_FORMAT_2401_RGB555; + break; + case ATOMISP_INPUT_FORMAT_RGB_444: + *fmt_type = MIPI_FORMAT_2401_RGB444; + break; + case ATOMISP_INPUT_FORMAT_RGB_565: + *fmt_type = MIPI_FORMAT_2401_RGB565; + break; + case ATOMISP_INPUT_FORMAT_RGB_666: + *fmt_type = MIPI_FORMAT_2401_RGB666; + break; + case ATOMISP_INPUT_FORMAT_RAW_8: + *fmt_type = MIPI_FORMAT_2401_RAW8; + break; + case ATOMISP_INPUT_FORMAT_RAW_10: + *fmt_type = MIPI_FORMAT_2401_RAW10; + break; + case ATOMISP_INPUT_FORMAT_RAW_6: + *fmt_type = MIPI_FORMAT_2401_RAW6; + break; + case ATOMISP_INPUT_FORMAT_RAW_7: + *fmt_type = MIPI_FORMAT_2401_RAW7; + break; + case ATOMISP_INPUT_FORMAT_RAW_12: + *fmt_type = MIPI_FORMAT_2401_RAW12; + break; + case ATOMISP_INPUT_FORMAT_RAW_14: + *fmt_type = MIPI_FORMAT_2401_RAW14; + break; + case ATOMISP_INPUT_FORMAT_YUV420_8: + *fmt_type = MIPI_FORMAT_2401_YUV420_8; + break; + case ATOMISP_INPUT_FORMAT_YUV420_10: + *fmt_type = MIPI_FORMAT_2401_YUV420_10; + break; + case ATOMISP_INPUT_FORMAT_YUV422_8: + *fmt_type = MIPI_FORMAT_2401_YUV422_8; + break; + case ATOMISP_INPUT_FORMAT_YUV422_10: + *fmt_type = MIPI_FORMAT_2401_YUV422_10; + break; + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: + *fmt_type = MIPI_FORMAT_2401_YUV420_8_LEGACY; + break; + case ATOMISP_INPUT_FORMAT_EMBEDDED: + *fmt_type = MIPI_FORMAT_2401_EMBEDDED; + break; case ATOMISP_INPUT_FORMAT_USER_DEF1: - *fmt_type = MIPI_FORMAT_CUSTOM0; + *fmt_type = MIPI_FORMAT_2401_CUSTOM0; break; case ATOMISP_INPUT_FORMAT_USER_DEF2: - *fmt_type = MIPI_FORMAT_CUSTOM1; + *fmt_type = MIPI_FORMAT_2401_CUSTOM1; break; case ATOMISP_INPUT_FORMAT_USER_DEF3: - *fmt_type = MIPI_FORMAT_CUSTOM2; + *fmt_type = MIPI_FORMAT_2401_CUSTOM2; break; case ATOMISP_INPUT_FORMAT_USER_DEF4: - *fmt_type = MIPI_FORMAT_CUSTOM3; + *fmt_type = MIPI_FORMAT_2401_CUSTOM3; break; case ATOMISP_INPUT_FORMAT_USER_DEF5: - *fmt_type = MIPI_FORMAT_CUSTOM4; + *fmt_type = MIPI_FORMAT_2401_CUSTOM4; break; case ATOMISP_INPUT_FORMAT_USER_DEF6: - *fmt_type = MIPI_FORMAT_CUSTOM5; + *fmt_type = MIPI_FORMAT_2401_CUSTOM5; break; case ATOMISP_INPUT_FORMAT_USER_DEF7: - *fmt_type = MIPI_FORMAT_CUSTOM6; + *fmt_type = MIPI_FORMAT_2401_CUSTOM6; break; case ATOMISP_INPUT_FORMAT_USER_DEF8: - *fmt_type = MIPI_FORMAT_CUSTOM7; + *fmt_type = MIPI_FORMAT_2401_CUSTOM7; break; -#endif case ATOMISP_INPUT_FORMAT_YUV420_16: case ATOMISP_INPUT_FORMAT_YUV422_16: @@ -355,6 +373,62 @@ int ia_css_isys_convert_stream_format_to_mipi_format( } return 0; } +#endif /* #ifdef ISP2401 */ + +int ia_css_isys_convert_stream_format_to_mipi_format( + enum atomisp_input_format input_format, + mipi_predictor_t compression, + unsigned int *fmt_type) +{ + assert(fmt_type); + /* + * Custom (user defined) modes. Used for compressed + * MIPI transfers + * + * Checkpatch thinks the indent before "if" is suspect + * I think the only suspect part is the missing "else" + * because of the return. + */ + if (compression != MIPI_PREDICTOR_NONE) { + switch (input_format) { + case ATOMISP_INPUT_FORMAT_RAW_6: + *fmt_type = 6; + break; + case ATOMISP_INPUT_FORMAT_RAW_7: + *fmt_type = 7; + break; + case ATOMISP_INPUT_FORMAT_RAW_8: + *fmt_type = 8; + break; + case ATOMISP_INPUT_FORMAT_RAW_10: + *fmt_type = 10; + break; + case ATOMISP_INPUT_FORMAT_RAW_12: + *fmt_type = 12; + break; + case ATOMISP_INPUT_FORMAT_RAW_14: + *fmt_type = 14; + break; + case ATOMISP_INPUT_FORMAT_RAW_16: + *fmt_type = 16; + break; + default: + return -EINVAL; + } + return 0; + } + /* + * This mapping comes from the Arasan CSS function spec + * (CSS_func_spec1.08_ahb_sep29_08.pdf). + * + * 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 defined(ISP2401) static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor( diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c index 8fc7746f8639..def8a0b1d2ec 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c @@ -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; From patchwork Thu Jul 13 10:02:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3F56C001DC for ; Thu, 13 Jul 2023 10:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234522AbjGMKEb (ORCPT ); Thu, 13 Jul 2023 06:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234534AbjGMKEG (ORCPT ); Thu, 13 Jul 2023 06:04:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D3112721 for ; Thu, 13 Jul 2023 03:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tBd8xq5oyx9G3T/aPrKzHOWfuV70BpZA65HRhPaYPUs=; b=hvK99uxAsbz+TgPhut5d/daSTisRaseerL7n+dptDfFW3Elz/u5/lelN4tdSN+IOFaVMnq 90oL93JkOyBNgIEfSSmojIkg516kvtAFaI2OOWR06IbA1ZTZ9IFTg6K8+Z+dta7u1C86iV SzLqniwS7xFbMtcTCf/gwJNrauZ9czQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-VR8OT-SNNs-kFLHdsZtaoA-1; Thu, 13 Jul 2023 06:03:06 -0400 X-MC-Unique: VR8OT-SNNs-kFLHdsZtaoA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC5468F9E46; Thu, 13 Jul 2023 10:03:05 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 867A8111E3EB; Thu, 13 Jul 2023 10:03:01 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 03/11] media: atomisp: Included both input system headers Date: Thu, 13 Jul 2023 18:02:23 +0800 Message-ID: <20230713100231.308923-4-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Signed-off-by: Kate Hsuan --- 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(-) diff --git a/drivers/staging/media/atomisp/pci/input_system_local.h b/drivers/staging/media/atomisp/pci/input_system_local.h index 357987d629cd..12f7acfeb79c 100644 --- a/drivers/staging/media/atomisp/pci/input_system_local.h +++ b/drivers/staging/media/atomisp/pci/input_system_local.h @@ -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" diff --git a/drivers/staging/media/atomisp/pci/input_system_private.h b/drivers/staging/media/atomisp/pci/input_system_private.h index 889f204e77d5..148ba2ca2290 100644 --- a/drivers/staging/media/atomisp/pci/input_system_private.h +++ b/drivers/staging/media/atomisp/pci/input_system_private.h @@ -4,8 +4,5 @@ * (c) 2020 Mauro Carvalho Chehab */ -#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" diff --git a/drivers/staging/media/atomisp/pci/input_system_public.h b/drivers/staging/media/atomisp/pci/input_system_public.h index 3f5167fd6643..06b19434b6c0 100644 --- a/drivers/staging/media/atomisp/pci/input_system_public.h +++ b/drivers/staging/media/atomisp/pci/input_system_public.h @@ -4,6 +4,4 @@ * (c) 2020 Mauro Carvalho Chehab */ -#ifndef ISP2401 -# include "isp2400_input_system_public.h" -#endif +#include "isp2400_input_system_public.h" diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h index 847ad7554eb7..e7b84fdbb4e0 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_local.h @@ -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,... */ diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_private.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_private.h index 9c39ca2da923..e011920f00e1 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_private.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_private.h @@ -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" diff --git a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h index 6477be44a815..375c0db84b55 100644 --- a/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h +++ b/drivers/staging/media/atomisp/pci/isp2400_input_system_public.h @@ -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 -#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__ */ diff --git a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h index 361a615bbcad..d9a8d575c58e 100644 --- a/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h +++ b/drivers/staging/media/atomisp/pci/isp2401_input_system_local.h @@ -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" diff --git a/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h b/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h index f3fdd9a2a5e6..845ed0add027 100644 --- a/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h +++ b/drivers/staging/media/atomisp/pci/isp2401_input_system_private.h @@ -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" From patchwork Thu Jul 13 10:02:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0D99C001DC for ; Thu, 13 Jul 2023 10:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234421AbjGMKFN (ORCPT ); Thu, 13 Jul 2023 06:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234036AbjGMKE4 (ORCPT ); Thu, 13 Jul 2023 06:04:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAFB30E8 for ; Thu, 13 Jul 2023 03:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YkGeLXhoWJDeywqUqjCfob2UyIVcBht1YEVSXyCqSX8=; b=P50LGcPLtFVUA32phq1DkUuSwWjkjrQx1A3Ewv9hH0CNS9fA0z55+a7I6xXbJbel7RSg1j nLGegL3b2wpvCbuQNpRyc9g5sQJ4YdVR+YY6IPYs09Vuui7AO3wbZkFh5lyrBoAJqF+cwJ QZ29SWmE/j0l7+R9xAipdrO364FGAnQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-qNa3D6HSPaq0X2frunkvxw-1; Thu, 13 Jul 2023 06:03:42 -0400 X-MC-Unique: qNa3D6HSPaq0X2frunkvxw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A7558F2996; Thu, 13 Jul 2023 10:03:42 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 067D0111E3EC; Thu, 13 Jul 2023 10:03:10 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 04/11] media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic Date: Thu, 13 Jul 2023 18:02:24 +0800 Message-ID: <20230713100231.308923-5-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Removed #if defined(2401) to make the driver generic. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_local.h b/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_local.h index a76987190292..0f585a7e0fa4 100644 --- a/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_local.h +++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_local.h @@ -18,8 +18,6 @@ #include -#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__ */ diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h b/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h index fb168c25bdfc..d94c8e6add72 100644 --- a/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h +++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h @@ -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__ */ diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/isys_irq_global.h b/drivers/staging/media/atomisp/pci/css_2401_system/isys_irq_global.h index a81e4d13ac9f..16336ed73036 100644 --- a/drivers/staging/media/atomisp/pci/css_2401_system/isys_irq_global.h +++ b/drivers/staging/media/atomisp/pci/css_2401_system/isys_irq_global.h @@ -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__ */ From patchwork Thu Jul 13 10:02:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5427BC0015E for ; Thu, 13 Jul 2023 10:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233976AbjGMKF2 (ORCPT ); Thu, 13 Jul 2023 06:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234239AbjGMKFL (ORCPT ); Thu, 13 Jul 2023 06:05:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B41C726BD for ; Thu, 13 Jul 2023 03:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ap+X2t78sySvi00h8AzgFnMtAYAITpWKdoZI1uIAFcs=; b=OpXhZbgGMie65+wgLWu3KKO2ASdyKe+awdACtUUVn4IBu0w5r45yvxVnefddQf+bhQNBAU /hEBMV0U6I/C3HmZTlL+zAvBEXRdv+znKVn5hnfQBTcd83mocNndFSlUeY/rw/NeVBFgwt lkVSf8BUV/6U8IPmwE9rMkX79KFRa4E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-pXfvsAwfNkeN_myUHRvamA-1; Thu, 13 Jul 2023 06:03:49 -0400 X-MC-Unique: pXfvsAwfNkeN_myUHRvamA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AE84858F1E; Thu, 13 Jul 2023 10:03:48 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56148111E3EB; Thu, 13 Jul 2023 10:03:43 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 05/11] media: atomisp: isys: Removed #if defined(ISP2401) to make driver generic Date: Thu, 13 Jul 2023 18:02:25 +0800 Message-ID: <20230713100231.308923-6-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Removed #if defined(ISP2401) to make code generic. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_dma_public.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_dma_public.h index d9b6af898c06..f18a057adb0f 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_dma_public.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_dma_public.h @@ -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__ */ diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_irq_public.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_irq_public.h index 736cbc4e3705..2b13688256cf 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_irq_public.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/isys_irq_public.h @@ -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__ */ diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h index 001c55ea970b..952b633fdca7 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/isys_irq.h @@ -19,10 +19,8 @@ #include #include -#if defined(ISP2401) #include "isys_irq_public.h" -#endif /* defined(ISP2401) */ #endif /* __IA_CSS_ISYS_IRQ_H__ */ From patchwork Thu Jul 13 10:02:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D8BFEB64DD for ; Thu, 13 Jul 2023 10:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234487AbjGMKFe (ORCPT ); Thu, 13 Jul 2023 06:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234425AbjGMKFT (ORCPT ); Thu, 13 Jul 2023 06:05:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA42270A for ; Thu, 13 Jul 2023 03:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I3nz2yTMHQJP+PKyZJFMJM528NFzS7d889pNq2pZCy0=; b=ddB2ZPxmk1Hxz9SFomlBxKieVB3JoradaKdsbha9Whk4H2NyYVEJbddCTBD/P8ih8B6cdY +XgS4ljiujwjn8TnlLuj3xv2dyNhsuijq37504a43alVMxyxpud2R3/uzMLJ2g4ikjoMhb pgIWrRmfwb9qtOf4LTOghvjbrSZdaCs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-L7IkvwnbMwu1hYkBV-FX8g-1; Thu, 13 Jul 2023 06:03:56 -0400 X-MC-Unique: L7IkvwnbMwu1hYkBV-FX8g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E54DD1044592; Thu, 13 Jul 2023 10:03:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9C0F1120ABB; Thu, 13 Jul 2023 10:03:51 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 06/11] media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver generic Date: Thu, 13 Jul 2023 18:02:26 +0800 Message-ID: <20230713100231.308923-7-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Removed #if defined(ISP2401) to make code generic. Signed-off-by: Kate Hsuan --- .../media/atomisp/pci/hive_isp_css_common/host/input_system.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c index 7a74c679ed92..c60f0d5b01c6 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c @@ -15,7 +15,6 @@ #include "system_global.h" -#ifndef ISP2401 #include "input_system.h" #include @@ -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 From patchwork Thu Jul 13 10:02:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1CDBC001DF for ; Thu, 13 Jul 2023 10:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234518AbjGMKFi (ORCPT ); Thu, 13 Jul 2023 06:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234435AbjGMKFV (ORCPT ); Thu, 13 Jul 2023 06:05:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0648E269F for ; Thu, 13 Jul 2023 03:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rOVJDTFrcAstOS0UfsxYlchXQfmdDZV7WwXYoUlB40Q=; b=GQ9AnAgsFRr9at7vglUc0LPj3PqXC60KIPUn8FSW1QKeu8egghdnbz/APC+llb1Fw6H18l TGHNn1M7/tMAXb37JTYwUSpHPwTjwouuNQYbJ+h45tKrONE1c1j+lrymxiuVvmdtAbQc1z DoEkkpHq0yO0u0q3LRnbIkb5OBPGp8s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-299-B3Q0_ON5MWSItB7fqeENUQ-1; Thu, 13 Jul 2023 06:04:03 -0400 X-MC-Unique: B3Q0_ON5MWSItB7fqeENUQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92BEB104458C; Thu, 13 Jul 2023 10:04:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 765CA1120ABB; Thu, 13 Jul 2023 10:03:58 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 07/11] media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic Date: Thu, 13 Jul 2023 18:02:27 +0800 Message-ID: <20230713100231.308923-8-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Removed #if defined(ISP2401) to make driver generic. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h index 222c381ff3b9..5f5dab7252aa 100644 --- a/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h +++ b/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c index e9e187649a65..3d8741e7d5ca 100644 --- a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +++ b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c @@ -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) { From patchwork Thu Jul 13 10:02:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 141BCC0015E for ; Thu, 13 Jul 2023 10:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234429AbjGMKFg (ORCPT ); Thu, 13 Jul 2023 06:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234215AbjGMKFU (ORCPT ); Thu, 13 Jul 2023 06:05:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31FCE271E for ; Thu, 13 Jul 2023 03:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4w6JCt8xhkAp7WrGBI0D8ORfC5IimxZn6ab1tqrxkKw=; b=gX5nNLR49oKa/n5CvvQ/oPOncD0DjOq1pJmjIG0huwKUuIL+iGgQX2vUeam4drMKzQxGYj YhTBzZxZJLcTuGxFOcB0JjEWrvTwUd9epeDqbhSGohuZT1uqpsk/TTu1mFkH5vnpCYZrOB rpvd0VlzOUwbKmtk+rqAGb2BdHloxII= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-4-YnDJHeOF2hcMb5FneZIA-1; Thu, 13 Jul 2023 06:04:10 -0400 X-MC-Unique: 4-YnDJHeOF2hcMb5FneZIA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A13563C0D84F; Thu, 13 Jul 2023 10:04:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 245E1111E3EB; Thu, 13 Jul 2023 10:04:04 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 08/11] media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic Date: Thu, 13 Jul 2023 18:02:28 +0800 Message-ID: <20230713100231.308923-9-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Removed #if defined(ISP2401) to make driver generic. Signed-off-by: Kate Hsuan --- .../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(-) diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c index 5cd6136f21a2..e01f30f137a0 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c @@ -15,7 +15,6 @@ #include "system_global.h" -#ifndef ISP2401 #include "input_formatter.h" #include @@ -243,4 +242,3 @@ void input_formatter_bin_get_state( HIVE_STR2MEM_EN_STAT_UPDATE_ADDRESS); return; } -#endif diff --git a/drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c b/drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c index 6d9f47629fbc..86254888f676 100644 --- a/drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c +++ b/drivers/staging/media/atomisp/pci/runtime/ifmtr/src/ifmtr.c @@ -16,7 +16,6 @@ #include "system_global.h" #include -#ifndef ISP2401 #include "ia_css_ifmtr.h" #include @@ -550,4 +549,3 @@ static int ifmtr_input_start_line( return 0; } -#endif diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c index 297e1b981720..4ef1c9e61ea8 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -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 diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.h b/drivers/staging/media/atomisp/pci/sh_css_sp.h index f69a79b0b0da..b052c40e69bc 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.h +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.h @@ -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, From patchwork Thu Jul 13 10:02:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8425CC00528 for ; Thu, 13 Jul 2023 10:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234549AbjGMKFj (ORCPT ); Thu, 13 Jul 2023 06:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234439AbjGMKFV (ORCPT ); Thu, 13 Jul 2023 06:05:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F07199E for ; Thu, 13 Jul 2023 03:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1aYxseSOr2d/dfdCoFr/Ka7XZlCqqs2xH+zw/vb04Pw=; b=PcMGIgidvT2n8dPEwHg3PYgl3UmqlsCZ55zf+4ue8+CqXEPYOiXVu/3mf8ybkiaCO5AWRU ylWoeDBeyKgHPA8JtFk16EgURMHBqzkyhUDSe6/uIAmDTDNle3sI87h1PP+FwFEKPbz8Jf /vETknmk2USR/jIvnwFzxba2tGQgVqQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-153-SFMMIbHUOgu1TiQwomqeJg-1; Thu, 13 Jul 2023 06:04:16 -0400 X-MC-Unique: SFMMIbHUOgu1TiQwomqeJg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5177800193; Thu, 13 Jul 2023 10:04:15 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0023E111E3EB; Thu, 13 Jul 2023 10:04:11 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 09/11] media: atomisp: Compile the object codes for a generic driver Date: Thu, 13 Jul 2023 18:02:29 +0800 Message-ID: <20230713100231.308923-10-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Signed-off-by: Kate Hsuan --- 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(-) diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index 38b370124109..dcf469bf1cb4 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h b/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h index 711a321e9a3f..d067b9fc43c7 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h +++ b/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys.h @@ -24,20 +24,18 @@ #include #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__ */ diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h b/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h index d80ef42c7a64..784afc82c8d2 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h +++ b/drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h @@ -19,7 +19,6 @@ #include #include -#ifdef ISP2401 #include /* inline */ #include #include /* 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 */ diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c index 3fc9fed1e516..881036c67baf 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c index 261c6460e970..4df0a9188ee6 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c index fb0cb183f701..b6be63746c3e 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c @@ -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 diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c index def8a0b1d2ec..269a81190577 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c @@ -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 From patchwork Thu Jul 13 10:02:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E145C0015E for ; Thu, 13 Jul 2023 10:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234610AbjGMKFy (ORCPT ); Thu, 13 Jul 2023 06:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234492AbjGMKFe (ORCPT ); Thu, 13 Jul 2023 06:05:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B152D45 for ; Thu, 13 Jul 2023 03:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pM3PGfhgQFpLp3ULFTBz/c5W/gDv9O++Gad3Ax1m+78=; b=Z/oCpyEwF+fym4YEu4LsrCvcRfxDgXdHhe9TyA7x8AHWBPwuyYLvIC2GrTRmC16RAk/P2J /M8l3eniwl4dDO1rc5LQKtpTum9m6jFVqpA6ZGWy0BDx27+T6rZl50ait5UIVb9pddd1aq maJ5HAl+6gV4rP4DzbW3Iz7JKeSqoGA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-d0hx51YnO4OhE77etXA7uw-1; Thu, 13 Jul 2023 06:04:24 -0400 X-MC-Unique: d0hx51YnO4OhE77etXA7uw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F3737101A54E; Thu, 13 Jul 2023 10:04:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1460111E3EB; Thu, 13 Jul 2023 10:04:19 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 10/11] media: atomisp: rx: Removed #if defined(ISP2401) to make driver generic Date: Thu, 13 Jul 2023 18:02:30 +0800 Message-ID: <20230713100231.308923-11-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The conflicts of variable declarations were resolved through previous commits so the #if defined(ISP2401) can be removed. Signed-off-by: Kate Hsuan --- .../media/atomisp/pci/runtime/isys/src/rx.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c index b58f4fd4a35c..c8316e0965d0 100644 --- a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c @@ -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) */ From patchwork Thu Jul 13 10:02:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 13311728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C0D3C0015E for ; Thu, 13 Jul 2023 10:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbjGMKGA (ORCPT ); Thu, 13 Jul 2023 06:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbjGMKFl (ORCPT ); Thu, 13 Jul 2023 06:05:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2569B2D7E for ; Thu, 13 Jul 2023 03:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689242676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=roKT0Mw7z+vrtzfyyneQeok4ElOuj23Rtc+8BsjourQ=; b=DW5xDgzYas6+JCX6xBQxdlNRdVcuDg9wEWDeCrSrJaigon3P1bpAXoOfRZ1yxwegOLRIzW HDs15sDBOq4ezOCuQRaFkjye7HDz77AfGIMw2tKPlTnp5PHkkhn4uBAi6AMQ0DLZY82iVB 2efOgqciYvVux7/3dkIt9OqiCkHVkQA= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-sBn24KCnMdqUPUvWfmusFg-1; Thu, 13 Jul 2023 06:04:34 -0400 X-MC-Unique: sBn24KCnMdqUPUvWfmusFg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D1172999B2E; Thu, 13 Jul 2023 10:04:34 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05BA7111E3EC; Thu, 13 Jul 2023 10:04:29 +0000 (UTC) From: Kate Hsuan To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Kate Hsuan Subject: [PATCH 11/11] media: atomisp: isys_init: Initiate atomisp in a generic manner Date: Thu, 13 Jul 2023 18:02:31 +0800 Message-ID: <20230713100231.308923-12-hpa@redhat.com> In-Reply-To: <20230713100231.308923-1-hpa@redhat.com> References: <20230713100231.308923-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Signed-off-by: Kate Hsuan --- .../atomisp/pci/runtime/isys/src/isys_init.c | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 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) -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 -