drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c

Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
Extension
.c
Size
27291 bytes
Lines
1061
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 rzg2l_csi2 {
	struct device *dev;
	void __iomem *base;
	struct reset_control *presetn;
	struct reset_control *cmn_rstb;
	const struct rzg2l_csi2_info *info;
	struct clk *sysclk;
	struct clk *vclk;
	unsigned long vclk_rate;

	struct v4l2_subdev subdev;
	struct media_pad pads[NR_OF_RZG2L_CSI2_PAD];

	struct v4l2_async_notifier notifier;
	struct v4l2_subdev *remote_source;

	unsigned short lanes;
	unsigned long hsfreq;

	bool dphy_enabled;
};

struct rzg2l_csi2_info {
	int (*dphy_enable)(struct rzg2l_csi2 *csi2);
	int (*dphy_disable)(struct rzg2l_csi2 *csi2);
	bool has_system_clk;
	unsigned int min_width;
	unsigned int min_height;
	unsigned int max_width;
	unsigned int max_height;
};

struct rzg2l_csi2_timings {
	u32 t_init;
	u32 tclk_miss;
	u32 tclk_settle;
	u32 ths_settle;
	u32 tclk_prepare;
	u32 ths_prepare;
	u32 max_hsfreq;
};

struct rzv2h_csi2_s_hssettlectl {
	unsigned int hsfreq;
	u16 s_hssettlectl;
};

static const struct rzv2h_csi2_s_hssettlectl rzv2h_s_hssettlectl[] = {
	{   90,  1 }, {  130,  2 }, {  180,  3 },
	{  220,  4 }, {  270,  5 }, {  310,  6 },
	{  360,  7 }, {  400,  8 }, {  450,  9 },
	{  490, 10 }, {  540, 11 }, {  580, 12 },
	{  630, 13 }, {  670, 14 }, {  720, 15 },
	{  760, 16 }, {  810, 17 }, {  850, 18 },
	{  900, 19 }, {  940, 20 }, {  990, 21 },
	{ 1030, 22 }, { 1080, 23 }, { 1120, 24 },
	{ 1170, 25 }, { 1220, 26 }, { 1260, 27 },
	{ 1310, 28 }, { 1350, 29 }, { 1400, 30 },
	{ 1440, 31 }, { 1490, 32 }, { 1530, 33 },
	{ 1580, 34 }, { 1620, 35 }, { 1670, 36 },
	{ 1710, 37 }, { 1760, 38 }, { 1800, 39 },
	{ 1850, 40 }, { 1890, 41 }, { 1940, 42 },
	{ 1980, 43 }, { 2030, 44 }, { 2070, 45 },
	{ 2100, 46 },
};

static const struct rzg2l_csi2_timings rzg2l_csi2_global_timings[] = {
	{
		.max_hsfreq = 80,
		.t_init = 79801,
		.tclk_miss = 4,
		.tclk_settle = 23,
		.ths_settle = 31,
		.tclk_prepare = 10,
		.ths_prepare = 19,
	},
	{
		.max_hsfreq = 125,
		.t_init = 79801,
		.tclk_miss = 4,
		.tclk_settle = 23,
		.ths_settle = 28,
		.tclk_prepare = 10,
		.ths_prepare = 19,
	},
	{
		.max_hsfreq = 250,
		.t_init = 79801,
		.tclk_miss = 4,
		.tclk_settle = 23,

Annotation

Implementation Notes