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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct khadas_ts050_panelstruct khadas_ts050_panel_cmdstruct khadas_ts050_panel_datafunction khadas_ts050_panel_preparefunction mipi_dsi_dcs_writefunction khadas_ts050_panel_unpreparefunction khadas_ts050_panel_disablefunction khadas_ts050_panel_get_modesfunction khadas_ts050_panel_addfunction khadas_ts050_panel_probefunction khadas_ts050_panel_remove
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
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_crtc.h`, `drm/drm_device.h`.
- Detected declarations: `struct khadas_ts050_panel`, `struct khadas_ts050_panel_cmd`, `struct khadas_ts050_panel_data`, `function khadas_ts050_panel_prepare`, `function mipi_dsi_dcs_write`, `function khadas_ts050_panel_unprepare`, `function khadas_ts050_panel_disable`, `function khadas_ts050_panel_get_modes`, `function khadas_ts050_panel_add`, `function khadas_ts050_panel_probe`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.