drivers/media/platform/qcom/camss/camss-format.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-format.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-format.c- Extension
.c- Size
- 2543 bytes
- Lines
- 106
- Domain
- Driver Families
- Bucket
- drivers/media
- 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
linux/bits.hlinux/bug.hlinux/errno.hlinux/lcm.hcamss-format.h
Detected Declarations
function Copyrightfunction camss_format_get_bpl_alignmentfunction camss_format_find_codefunction camss_format_find_format
Annotated Snippet
if (req_code) {
if (req_code == code[i])
return req_code;
} else {
if (i == index)
return code[i];
}
}
return code[0];
}
/*
* camss_format_find_format - Find a format in an array
* @code: media bus format code
* @pixelformat: V4L2 pixel format FCC identifier
* @formats: a pointer to formats array
* @nformats: size of @formats array
*
* Return index of a format or a negative error code otherwise
*/
int camss_format_find_format(u32 code, u32 pixelformat, const struct camss_format_info *formats,
unsigned int nformats)
{
unsigned int i;
for (i = 0; i < nformats; i++) {
if (formats[i].code == code &&
formats[i].pixelformat == pixelformat)
return i;
}
for (i = 0; i < nformats; i++) {
if (formats[i].code == code)
return i;
}
return -EINVAL;
}
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bug.h`, `linux/errno.h`, `linux/lcm.h`, `camss-format.h`.
- Detected declarations: `function Copyright`, `function camss_format_get_bpl_alignment`, `function camss_format_find_code`, `function camss_format_find_format`.
- Atlas domain: Driver Families / drivers/media.
- 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.