drivers/staging/media/atomisp/pci/runtime/inputfifo/src/inputfifo.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/inputfifo/src/inputfifo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/runtime/inputfifo/src/inputfifo.c- Extension
.c- Size
- 14034 bytes
- Lines
- 521
- 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
platform_support.hia_css_inputfifo.hdevice_access.hsp.hisp.hirq.hfifo_monitor.hevent_fifo.hinput_system.hassert_support.hsh_css_internal.hia_css_isys.hhive_isp_css_streaming_to_mipi_types_hrt.h
Detected Declarations
struct inputfifo_instanceenum inputfifo_mipi_data_typefunction inputfifo_wrap_markerfunction _sh_css_fifo_sndfunction inputfifo_send_data_afunction inputfifo_send_data_bfunction inputfifo_send_datafunction inputfifo_send_ch_id_and_fmt_typefunction inputfifo_start_framefunction inputfifo_end_framefunction inputfifo_send_line2function inputfifo_send_linefunction linesfunction inputfifo_determine_typefunction ia_css_inputfifo_send_input_framefunction ia_css_inputfifo_start_framefunction ia_css_inputfifo_send_linefunction ia_css_inputfifo_send_embedded_linefunction ia_css_inputfifo_end_frame
Annotated Snippet
struct inputfifo_instance {
unsigned int ch_id;
enum atomisp_input_format input_format;
bool two_ppc;
bool streaming;
unsigned int hblank_cycles;
unsigned int marker_cycles;
unsigned int fmt_type;
enum inputfifo_mipi_data_type type;
};
/*
* Maintain a basic streaming to Mipi administration with ch_id as index
* ch_id maps on the "Mipi virtual channel ID" and can have value 0..3
*/
#define INPUTFIFO_NR_OF_S2M_CHANNELS (4)
static struct inputfifo_instance
inputfifo_inst_admin[INPUTFIFO_NR_OF_S2M_CHANNELS];
/* Streaming to MIPI */
static unsigned int inputfifo_wrap_marker(
/* static inline unsigned inputfifo_wrap_marker( */
unsigned int marker)
{
return marker |
(inputfifo_curr_ch_id << HIVE_STR_TO_MIPI_CH_ID_LSB) |
(inputfifo_curr_fmt_type << _HIVE_STR_TO_MIPI_FMT_TYPE_LSB);
}
static inline void
_sh_css_fifo_snd(unsigned int token)
{
while (!can_event_send_token(STR2MIPI_EVENT_ID))
udelay(1);
event_send_token(STR2MIPI_EVENT_ID, token);
return;
}
static void inputfifo_send_data_a(
/* static inline void inputfifo_send_data_a( */
unsigned int data)
{
unsigned int token = (1 << HIVE_STR_TO_MIPI_VALID_A_BIT) |
(data << HIVE_STR_TO_MIPI_DATA_A_LSB);
_sh_css_fifo_snd(token);
return;
}
static void inputfifo_send_data_b(
/* static inline void inputfifo_send_data_b( */
unsigned int data)
{
unsigned int token = (1 << HIVE_STR_TO_MIPI_VALID_B_BIT) |
(data << _HIVE_STR_TO_MIPI_DATA_B_LSB);
_sh_css_fifo_snd(token);
return;
}
static void inputfifo_send_data(
/* static inline void inputfifo_send_data( */
unsigned int a,
unsigned int b)
{
unsigned int token = ((1 << HIVE_STR_TO_MIPI_VALID_A_BIT) |
(1 << HIVE_STR_TO_MIPI_VALID_B_BIT) |
(a << HIVE_STR_TO_MIPI_DATA_A_LSB) |
(b << _HIVE_STR_TO_MIPI_DATA_B_LSB));
_sh_css_fifo_snd(token);
return;
}
static void inputfifo_send_sol(void)
/* static inline void inputfifo_send_sol(void) */
{
hrt_data token = inputfifo_wrap_marker(
1 << HIVE_STR_TO_MIPI_SOL_BIT);
_sh_css_fifo_snd(token);
return;
}
static void inputfifo_send_eol(void)
/* static inline void inputfifo_send_eol(void) */
{
hrt_data token = inputfifo_wrap_marker(
1 << HIVE_STR_TO_MIPI_EOL_BIT);
_sh_css_fifo_snd(token);
return;
}
Annotation
- Immediate include surface: `platform_support.h`, `ia_css_inputfifo.h`, `device_access.h`, `sp.h`, `isp.h`, `irq.h`, `fifo_monitor.h`, `event_fifo.h`.
- Detected declarations: `struct inputfifo_instance`, `enum inputfifo_mipi_data_type`, `function inputfifo_wrap_marker`, `function _sh_css_fifo_snd`, `function inputfifo_send_data_a`, `function inputfifo_send_data_b`, `function inputfifo_send_data`, `function inputfifo_send_ch_id_and_fmt_type`, `function inputfifo_start_frame`, `function inputfifo_end_frame`.
- 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.