drivers/gpu/drm/panel/panel-ilitek-ili9341.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-ilitek-ili9341.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panel/panel-ilitek-ili9341.c
Extension
.c
Size
17342 bytes
Lines
589
Domain
Driver Families
Bucket
drivers/gpu
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 ili9341_config {
	u32 max_spi_speed;
	/* mode: the drm display mode */
	const struct drm_display_mode mode;
	/* ca: TODO: need comments for this register */
	u8 ca[ILI9341_CA_LEN];
	/* power_b: Power control B (CFh) */
	u8 power_b[ILI9341_POWER_B_LEN];
	/* power_seq: Power on sequence control (EDh) */
	u8 power_seq[ILI9341_POWER_SEQ_LEN];
	/* dtca: Driver timing control A (E8h) */
	u8 dtca[ILI9341_DTCA_LEN];
	/* dtcb: Driver timing control B (EAh) */
	u8 dtcb[ILI9341_DTCB_LEN];
	/* power_a: Power control A (CBh) */
	u8 power_a[ILI9341_POWER_A_LEN];
	/* frc: Frame Rate Control (In Normal Mode/Full Colors) (B1h) */
	u8 frc[ILI9341_FRC_LEN];
	/* prc: Pump ratio control (F7h) */
	u8 prc;
	/* dfc_1: B6h DISCTRL (Display Function Control) */
	u8 dfc_1[ILI9341_DFC_1_LEN];
	/* power_1: Power Control 1 (C0h) */
	u8 power_1;
	/* power_2: Power Control 2 (C1h) */
	u8 power_2;
	/* vcom_1: VCOM Control 1(C5h) */
	u8 vcom_1[ILI9341_VCOM_1_LEN];
	/* vcom_2: VCOM Control 2(C7h) */
	u8 vcom_2;
	/* address_mode: Memory Access Control (36h) */
	u8 address_mode;
	/* g3amma_en: Enable 3G (F2h) */
	u8 g3amma_en;
	/* rgb_interface: RGB Interface Signal Control (B0h) */
	u8 rgb_interface;
	/* dfc_2: refer to dfc_1 */
	u8 dfc_2[ILI9341_DFC_2_LEN];
	/* column_addr: Column Address Set (2Ah) */
	u8 column_addr[ILI9341_COLUMN_ADDR_LEN];
	/* page_addr: Page Address Set (2Bh) */
	u8 page_addr[ILI9341_PAGE_ADDR_LEN];
	/* interface: Interface Control (F6h) */
	u8 interface[ILI9341_INTERFACE_LEN];
	/*
	 * pixel_format: This command sets the pixel format for the RGB
	 * image data used by
	 */
	u8 pixel_format;
	/*
	 * gamma_curve: This command is used to select the desired Gamma
	 * curve for the
	 */
	u8 gamma_curve;
	/* pgamma: Positive Gamma Correction (E0h) */
	u8 pgamma[ILI9341_PGAMMA_LEN];
	/* ngamma: Negative Gamma Correction (E1h) */
	u8 ngamma[ILI9341_NGAMMA_LEN];
};

struct ili9341 {
	const struct ili9341_config *conf;
	struct drm_panel panel;
	struct gpio_desc *reset_gpio;
	struct gpio_desc *dc_gpio;
	struct mipi_dbi *dbi;
	u32 max_spi_speed;
	struct regulator_bulk_data supplies[3];
};

/*
 * The Stm32f429-disco board has a panel ili9341 connected to ltdc controller
 */
static const struct ili9341_config ili9341_stm32f429_disco_data = {
	.max_spi_speed = 10000000,
	.mode = {
		.clock = 6100,
		.hdisplay = 240,
		.hsync_start = 240 + 10,/* hfp 10 */
		.hsync_end = 240 + 10 + 10,/* hsync 10 */
		.htotal = 240 + 10 + 10 + 20,/* hbp 20 */
		.vdisplay = 320,
		.vsync_start = 320 + 4,/* vfp 4 */
		.vsync_end = 320 + 4 + 2,/* vsync 2 */
		.vtotal = 320 + 4 + 2 + 2,/* vbp 2 */
		.flags = 0,
		.width_mm = 65,
		.height_mm = 50,
		.type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
	},

Annotation

Implementation Notes