linux/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2010-015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#include "system_global.h"


#include "input_system.h"
#include <type_support.h>
#include "gp_device.h"

#include "assert_support.h"

#ifndef __INLINE_INPUT_SYSTEM__
#include "input_system_private.h"
#endif /* __INLINE_INPUT_SYSTEM__ */

#define ZERO
#define ONE

static const isp2400_ib_buffer_t   IB_BUFFER_NULL =;

static input_system_err_t input_system_configure_channel(
    const channel_cfg_t		channel);

static input_system_err_t input_system_configure_channel_sensor(
    const channel_cfg_t		channel);

static input_system_err_t input_buffer_configuration(void);

static input_system_err_t configuration_to_registers(void);

static void receiver_rst(const rx_ID_t ID);
static void input_system_network_rst(const input_system_ID_t ID);

static void capture_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const isp2400_ib_buffer_t *const cfg);

static void acquisition_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const isp2400_ib_buffer_t *const cfg);

static void ctrl_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const ctrl_unit_cfg_t *const cfg);

static void input_system_network_configure(
    const input_system_ID_t			ID,
    const input_system_network_cfg_t *const cfg);

// MW: CSI is previously named as "rx" short for "receiver"
static input_system_err_t set_csi_cfg(
    csi_cfg_t *const lhs,
    const csi_cfg_t *const rhs,
    input_system_config_flags_t *const flags);

static input_system_err_t set_source_type(
    input_system_source_t *const lhs,
    const input_system_source_t				rhs,
    input_system_config_flags_t *const flags);

static input_system_err_t input_system_multiplexer_cfg(
    input_system_multiplex_t *const lhs,
    const input_system_multiplex_t			rhs,
    input_system_config_flags_t *const flags);

static void gp_device_rst(const gp_device_ID_t		ID);

static void input_selector_cfg_for_sensor(const gp_device_ID_t	ID);

static void input_switch_rst(const gp_device_ID_t	ID);

static void input_switch_cfg(
    const gp_device_ID_t				ID,
    const input_switch_cfg_t *const cfg
);

void receiver_set_compression(
    const rx_ID_t			ID,
    const unsigned int		cfg_ID,
    const mipi_compressor_t		comp,
    const mipi_predictor_t		pred)
{}

void receiver_port_enable(
    const rx_ID_t			ID,
    const enum mipi_port_id		port_ID,
    const bool			cnd)
{}

bool is_receiver_port_enabled(
    const rx_ID_t			ID,
    const enum mipi_port_id		port_ID)
{}

void receiver_irq_enable(
    const rx_ID_t			ID,
    const enum mipi_port_id		port_ID,
    const rx_irq_info_t		irq_info)
{}

rx_irq_info_t receiver_get_irq_info(
    const rx_ID_t			ID,
    const enum mipi_port_id		port_ID)
{}

void receiver_irq_clear(
    const rx_ID_t			ID,
    const enum mipi_port_id		port_ID,
    const rx_irq_info_t		irq_info)
{}

// MW: "2400" in the name is not good, but this is to avoid a naming conflict
static input_system_cfg2400_t config;

static void receiver_rst(
    const rx_ID_t				ID)
{}

//Single function to reset all the devices mapped via GP_DEVICE.
static void gp_device_rst(const gp_device_ID_t		ID)
{}

static void input_selector_cfg_for_sensor(const gp_device_ID_t ID)
{}

static void input_switch_rst(const gp_device_ID_t ID)
{}

static void input_switch_cfg(
    const gp_device_ID_t			ID,
    const input_switch_cfg_t *const cfg)
{}

static void input_system_network_rst(const input_system_ID_t ID)
{}

// Function that resets current configuration.
input_system_err_t input_system_configuration_reset(void)
{}

// MW: Comments are good, but doxygen is required, place it at the declaration
// Function that appends the channel to current configuration.
static input_system_err_t input_system_configure_channel(
    const channel_cfg_t		channel)
{}

// Function that partitions input buffer space with determining addresses.
static input_system_err_t input_buffer_configuration(void)
{}

static void capture_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const isp2400_ib_buffer_t *const cfg)
{}

static void acquisition_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const isp2400_ib_buffer_t *const cfg)
{}

static void ctrl_unit_configure(
    const input_system_ID_t			ID,
    const sub_system_ID_t			sub_id,
    const ctrl_unit_cfg_t *const cfg)
{}

static void input_system_network_configure(
    const input_system_ID_t				ID,
    const input_system_network_cfg_t *const cfg)
{}

static input_system_err_t configuration_to_registers(void)
{}

// Function that applies the whole configuration.
input_system_err_t input_system_configuration_commit(void)
{}

// FIFO

input_system_err_t	input_system_csi_fifo_channel_cfg(
    u32		ch_id,
    input_system_csi_port_t	port,
    backend_channel_cfg_t	backend_ch,
    target_cfg2400_t	target
)
{}

input_system_err_t	input_system_csi_fifo_channel_with_counting_cfg(
    u32				ch_id,
    u32				nof_frames,
    input_system_csi_port_t			port,
    backend_channel_cfg_t			backend_ch,
    u32				csi_mem_reg_size,
    u32				csi_nof_mem_regs,
    target_cfg2400_t			target
)
{}

// SRAM

input_system_err_t	input_system_csi_sram_channel_cfg(
    u32				ch_id,
    input_system_csi_port_t			port,
    backend_channel_cfg_t			backend_ch,
    u32				csi_mem_reg_size,
    u32				csi_nof_mem_regs,
    //	uint32_t				acq_mem_reg_size,
    //	uint32_t				acq_nof_mem_regs,
    target_cfg2400_t			target
)
{}

//XMEM

// Collects all parameters and puts them in channel_cfg_t.
input_system_err_t	input_system_csi_xmem_channel_cfg(
    u32				ch_id,
    input_system_csi_port_t			port,
    backend_channel_cfg_t			backend_ch,
    u32				csi_mem_reg_size,
    u32				csi_nof_mem_regs,
    u32				acq_mem_reg_size,
    u32				acq_nof_mem_regs,
    target_cfg2400_t			target,
    uint32_t				nof_xmem_buffers
)
{}

input_system_err_t	input_system_csi_xmem_acquire_only_channel_cfg(
    u32				ch_id,
    u32				nof_frames,
    input_system_csi_port_t			port,
    backend_channel_cfg_t			backend_ch,
    u32				acq_mem_reg_size,
    u32				acq_nof_mem_regs,
    target_cfg2400_t			target)
{}

input_system_err_t	input_system_csi_xmem_capture_only_channel_cfg(
    u32				ch_id,
    u32				nof_frames,
    input_system_csi_port_t			port,
    u32				csi_mem_reg_size,
    u32				csi_nof_mem_regs,
    u32				acq_mem_reg_size,
    u32				acq_nof_mem_regs,
    target_cfg2400_t			target)
{}

// Non - CSI

input_system_err_t	input_system_prbs_channel_cfg(
    u32		ch_id,
    u32		nof_frames,//not used yet
    u32		seed,
    u32		sync_gen_width,
    u32		sync_gen_height,
    u32		sync_gen_hblank_cycles,
    u32		sync_gen_vblank_cycles,
    target_cfg2400_t	target
)
{}

// MW: Don't use system specific names, (even in system specific files) "cfg2400" -> cfg
input_system_err_t	input_system_gpfifo_channel_cfg(
    u32		ch_id,
    u32		nof_frames, //not used yet

    target_cfg2400_t	target)
{}

///////////////////////////////////////////////////////////////////////////
//
// Private specialized functions for channel setting.
//
///////////////////////////////////////////////////////////////////////////

// Fills the parameters to config.csi_value[port]
static input_system_err_t input_system_configure_channel_sensor(
    const channel_cfg_t channel)
{}

// Test flags and set structure.
static input_system_err_t set_source_type(
    input_system_source_t *const lhs,
    const input_system_source_t			rhs,
    input_system_config_flags_t *const flags)
{}

// Test flags and set structure.
static input_system_err_t set_csi_cfg(
    csi_cfg_t *const lhs,
    const csi_cfg_t *const rhs,
    input_system_config_flags_t *const flags)
{}

// Test flags and set structure.
static input_system_err_t input_system_multiplexer_cfg(
    input_system_multiplex_t *const lhs,
    const input_system_multiplex_t		rhs,
    input_system_config_flags_t *const flags)
{}