drivers/media/i2c/isl7998x.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/isl7998x.c
Extension
.c
Size
55704 bytes
Lines
1627
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 isl7998x_datafmt {
	u32			code;
	enum v4l2_colorspace	colorspace;
};

static const struct isl7998x_datafmt isl7998x_colour_fmts[] = {
	{ MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_SRGB },
};

/* Menu items for LINK_FREQ V4L2 control */
static const s64 link_freq_menu_items[] = {
	/* 1 channel, 1 lane or 2 channels, 2 lanes */
	108000000,
	/* 2 channels, 1 lane or 4 channels, 2 lanes */
	216000000,
	/* 4 channels, 1 lane */
	432000000,
};

/* Menu items for TEST_PATTERN V4L2 control */
static const char * const isl7998x_test_pattern_menu[] = {
	"Disabled",
	"Enabled",
};

static const char * const isl7998x_test_pattern_bars[] = {
	"bbbbwb", "bbbwwb", "bbwbwb", "bbwwwb",
};

static const char * const isl7998x_test_pattern_colors[] = {
	"Yellow", "Blue", "Green", "Pink",
};

struct isl7998x_mode {
	unsigned int width;
	unsigned int height;
	enum v4l2_field field;
};

static const struct isl7998x_mode supported_modes[] = {
	{
		.width = 720,
		.height = 576,
		.field = V4L2_FIELD_SEQ_TB,
	},
	{
		.width = 720,
		.height = 480,
		.field = V4L2_FIELD_SEQ_BT,
	},
};

static const struct isl7998x_video_std {
	const v4l2_std_id norm;
	unsigned int id;
	const struct isl7998x_mode *mode;
} isl7998x_std_res[] = {
	{ V4L2_STD_NTSC_443,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_NTSC_443,
	  &supported_modes[1] },
	{ V4L2_STD_PAL_M,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_PAL_M,
	  &supported_modes[1] },
	{ V4L2_STD_PAL_Nc,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_PAL_CN,
	  &supported_modes[0] },
	{ V4L2_STD_PAL_N,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_PAL,
	  &supported_modes[0] },
	{ V4L2_STD_PAL_60,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_PAL_60,
	  &supported_modes[1] },
	{ V4L2_STD_NTSC,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_NTSC_M,
	  &supported_modes[1] },
	{ V4L2_STD_PAL,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_PAL,
	  &supported_modes[0] },
	{ V4L2_STD_SECAM,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_SECAM,
	  &supported_modes[0] },
	{ V4L2_STD_UNKNOWN,
	  ISL7998X_REG_PX_DEC_SDT_STANDARD_UNKNOWN,
	  &supported_modes[1] },
};

struct isl7998x {
	struct v4l2_subdev		subdev;
	struct regmap			*regmap;
	struct gpio_desc		*pd_gpio;

Annotation

Implementation Notes