include/media/v4l2-cci.h
Source file repositories/reference/linux-study-clean/include/media/v4l2-cci.h
File Facts
- System
- Linux kernel
- Corpus path
include/media/v4l2-cci.h- Extension
.h- Size
- 4869 bytes
- Lines
- 142
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/bits.hlinux/types.h
Detected Declarations
struct i2c_clientstruct regmapstruct cci_reg_sequence
Annotated Snippet
struct cci_reg_sequence {
u32 reg;
u64 val;
};
/*
* Macros to define register address with the register width encoded
* into the higher bits.
*/
#define CCI_REG_ADDR_MASK GENMASK(15, 0)
#define CCI_REG_WIDTH_SHIFT 16
#define CCI_REG_WIDTH_MASK GENMASK(19, 16)
/*
* Private CCI register flags, for the use of drivers.
*/
#define CCI_REG_PRIVATE_SHIFT 28U
#define CCI_REG_PRIVATE_MASK GENMASK(31U, CCI_REG_PRIVATE_SHIFT)
#define CCI_REG_WIDTH_BYTES(x) FIELD_GET(CCI_REG_WIDTH_MASK, x)
#define CCI_REG_WIDTH(x) (CCI_REG_WIDTH_BYTES(x) << 3)
#define CCI_REG_ADDR(x) FIELD_GET(CCI_REG_ADDR_MASK, x)
#define CCI_REG_LE BIT(20)
#define CCI_REG8(x) ((1 << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG16(x) ((2 << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG24(x) ((3 << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG32(x) ((4 << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG64(x) ((8 << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG16_LE(x) (CCI_REG_LE | (2U << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG24_LE(x) (CCI_REG_LE | (3U << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG32_LE(x) (CCI_REG_LE | (4U << CCI_REG_WIDTH_SHIFT) | (x))
#define CCI_REG64_LE(x) (CCI_REG_LE | (8U << CCI_REG_WIDTH_SHIFT) | (x))
/**
* cci_read() - Read a value from a single CCI register
*
* @map: Register map to read from
* @reg: Register address to read, use CCI_REG#() macros to encode reg width
* @val: Pointer to store read value
* @err: Optional pointer to store errors, if a previous error is set
* then the read will be skipped
*
* Return: %0 on success or a negative error code on failure.
*/
int cci_read(struct regmap *map, u32 reg, u64 *val, int *err);
/**
* cci_write() - Write a value to a single CCI register
*
* @map: Register map to write to
* @reg: Register address to write, use CCI_REG#() macros to encode reg width
* @val: Value to be written
* @err: Optional pointer to store errors, if a previous error is set
* then the write will be skipped
*
* Return: %0 on success or a negative error code on failure.
*/
int cci_write(struct regmap *map, u32 reg, u64 val, int *err);
/**
* cci_update_bits() - Perform a read/modify/write cycle on
* a single CCI register
*
* @map: Register map to update
* @reg: Register address to update, use CCI_REG#() macros to encode reg width
* @mask: Bitmask to change
* @val: New value for bitmask
* @err: Optional pointer to store errors, if a previous error is set
* then the update will be skipped
*
* Note this uses read-modify-write to update the bits, atomicity with regards
* to other cci_*() register access functions is NOT guaranteed.
*
* Return: %0 on success or a negative error code on failure.
*/
int cci_update_bits(struct regmap *map, u32 reg, u64 mask, u64 val, int *err);
/**
* cci_multi_reg_write() - Write multiple registers to the device
*
* @map: Register map to write to
* @regs: Array of structures containing register-address, -value pairs to be
* written, register-addresses use CCI_REG#() macros to encode reg width
* @num_regs: Number of registers to write
* @err: Optional pointer to store errors, if a previous error is set
* then the write will be skipped
*
* Write multiple registers to the device where the set of register, value
* pairs are supplied in any order, possibly not all in a single range.
*
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/types.h`.
- Detected declarations: `struct i2c_client`, `struct regmap`, `struct cci_reg_sequence`.
- Atlas domain: Repository Root And Misc / include.
- 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.