drivers/gpu/drm/panel/panel-khadas-ts050.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-khadas-ts050.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panel/panel-khadas-ts050.c
Extension
.c
Size
23153 bytes
Lines
897
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 khadas_ts050_panel {
	struct drm_panel base;
	struct mipi_dsi_device *link;

	struct regulator *supply;
	struct gpio_desc *reset_gpio;
	struct gpio_desc *enable_gpio;
	struct khadas_ts050_panel_data *panel_data;
};

struct khadas_ts050_panel_cmd {
	u8 cmd;
	u8 data[55];
	u8 size;
};

struct khadas_ts050_panel_data {
	struct khadas_ts050_panel_cmd *init_code;
	int len;
};

static const struct khadas_ts050_panel_cmd ts050v2_init_code[] = {
	{0xB9, {0xFF, 0x83, 0x99}, 0x03},
	{0xBA, {0x63, 0x23, 0x68, 0xCF}, 0x04},
	{0xD2, {0x55}, 0x01},
	{0xB1, {0x02, 0x04, 0x70, 0x90, 0x01, 0x32, 0x33,
			0x11, 0x11, 0x4D, 0x57, 0x56, 0x73, 0x02, 0x02}, 0x0f},
	{0xB2, {0x00, 0x80, 0x80, 0xAE, 0x0A, 0x0E, 0x75, 0x11, 0x00, 0x00, 0x00}, 0x0b},
	{0xB4, {0x00, 0xFF, 0x04, 0xA4, 0x02, 0xA0, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02,
			0x00, 0x24,	0x02, 0x04, 0x0A, 0x21, 0x03, 0x00, 0x00, 0x08, 0xA6, 0x88,
			0x04, 0xA4, 0x02, 0xA0,	0x00, 0x00,	0x10, 0x00, 0x00, 0x02, 0x00, 0x24,
			0x02, 0x04, 0x0A, 0x00, 0x00, 0x08,	0xA6, 0x00, 0x08, 0x11}, 0x2e},
	{0xD3, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
			0x18, 0x32, 0x10, 0x09, 0x00, 0x09, 0x32,
			0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
			0x00, 0x00, 0x11, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x0A,
			0x40}, 0x21},
	{0xD5, {0x18, 0x18, 0x18, 0x18, 0x21, 0x20, 0x18, 0x18, 0x19, 0x19, 0x19,
			0x19, 0x18, 0x18, 0x18, 0x18, 0x03, 0x02, 0x01, 0x00, 0x2F, 0x2F,
			0x30, 0x30, 0x31, 0x31, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, 0x20},
	{0xD6, {0x18, 0x18, 0x18, 0x18, 0x20, 0x21, 0x19, 0x19, 0x18, 0x18, 0x19,
			0x19, 0x18, 0x18, 0x18, 0x18, 0x00, 0x01, 0x02, 0x03, 0x2F, 0x2F,
			0x30, 0x30, 0x31, 0x31, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, 0x20},
	{0xD8, {0x0A, 0xBE, 0xFA, 0xA0, 0x0A, 0xBE, 0xFA, 0xA0}, 0x08},
	{0xBD, {0x01}, 0x01},
	{0xD8, {0x0F, 0xFF, 0xFF, 0xE0, 0x0F, 0xFF, 0xFF, 0xE0}, 0x08},
	{0xBD, {0x02}, 0x01},
	{0xD8, {0x0F, 0xFF, 0xFF, 0xE0, 0x0F, 0xFF, 0xFF, 0xE0}, 0x08},
	{0xBD, {0x00}, 0x01},
	{0xE0, {0x01, 0x35, 0x41, 0x3B, 0x79, 0x81, 0x8C, 0x85, 0x8E,
			0x95, 0x9B, 0xA0, 0xA4, 0xAB, 0xB1, 0xB3, 0xB7, 0xC5, 0xBD, 0xC5,
			0xB6, 0xC2, 0xC2, 0x62, 0x5D, 0x66, 0x73, 0x01, 0x35, 0x41, 0x3B,
			0x79, 0x81, 0x8C, 0x85, 0x8E, 0x95, 0x9B, 0xA0, 0xA4, 0xAB, 0xB1,
			0xB3, 0xB7, 0xB5, 0xBD, 0xC5, 0xB6, 0xC2, 0xC2, 0x62, 0x5D, 0x66,
			0x73}, 0x36},
	{0xB6, {0x97, 0x97}, 0x02},
	{0xCC, {0xC8}, 0x02},
	{0xBF, {0x40, 0x41, 0x50, 0x19}, 0x04},
	{0xC6, {0xFF, 0xF9}, 0x02},
	{0xC0, {0x25, 0x5A}, 0x02},
};

/* Only the CMD1 User Command set is documented */
static const struct khadas_ts050_panel_cmd ts050_init_code[] = {
	/* Select Unknown CMD Page (Undocumented) */
	{0xff, {0xee}, 0x01},
	/* Reload CMD1: Don't reload default value to register */
	{0xfb, {0x01}, 0x01},
	{0x1f, {0x45}, 0x01},
	{0x24, {0x4f}, 0x01},
	{0x38, {0xc8}, 0x01},
	{0x39, {0x27}, 0x01},
	{0x1e, {0x77}, 0x01},
	{0x1d, {0x0f}, 0x01},
	{0x7e, {0x71}, 0x01},
	{0x7c, {0x03}, 0x01},
	{0xff, {0x00}, 0x01},
	{0xfb, {0x01}, 0x01},
	{0x35, {0x01}, 0x01},
	/* Select CMD2 Page0 (Undocumented) */
	{0xff, {0x01}, 0x01},
	/* Reload CMD1: Don't reload default value to register */
	{0xfb, {0x01}, 0x01},
	{0x00, {0x01}, 0x01},
	{0x01, {0x55}, 0x01},
	{0x02, {0x40}, 0x01},
	{0x05, {0x40}, 0x01},
	{0x06, {0x4a}, 0x01},
	{0x07, {0x24}, 0x01},
	{0x08, {0x0c}, 0x01},

Annotation

Implementation Notes