drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c- Extension
.c- Size
- 8636 bytes
- Lines
- 351
- 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/backlight.hlinux/delay.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct stk_panelfunction stk_panel_initfunction stk_panel_onfunction stk_panel_offfunction stk_panel_unpreparefunction stk_panel_preparefunction stk_panel_get_modesfunction dsi_dcs_bl_get_brightnessfunction dsi_dcs_bl_update_statusfunction drm_panel_create_dsi_backlightfunction stk_panel_addfunction stk_panel_probefunction stk_panel_remove
Annotated Snippet
struct stk_panel {
const struct drm_display_mode *mode;
struct backlight_device *backlight;
struct drm_panel base;
struct gpio_desc *enable_gpio; /* Power IC supply enable */
struct gpio_desc *reset_gpio; /* External reset */
struct mipi_dsi_device *dsi;
struct regulator_bulk_data supplies[2];
};
static inline struct stk_panel *to_stk_panel(struct drm_panel *panel)
{
return container_of(panel, struct stk_panel, base);
}
static int stk_panel_init(struct stk_panel *stk)
{
struct mipi_dsi_device *dsi = stk->dsi;
struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 5);
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 120);
mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_MCAP, 0x04);
/* Interface setting, video mode */
mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_IS, 0x14, 0x08, 0x00, 0x22, 0x00);
mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_IIS, 0x0c, 0x00);
mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_CTRL, 0x3a, 0xd3);
mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0x77);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
MIPI_DCS_WRITE_MEMORY_START);
mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx, 0x77);
mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, stk->mode->hdisplay - 1);
mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, stk->mode->vdisplay - 1);
return dsi_ctx.accum_err;
}
static int stk_panel_on(struct stk_panel *stk)
{
struct mipi_dsi_device *dsi = stk->dsi;
struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 20);
return dsi_ctx.accum_err;
}
static void stk_panel_off(struct stk_panel *stk)
{
struct mipi_dsi_device *dsi = stk->dsi;
struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 100);
}
static int stk_panel_unprepare(struct drm_panel *panel)
{
struct stk_panel *stk = to_stk_panel(panel);
stk_panel_off(stk);
regulator_bulk_disable(ARRAY_SIZE(stk->supplies), stk->supplies);
gpiod_set_value(stk->reset_gpio, 0);
gpiod_set_value(stk->enable_gpio, 1);
return 0;
}
static int stk_panel_prepare(struct drm_panel *panel)
{
struct stk_panel *stk = to_stk_panel(panel);
int ret;
gpiod_set_value(stk->reset_gpio, 0);
gpiod_set_value(stk->enable_gpio, 0);
ret = regulator_enable(stk->supplies[IOVCC].consumer);
if (ret < 0)
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_mipi_dsi.h`.
- Detected declarations: `struct stk_panel`, `function stk_panel_init`, `function stk_panel_on`, `function stk_panel_off`, `function stk_panel_unprepare`, `function stk_panel_prepare`, `function stk_panel_get_modes`, `function dsi_dcs_bl_get_brightness`, `function dsi_dcs_bl_update_status`, `function drm_panel_create_dsi_backlight`.
- 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.