drivers/media/platform/renesas/rcar-isp/csisp.c

Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/rcar-isp/csisp.c

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/renesas/rcar-isp/csisp.c
Extension
.c
Size
14219 bytes
Lines
591
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 rcar_isp_format {
	u32 code;
	unsigned int datatype;
	unsigned int procmode;
};

static const struct rcar_isp_format rcar_isp_formats[] = {
	{
		.code = MEDIA_BUS_FMT_RGB888_1X24,
		.datatype = MIPI_CSI2_DT_RGB888,
		.procmode = 0x15
	}, {
		.code = MEDIA_BUS_FMT_Y10_1X10,
		.datatype = MIPI_CSI2_DT_RAW10,
		.procmode = 0x10,
	}, {
		.code = MEDIA_BUS_FMT_UYVY8_1X16,
		.datatype = MIPI_CSI2_DT_YUV422_8B,
		.procmode = 0x0c,
	}, {
		.code = MEDIA_BUS_FMT_YUYV8_1X16,
		.datatype = MIPI_CSI2_DT_YUV422_8B,
		.procmode = 0x0c,
	}, {
		.code = MEDIA_BUS_FMT_UYVY8_2X8,
		.datatype = MIPI_CSI2_DT_YUV422_8B,
		.procmode = 0x0c,
	}, {
		.code = MEDIA_BUS_FMT_YUYV10_2X10,
		.datatype = MIPI_CSI2_DT_YUV422_8B,
		.procmode = 0x0c,
	}, {
		.code = MEDIA_BUS_FMT_SBGGR8_1X8,
		.datatype = MIPI_CSI2_DT_RAW8,
		.procmode = 0x00,
	}, {
		.code = MEDIA_BUS_FMT_SGBRG8_1X8,
		.datatype = MIPI_CSI2_DT_RAW8,
		.procmode = 0x00,
	}, {
		.code = MEDIA_BUS_FMT_SGRBG8_1X8,
		.datatype = MIPI_CSI2_DT_RAW8,
		.procmode = 0x00,
	}, {
		.code = MEDIA_BUS_FMT_SRGGB8_1X8,
		.datatype = MIPI_CSI2_DT_RAW8,
		.procmode = 0x00,
	}, {
		.code = MEDIA_BUS_FMT_SBGGR10_1X10,
		.datatype = MIPI_CSI2_DT_RAW10,
		.procmode = 0x01,
	}, {
		.code = MEDIA_BUS_FMT_SGBRG10_1X10,
		.datatype = MIPI_CSI2_DT_RAW10,
		.procmode = 0x01,
	}, {
		.code = MEDIA_BUS_FMT_SGRBG10_1X10,
		.datatype = MIPI_CSI2_DT_RAW10,
		.procmode = 0x01,
	}, {
		.code = MEDIA_BUS_FMT_SRGGB10_1X10,
		.datatype = MIPI_CSI2_DT_RAW10,
		.procmode = 0x01,
	}, {
		.code = MEDIA_BUS_FMT_SBGGR12_1X12,
		.datatype = MIPI_CSI2_DT_RAW12,
		.procmode = 0x02,
	}, {
		.code = MEDIA_BUS_FMT_SGBRG12_1X12,
		.datatype = MIPI_CSI2_DT_RAW12,
		.procmode = 0x02,
	}, {
		.code = MEDIA_BUS_FMT_SGRBG12_1X12,
		.datatype = MIPI_CSI2_DT_RAW12,
		.procmode = 0x02,
	}, {
		.code = MEDIA_BUS_FMT_SRGGB12_1X12,
		.datatype = MIPI_CSI2_DT_RAW12,
		.procmode = 0x02,
	},
};

static const struct rcar_isp_format *risp_code_to_fmt(unsigned int code)
{
	unsigned int i;

	for (i = 0; i < ARRAY_SIZE(rcar_isp_formats); i++) {
		if (rcar_isp_formats[i].code == code)
			return &rcar_isp_formats[i];
	}

Annotation

Implementation Notes