drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c- Extension
.c- Size
- 4400 bytes
- Lines
- 158
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
system_global.hassert_support.hplatform_support.hia_css_isys.hbitop_support.hia_css_pipeline.hsh_css_internal.hcsi_rx_rmgr.h
Detected Declarations
function ia_css_isys_csi_rx_lut_rmgr_initfunction ia_css_isys_csi_rx_lut_rmgr_uninitfunction ia_css_isys_csi_rx_lut_rmgr_acquirefunction ia_css_isys_csi_rx_lut_rmgr_releasefunction ia_css_isys_csi_rx_register_streamfunction ia_css_isys_csi_rx_unregister_stream
Annotated Snippet
if (packet_type == CSI_MIPI_PACKET_TYPE_LONG) {
max_num_packets_of_type = N_LONG_PACKET_LUT_ENTRIES[backend];
num_active_of_type = cur_rsrc->num_long_packets;
} else {
max_num_packets_of_type = N_SHORT_PACKET_LUT_ENTRIES[backend];
num_active_of_type = cur_rsrc->num_short_packets;
}
if (num_active_of_type < max_num_packets_of_type) {
for (i = 0; i < max_num_packets_of_type; i++) {
if (bitop_getbit(cur_rsrc->active_table, i) == 0) {
bitop_setbit(cur_rsrc->active_table, i);
if (packet_type == CSI_MIPI_PACKET_TYPE_LONG) {
entry->long_packet_entry = i;
entry->short_packet_entry = 0;
cur_rsrc->num_long_packets++;
} else {
entry->long_packet_entry = 0;
entry->short_packet_entry = i;
cur_rsrc->num_short_packets++;
}
cur_rsrc->num_active++;
retval = true;
break;
}
}
}
}
return retval;
}
void ia_css_isys_csi_rx_lut_rmgr_release(
csi_rx_backend_ID_t backend,
csi_mipi_packet_type_t packet_type,
csi_rx_backend_lut_entry_t *entry)
{
u32 max_num_packets;
isys_csi_rx_rsrc_t *cur_rsrc = NULL;
u32 packet_entry = 0;
assert(backend < N_CSI_RX_BACKEND_ID);
assert(entry);
assert((packet_type >= CSI_MIPI_PACKET_TYPE_LONG) ||
(packet_type <= CSI_MIPI_PACKET_TYPE_SHORT));
if ((backend < N_CSI_RX_BACKEND_ID) && (entry)) {
if (packet_type == CSI_MIPI_PACKET_TYPE_LONG) {
max_num_packets = N_LONG_PACKET_LUT_ENTRIES[backend];
packet_entry = entry->long_packet_entry;
} else {
max_num_packets = N_SHORT_PACKET_LUT_ENTRIES[backend];
packet_entry = entry->short_packet_entry;
}
cur_rsrc = &isys_csi_rx_rsrc[backend];
if ((packet_entry < max_num_packets) && (cur_rsrc->num_active > 0)) {
if (bitop_getbit(cur_rsrc->active_table, packet_entry) == 1) {
bitop_clearbit(cur_rsrc->active_table, packet_entry);
if (packet_type == CSI_MIPI_PACKET_TYPE_LONG)
cur_rsrc->num_long_packets--;
else
cur_rsrc->num_short_packets--;
cur_rsrc->num_active--;
}
}
}
}
int ia_css_isys_csi_rx_register_stream(
enum mipi_port_id port,
uint32_t isys_stream_id)
{
int retval = -EINVAL;
if ((port < N_INPUT_SYSTEM_CSI_PORT) &&
(isys_stream_id < SH_CSS_MAX_ISYS_CHANNEL_NODES)) {
struct sh_css_sp_pipeline_io_status *pipe_io_status;
pipe_io_status = ia_css_pipeline_get_pipe_io_status();
if (bitop_getbit(pipe_io_status->active[port], isys_stream_id) == 0) {
bitop_setbit(pipe_io_status->active[port], isys_stream_id);
pipe_io_status->running[port] = 0;
retval = 0;
}
}
return retval;
}
Annotation
- Immediate include surface: `system_global.h`, `assert_support.h`, `platform_support.h`, `ia_css_isys.h`, `bitop_support.h`, `ia_css_pipeline.h`, `sh_css_internal.h`, `csi_rx_rmgr.h`.
- Detected declarations: `function ia_css_isys_csi_rx_lut_rmgr_init`, `function ia_css_isys_csi_rx_lut_rmgr_uninit`, `function ia_css_isys_csi_rx_lut_rmgr_acquire`, `function ia_css_isys_csi_rx_lut_rmgr_release`, `function ia_css_isys_csi_rx_register_stream`, `function ia_css_isys_csi_rx_unregister_stream`.
- 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.