drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c- Extension
.c- Size
- 42196 bytes
- Lines
- 1294
- 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.
- 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
system_global.hinput_system.htype_support.hgp_device.hassert_support.hinput_system_private.h
Detected Declarations
function receiver_set_compressionfunction receiver_port_enablefunction is_receiver_port_enabledfunction receiver_irq_enablefunction receiver_get_irq_infofunction receiver_irq_clearfunction receiver_rstfunction gp_device_rstfunction input_selector_cfg_for_sensorfunction input_switch_rstfunction input_switch_cfgfunction input_system_network_rstfunction input_system_configuration_resetfunction input_system_configure_channelfunction input_buffer_configurationfunction capture_unit_configurefunction acquisition_unit_configurefunction ctrl_unit_configurefunction input_system_network_configurefunction configuration_to_registersfunction input_system_configuration_commitfunction input_system_csi_fifo_channel_cfgfunction input_system_csi_fifo_channel_with_counting_cfgfunction input_system_csi_sram_channel_cfgfunction input_system_csi_xmem_channel_cfgfunction input_system_csi_xmem_acquire_only_channel_cfgfunction input_system_csi_xmem_capture_only_channel_cfgfunction input_system_prbs_channel_cfgfunction input_system_gpfifo_channel_cfgfunction input_system_configure_channel_sensorfunction set_source_typefunction set_csi_cfgfunction input_system_multiplexer_cfg
Annotated Snippet
switch (channel.source_type) {
case INPUT_SYSTEM_SOURCE_SENSOR:
error = input_system_configure_channel_sensor(channel);
break;
case INPUT_SYSTEM_SOURCE_PRBS:
case INPUT_SYSTEM_SOURCE_FIFO:
default:
return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
}
if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
// Input switch channel configurations must be combined in united config.
config.input_switch_cfg.hsync_data_reg[channel.source_cfg.csi_cfg.csi_port * 2]
=
channel.target_cfg.input_switch_channel_cfg.hsync_data_reg[0];
config.input_switch_cfg.hsync_data_reg[channel.source_cfg.csi_cfg.csi_port * 2 +
1] =
channel.target_cfg.input_switch_channel_cfg.hsync_data_reg[1];
config.input_switch_cfg.vsync_data_reg |=
(channel.target_cfg.input_switch_channel_cfg.vsync_data_reg & 0x7) <<
(channel.source_cfg.csi_cfg.csi_port * 3);
// Other targets are just copied and marked as set.
config.target_isp[channel.source_cfg.csi_cfg.csi_port] =
channel.target_cfg.target_isp_cfg;
config.target_sp[channel.source_cfg.csi_cfg.csi_port] =
channel.target_cfg.target_sp_cfg;
config.target_strm2mem[channel.source_cfg.csi_cfg.csi_port] =
channel.target_cfg.target_strm2mem_cfg;
config.target_isp_flags[channel.source_cfg.csi_cfg.csi_port] |=
INPUT_SYSTEM_CFG_FLAG_SET;
config.target_sp_flags[channel.source_cfg.csi_cfg.csi_port] |=
INPUT_SYSTEM_CFG_FLAG_SET;
config.target_strm2mem_flags[channel.source_cfg.csi_cfg.csi_port] |=
INPUT_SYSTEM_CFG_FLAG_SET;
config.ch_flags[channel.ch_id] = INPUT_SYSTEM_CFG_FLAG_SET;
}
return INPUT_SYSTEM_ERR_NO_ERROR;
}
// Function that partitions input buffer space with determining addresses.
static input_system_err_t input_buffer_configuration(void)
{
u32 current_address = 0;
u32 unallocated_memory = IB_CAPACITY_IN_WORDS;
isp2400_ib_buffer_t candidate_buffer_acq = IB_BUFFER_NULL;
u32 size_requested;
input_system_config_flags_t acq_already_specified = INPUT_SYSTEM_CFG_FLAG_RESET;
input_system_csi_port_t port;
for (port = INPUT_SYSTEM_PORT_A; port < N_INPUT_SYSTEM_PORTS; port++) {
csi_cfg_t source = config.csi_value[port];//.csi_cfg;
if (config.csi_flags[port] & INPUT_SYSTEM_CFG_FLAG_SET) {
// Check and set csi buffer in input buffer.
switch (source.buffering_mode) {
case INPUT_SYSTEM_FIFO_CAPTURE:
case INPUT_SYSTEM_XMEM_ACQUIRE:
config.csi_buffer_flags[port] =
INPUT_SYSTEM_CFG_FLAG_BLOCKED; // Well, not used.
break;
case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
case INPUT_SYSTEM_SRAM_BUFFERING:
case INPUT_SYSTEM_XMEM_BUFFERING:
case INPUT_SYSTEM_XMEM_CAPTURE:
size_requested = source.csi_buffer.mem_reg_size *
source.csi_buffer.nof_mem_regs;
if (source.csi_buffer.mem_reg_size > 0
&& source.csi_buffer.nof_mem_regs > 0
&& size_requested <= unallocated_memory
) {
config.csi_buffer[port].mem_reg_addr = current_address;
config.csi_buffer[port].mem_reg_size = source.csi_buffer.mem_reg_size;
config.csi_buffer[port].nof_mem_regs = source.csi_buffer.nof_mem_regs;
current_address += size_requested;
unallocated_memory -= size_requested;
config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_SET;
} else {
config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
return INPUT_SYSTEM_ERR_CONFLICT_ON_RESOURCE;
}
break;
default:
config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
}
Annotation
- Immediate include surface: `system_global.h`, `input_system.h`, `type_support.h`, `gp_device.h`, `assert_support.h`, `input_system_private.h`.
- Detected declarations: `function receiver_set_compression`, `function receiver_port_enable`, `function is_receiver_port_enabled`, `function receiver_irq_enable`, `function receiver_get_irq_info`, `function receiver_irq_clear`, `function receiver_rst`, `function gp_device_rst`, `function input_selector_cfg_for_sensor`, `function input_switch_rst`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.