drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
Extension
.c
Size
8197 bytes
Lines
235
Domain
Driver Families
Bucket
drivers/staging
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2010-2015, Intel Corporation.
 */

#include "system_global.h"


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

#include "assert_support.h"

#ifndef __INLINE_INPUT_FORMATTER__
#include "input_formatter_private.h"
#endif /* __INLINE_INPUT_FORMATTER__ */

static const unsigned int input_formatter_alignment[N_INPUT_FORMATTER_ID] = {
	ISP_VEC_ALIGN, ISP_VEC_ALIGN, HIVE_ISP_CTRL_DATA_BYTES
};

const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID] = {
	INPUT_FORMATTER0_SRST_OFFSET,
	INPUT_FORMATTER1_SRST_OFFSET,
	INPUT_FORMATTER2_SRST_OFFSET,
	INPUT_FORMATTER3_SRST_OFFSET
};

const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID] = {
	INPUT_FORMATTER0_SRST_MASK,
	INPUT_FORMATTER1_SRST_MASK,
	INPUT_FORMATTER2_SRST_MASK,
	INPUT_FORMATTER3_SRST_MASK
};

const u8 HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID] = {
	HIVE_INPUT_SWITCH_SELECT_IF_PRIM,
	HIVE_INPUT_SWITCH_SELECT_IF_PRIM,
	HIVE_INPUT_SWITCH_SELECT_IF_SEC,
	HIVE_INPUT_SWITCH_SELECT_STR_TO_MEM
};

/* MW Should be part of system_global.h, where we have the main enumeration */
static const bool HIVE_IF_BIN_COPY[N_INPUT_FORMATTER_ID] = {
	false, false, false, true
};

void input_formatter_rst(
    const input_formatter_ID_t		ID)
{
	hrt_address	addr;
	hrt_data	rst;

	assert(ID < N_INPUT_FORMATTER_ID);

	addr = HIVE_IF_SRST_ADDRESS[ID];
	rst = HIVE_IF_SRST_MASK[ID];

	/* TEMPORARY HACK: THIS RESET BREAKS THE METADATA FEATURE
	 * WICH USES THE STREAM2MEMRY BLOCK.
	 * MUST BE FIXED PROPERLY
	 */
	if (!HIVE_IF_BIN_COPY[ID])
		input_formatter_reg_store(ID, addr, rst);

	return;
}

unsigned int input_formatter_get_alignment(
    const input_formatter_ID_t		ID)
{
	assert(ID < N_INPUT_FORMATTER_ID);

	return input_formatter_alignment[ID];
}

void input_formatter_set_fifo_blocking_mode(
    const input_formatter_ID_t		ID,
    const bool						enable)
{
	assert(ID < N_INPUT_FORMATTER_ID);

	/* cnd_input_formatter_reg_store() */
	if (!HIVE_IF_BIN_COPY[ID]) {
		input_formatter_reg_store(ID,
					  HIVE_IF_BLOCK_FIFO_NO_REQ_ADDRESS, enable);
	}
	return;

Annotation

Implementation Notes