drivers/media/i2c/vd55g1.c

Source file repositories/reference/linux-study-clean/drivers/media/i2c/vd55g1.c

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/vd55g1.c
Extension
.c
Size
70248 bytes
Lines
2062
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 vd55g1_mode {
	u32 width;
	u32 height;
};

static const u32 vd55g1_mbus_formats_mono[] = {
	MEDIA_BUS_FMT_Y8_1X8,
	MEDIA_BUS_FMT_Y10_1X10,
};

/* Format order is : no flip, hflip, vflip, both */
static const u32 vd55g1_mbus_formats_bayer[][4] = {
	{
		MEDIA_BUS_FMT_SRGGB8_1X8,
		MEDIA_BUS_FMT_SGRBG8_1X8,
		MEDIA_BUS_FMT_SGBRG8_1X8,
		MEDIA_BUS_FMT_SBGGR8_1X8,
	},
	{
		MEDIA_BUS_FMT_SRGGB10_1X10,
		MEDIA_BUS_FMT_SGRBG10_1X10,
		MEDIA_BUS_FMT_SGBRG10_1X10,
		MEDIA_BUS_FMT_SBGGR10_1X10,
	},
};

static const struct vd55g1_mode vd55g1_supported_modes[] = {
	{
		.width = VD55G1_WIDTH,
		.height = VD55G1_HEIGHT,
	},
	{
		.width = 800,
		.height = VD55G1_HEIGHT,
	},
	{
		.width = 800,
		.height = 600,
	},
	{
		.width = 640,
		.height = 480,
	},
	{
		.width = 320,
		.height = 240,
	},
};

enum vd55g1_expo_state {
	VD55G1_EXP_AUTO,
	VD55G1_EXP_FREEZE,
	VD55G1_EXP_MANUAL,
	VD55G1_EXP_SINGLE_STEP,
	VD55G1_EXP_BYPASS,
};

struct vd55g1_vblank_limits {
	u16 min;
	u16 def;
	u16 max;
};

struct vd55g1 {
	struct device *dev;
	unsigned int id;
	struct v4l2_subdev sd;
	struct media_pad pad;
	struct regulator_bulk_data supplies[ARRAY_SIZE(vd55g1_supply_name)];
	struct gpio_desc *reset_gpio;
	struct clk *xclk;
	struct regmap *regmap;
	u32 xclk_freq;
	u16 oif_ctrl;
	u8 gpios[VD55G1_NB_GPIOS];
	unsigned long ext_leds_mask;
	u32 mipi_rate;
	u32 pixel_clock;
	u64 link_freq;
	struct v4l2_ctrl_handler ctrl_handler;
	struct v4l2_ctrl *pixel_rate_ctrl;
	struct v4l2_ctrl *vblank_ctrl;
	struct v4l2_ctrl *hblank_ctrl;
	struct {
		struct v4l2_ctrl *hflip_ctrl;
		struct v4l2_ctrl *vflip_ctrl;
	};
	struct v4l2_ctrl *patgen_ctrl;
	struct {
		struct v4l2_ctrl *ae_ctrl;

Annotation

Implementation Notes