drivers/staging/media/atomisp/pci/hive_isp_css_shared/host/tag.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/hive_isp_css_shared/host/tag.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/hive_isp_css_shared/host/tag.c- Extension
.c- Size
- 2074 bytes
- Lines
- 84
- 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
tag.hplatform_support.hassert_support.htag_local.h
Detected Declarations
function Copyrightfunction sh_css_encode_tag_descr
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*/
#include "tag.h"
#include <platform_support.h> /* NULL */
#include <assert_support.h>
#include "tag_local.h"
/*
* @brief Creates the tag description from the given parameters.
* @param[in] num_captures
* @param[in] skip
* @param[in] offset
* @param[out] tag_descr
*/
void
sh_css_create_tag_descr(int num_captures,
unsigned int skip,
int offset,
unsigned int exp_id,
struct sh_css_tag_descr *tag_descr)
{
assert(tag_descr);
tag_descr->num_captures = num_captures;
tag_descr->skip = skip;
tag_descr->offset = offset;
tag_descr->exp_id = exp_id;
}
/*
* @brief Encodes the members of tag description into a 32-bit value.
* @param[in] tag Pointer to the tag description
* @return (unsigned int) Encoded 32-bit tag-info
*/
unsigned int
sh_css_encode_tag_descr(struct sh_css_tag_descr *tag)
{
int num_captures;
unsigned int num_captures_sign;
unsigned int skip;
int offset;
unsigned int offset_sign;
unsigned int exp_id;
unsigned int encoded_tag;
assert(tag);
if (tag->num_captures < 0) {
num_captures = -tag->num_captures;
num_captures_sign = 1;
} else {
num_captures = tag->num_captures;
num_captures_sign = 0;
}
skip = tag->skip;
if (tag->offset < 0) {
offset = -tag->offset;
offset_sign = 1;
} else {
offset = tag->offset;
offset_sign = 0;
}
exp_id = tag->exp_id;
if (exp_id != 0) {
/* we encode either an exp_id or capture data */
assert((num_captures == 0) && (skip == 0) && (offset == 0));
encoded_tag = TAG_EXP | (exp_id & 0xFF) << TAG_EXP_ID_SHIFT;
} else {
encoded_tag = TAG_CAP
| ((num_captures_sign & 0x00000001) << TAG_NUM_CAPTURES_SIGN_SHIFT)
| ((offset_sign & 0x00000001) << TAG_OFFSET_SIGN_SHIFT)
| ((num_captures & 0x000000FF) << TAG_NUM_CAPTURES_SHIFT)
| ((skip & 0x000000FF) << TAG_OFFSET_SHIFT)
| ((offset & 0x000000FF) << TAG_SKIP_SHIFT);
}
return encoded_tag;
}
Annotation
- Immediate include surface: `tag.h`, `platform_support.h`, `assert_support.h`, `tag_local.h`.
- Detected declarations: `function Copyright`, `function sh_css_encode_tag_descr`.
- 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.