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.

Dependency Surface

Detected Declarations

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

Implementation Notes