drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c
Extension
.c
Size
22249 bytes
Lines
832
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

if (!rc) {
			destroy_input_system_input_port(&isys_stream->input_port);
			destroy_input_system_channel(&isys_stream->channel);
			return false;
		}
	}
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
			    "ia_css_isys_stream_create() leave:\n");

	return true;
}

void ia_css_isys_stream_destroy(
    ia_css_isys_stream_h	isys_stream)
{
	destroy_input_system_input_port(&isys_stream->input_port);
	destroy_input_system_channel(&isys_stream->channel);
	if (isys_stream->enable_metadata) {
		/* Destroy metadata channel only if its allocated*/
		destroy_input_system_channel(&isys_stream->md_channel);
	}
}

ia_css_isys_error_t ia_css_isys_stream_calculate_cfg(
    ia_css_isys_stream_h		isys_stream,
    ia_css_isys_descr_t		*isys_stream_descr,
    ia_css_isys_stream_cfg_t	*isys_stream_cfg)
{
	ia_css_isys_error_t rc;

	if (!isys_stream_cfg		||
	    !isys_stream_descr	||
	    !isys_stream)
		return false;

	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
			    "ia_css_isys_stream_calculate_cfg() enter:\n");

	rc  = calculate_input_system_channel_cfg(
		  &isys_stream->channel,
		  &isys_stream->input_port,
		  isys_stream_descr,
		  &isys_stream_cfg->channel_cfg,
		  false);
	if (!rc)
		return false;

	/* configure metadata channel */
	if (isys_stream_descr->metadata.enable) {
		isys_stream_cfg->enable_metadata = true;
		rc  = calculate_input_system_channel_cfg(
			  &isys_stream->md_channel,
			  &isys_stream->input_port,
			  isys_stream_descr,
			  &isys_stream_cfg->md_channel_cfg,
			  true);
		if (!rc)
			return false;
	}

	rc = calculate_input_system_input_port_cfg(
		 &isys_stream->channel,
		 &isys_stream->input_port,
		 isys_stream_descr,
		 &isys_stream_cfg->input_port_cfg);
	if (!rc)
		return false;

	isys_stream->valid = 1;
	isys_stream_cfg->valid = 1;
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
			    "ia_css_isys_stream_calculate_cfg() leave:\n");
	return rc;
}

/* end of Public Methods */

/**************************************************
 *
 * Private Methods
 *
 **************************************************/
static bool create_input_system_channel(
    isp2401_input_system_cfg_t	*cfg,
    bool			metadata,
    input_system_channel_t	*me)
{
	bool rc = true;

	me->dma_id = ISYS2401_DMA0_ID;

Annotation

Implementation Notes