drivers/media/test-drivers/vimc/vimc-common.h
Source file repositories/reference/linux-study-clean/drivers/media/test-drivers/vimc/vimc-common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/test-drivers/vimc/vimc-common.h- Extension
.h- Size
- 8704 bytes
- Lines
- 285
- 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/platform_device.hlinux/slab.hmedia/media-device.hmedia/v4l2-device.hmedia/tpg/v4l2-tpg.hmedia/v4l2-ctrls.h
Detected Declarations
struct vimc_pix_mapstruct vimc_ent_devicestruct vimc_devicestruct vimc_ent_typestruct vimc_ent_configstruct vimc_sensor_deviceenum vimc_allocator_typeenum vimc_sensor_osd_mode
Annotated Snippet
struct vimc_pix_map {
unsigned int code[VIMC_PIX_FMT_MAX_CODES];
unsigned int bpp;
u32 pixelformat;
bool bayer;
};
/**
* struct vimc_ent_device - core struct that represents an entity in the
* topology
*
* @dev: a pointer of the device struct of the driver
* @ent: the pointer to struct media_entity for the node
* @process_frame: callback send a frame to that node
* @vdev_get_format: callback that returns the current format a pad, used
* only when is_media_entity_v4l2_video_device(ent) returns
* true
*
* Each node of the topology must create a vimc_ent_device struct. Depending on
* the node it will be of an instance of v4l2_subdev or video_device struct
* where both contains a struct media_entity.
* Those structures should embedded the vimc_ent_device struct through
* v4l2_set_subdevdata() and video_set_drvdata() respectively, allowing the
* vimc_ent_device struct to be retrieved from the corresponding struct
* media_entity
*/
struct vimc_ent_device {
struct device *dev;
struct media_entity *ent;
void * (*process_frame)(struct vimc_ent_device *ved,
const void *frame);
void (*vdev_get_format)(struct vimc_ent_device *ved,
struct v4l2_pix_format *fmt);
};
/**
* struct vimc_device - main device for vimc driver
*
* @pipe_cfg: pointer to the vimc pipeline configuration structure
* @ent_devs: array of vimc_ent_device pointers
* @mdev: the associated media_device parent
* @v4l2_dev: Internal v4l2 parent device
*/
struct vimc_device {
const struct vimc_pipeline_config *pipe_cfg;
struct vimc_ent_device **ent_devs;
struct media_device mdev;
struct v4l2_device v4l2_dev;
};
/**
* struct vimc_ent_type Structure for the callbacks of the entity types
*
*
* @add: initializes and registers
* vimc entity - called from vimc-core
* @unregister: unregisters vimc entity - called from vimc-core
* @release: releases vimc entity - called from the v4l2_dev
* release callback
*/
struct vimc_ent_type {
struct vimc_ent_device *(*add)(struct vimc_device *vimc,
const char *vcfg_name);
void (*unregister)(struct vimc_ent_device *ved);
void (*release)(struct vimc_ent_device *ved);
};
/**
* struct vimc_ent_config Structure which describes individual
* configuration for each entity
*
* @name: entity name
* @type: contain the callbacks of this entity type
*
*/
struct vimc_ent_config {
const char *name;
const struct vimc_ent_type *type;
};
enum vimc_sensor_osd_mode {
VIMC_SENSOR_OSD_SHOW_ALL = 0,
VIMC_SENSOR_OSD_SHOW_COUNTERS = 1,
VIMC_SENSOR_OSD_SHOW_NONE = 2
};
struct vimc_sensor_device {
struct vimc_ent_device ved;
struct v4l2_subdev sd;
struct tpg_data tpg;
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/slab.h`, `media/media-device.h`, `media/v4l2-device.h`, `media/tpg/v4l2-tpg.h`, `media/v4l2-ctrls.h`.
- Detected declarations: `struct vimc_pix_map`, `struct vimc_ent_device`, `struct vimc_device`, `struct vimc_ent_type`, `struct vimc_ent_config`, `struct vimc_sensor_device`, `enum vimc_allocator_type`, `enum vimc_sensor_osd_mode`.
- 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.