drivers/staging/media/atomisp/pci/runtime/event/src/event.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/event/src/event.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/runtime/event/src/event.c- Extension
.c- Size
- 2285 bytes
- Lines
- 102
- 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
sh_css_sp.hdma.htype_support.hia_css_binary.hsh_css_hrt.hsh_css_defs.hsh_css_internal.hia_css_debug.hia_css_debug_internal.hsh_css_legacy.hgdc_device.hassert_support.hia_css_queue.hia_css_event.h
Detected Declarations
function Copyrightfunction ia_css_event_decode
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2010 - 2015, Intel Corporation.
*/
#include "sh_css_sp.h"
#include "dma.h" /* N_DMA_CHANNEL_ID */
#include <type_support.h>
#include "ia_css_binary.h"
#include "sh_css_hrt.h"
#include "sh_css_defs.h"
#include "sh_css_internal.h"
#include "ia_css_debug.h"
#include "ia_css_debug_internal.h"
#include "sh_css_legacy.h"
#include "gdc_device.h" /* HRT_GDC_N */
/*#include "sp.h"*/ /* host2sp_enqueue_frame_data() */
#include "assert_support.h"
#include "ia_css_queue.h" /* host_sp_enqueue_XXX */
#include "ia_css_event.h" /* ia_css_event_encode */
/*
* @brief Encode the information into the software-event.
* Refer to "sw_event_public.h" for details.
*/
bool ia_css_event_encode(
u8 *in,
u8 nr,
uint32_t *out)
{
bool ret;
u32 nr_of_bits;
u32 i;
assert(in);
assert(out);
OP___assert(nr > 0 && nr <= MAX_NR_OF_PAYLOADS_PER_SW_EVENT);
/* initialize the output */
*out = 0;
/* get the number of bits per information */
nr_of_bits = sizeof(uint32_t) * 8 / nr;
/* compress the all inputs into a signle output */
for (i = 0; i < nr; i++) {
*out <<= nr_of_bits;
*out |= in[i];
}
/* get the return value */
ret = (nr > 0 && nr <= MAX_NR_OF_PAYLOADS_PER_SW_EVENT);
return ret;
}
void ia_css_event_decode(
u32 event,
uint8_t *payload)
{
assert(payload[1] == 0);
assert(payload[2] == 0);
assert(payload[3] == 0);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"ia_css_event_decode() enter:\n");
/* First decode according to the common case
* In case of a PORT_EOF event we overwrite with
* the specific values
* This is somewhat ugly but probably somewhat efficient
* (and it avoids some code duplication)
*/
payload[0] = event & 0xff; /*event_code */
payload[1] = (event >> 8) & 0xff;
payload[2] = (event >> 16) & 0xff;
payload[3] = 0;
switch (payload[0]) {
case SH_CSS_SP_EVENT_PORT_EOF:
payload[2] = 0;
payload[3] = (event >> 24) & 0xff;
break;
Annotation
- Immediate include surface: `sh_css_sp.h`, `dma.h`, `type_support.h`, `ia_css_binary.h`, `sh_css_hrt.h`, `sh_css_defs.h`, `sh_css_internal.h`, `ia_css_debug.h`.
- Detected declarations: `function Copyright`, `function ia_css_event_decode`.
- 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.