drivers/gpu/drm/panel/panel-lincolntech-lcd197.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-lincolntech-lcd197.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-lincolntech-lcd197.c- Extension
.c- Size
- 8419 bytes
- Lines
- 262
- 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/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_device.hdrm/drm_probe_helper.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct lincoln_lcd197_panelfunction lincoln_lcd197_panel_preparefunction lincoln_lcd197_panel_unpreparefunction lincoln_lcd197_panel_enablefunction lincoln_lcd197_panel_disablefunction lincoln_lcd197_panel_get_modesfunction lincoln_lcd197_panel_probefunction lincoln_lcd197_panel_remove
Annotated Snippet
struct lincoln_lcd197_panel {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator *supply;
struct gpio_desc *enable_gpio;
struct gpio_desc *reset_gpio;
};
static inline
struct lincoln_lcd197_panel *to_lincoln_lcd197_panel(struct drm_panel *panel)
{
return container_of(panel, struct lincoln_lcd197_panel, panel);
}
static int lincoln_lcd197_panel_prepare(struct drm_panel *panel)
{
struct lincoln_lcd197_panel *lcd = to_lincoln_lcd197_panel(panel);
struct mipi_dsi_multi_context ctx = { .dsi = lcd->dsi };
int err;
gpiod_set_value_cansleep(lcd->enable_gpio, 0);
err = regulator_enable(lcd->supply);
if (err < 0)
return err;
gpiod_set_value_cansleep(lcd->enable_gpio, 1);
usleep_range(1000, 2000);
gpiod_set_value_cansleep(lcd->reset_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(lcd->reset_gpio, 0);
msleep(50);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xff, 0x83, 0x99);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x55);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x02, 0x04, 0x70, 0x90, 0x01,
0x32, 0x33, 0x11, 0x11, 0x4d, 0x57, 0x56, 0x73,
0x02, 0x02);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x00, 0x80, 0x80, 0xae, 0x0a,
0x0e, 0x75, 0x11, 0x00, 0x00, 0x00);
mipi_dsi_dcs_write_seq_multi(&ctx, 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);
mipi_dsi_dcs_write_seq_multi(&ctx, 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);
mipi_dsi_dcs_write_seq_multi(&ctx, 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);
mipi_dsi_dcs_write_seq_multi(&ctx, 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);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x01);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x0a, 0xbe, 0xfa, 0xa0, 0x0a,
0xbe, 0xfa, 0xa0);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x0f, 0xff, 0xff, 0xe0, 0x0f,
0xff, 0xff, 0xe0);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x02);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x0f, 0xff, 0xff, 0xe0, 0x0f,
0xff, 0xff, 0xe0);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x01, 0x11, 0x1c, 0x17, 0x39,
0x43, 0x54, 0x51, 0x5a, 0x64, 0x6c, 0x74, 0x7a,
0x83, 0x8d, 0x92, 0x99, 0xa4, 0xa9, 0xb4, 0xaa,
0xba, 0xbe, 0x63, 0x5e, 0x69, 0x73, 0x01, 0x11,
0x1c, 0x17, 0x39, 0x43, 0x54, 0x51, 0x5a, 0x64,
0x6c, 0x74, 0x7a, 0x83, 0x8d, 0x92, 0x99, 0xa4,
0xa7, 0xb2, 0xa9, 0xba, 0xbe, 0x63, 0x5e, 0x69,
0x73);
mipi_dsi_usleep_range(&ctx, 200, 300);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x92, 0x92);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x00);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x40, 0x41, 0x50, 0x49);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xff, 0xf9);
mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x25, 0x5a);
mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x02);
mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
mipi_dsi_msleep(&ctx, 120);
if (ctx.accum_err) {
gpiod_set_value_cansleep(lcd->enable_gpio, 0);
gpiod_set_value_cansleep(lcd->reset_gpio, 1);
Annotation
- Immediate include surface: `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_device.h`, `drm/drm_probe_helper.h`, `drm/drm_mipi_dsi.h`.
- Detected declarations: `struct lincoln_lcd197_panel`, `function lincoln_lcd197_panel_prepare`, `function lincoln_lcd197_panel_unprepare`, `function lincoln_lcd197_panel_enable`, `function lincoln_lcd197_panel_disable`, `function lincoln_lcd197_panel_get_modes`, `function lincoln_lcd197_panel_probe`, `function lincoln_lcd197_panel_remove`.
- 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.