drivers/gpu/drm/panel/panel-raydium-rm69380.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-raydium-rm69380.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-raydium-rm69380.c- Extension
.c- Size
- 8201 bytes
- Lines
- 310
- 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/of_device.hlinux/of_graph.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct rm69380_panelfunction rm69380_resetfunction rm69380_onfunction rm69380_offfunction rm69380_preparefunction rm69380_unpreparefunction rm69380_get_modesfunction rm69380_bl_update_statusfunction rm69380_bl_get_brightnessfunction rm69380_create_backlightfunction rm69380_probefunction rm69380_remove
Annotated Snippet
struct rm69380_panel {
struct drm_panel panel;
struct mipi_dsi_device *dsi[2];
struct regulator_bulk_data supplies[2];
struct gpio_desc *reset_gpio;
};
static inline
struct rm69380_panel *to_rm69380_panel(struct drm_panel *panel)
{
return container_of(panel, struct rm69380_panel, panel);
}
static void rm69380_reset(struct rm69380_panel *ctx)
{
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(15000, 16000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(10000, 11000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
msleep(30);
}
static int rm69380_on(struct rm69380_panel *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi[0];
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
if (ctx->dsi[1])
ctx->dsi[1]->mode_flags |= MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfe, 0xd4);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x00, 0x80);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfe, 0xd0);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x48, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfe, 0x26);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x75, 0x3f);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x1d, 0x1a);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfe, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x28);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc2, 0x08);
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 20);
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 36);
return dsi_ctx.accum_err;
}
static void rm69380_off(struct rm69380_panel *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi[0];
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
if (ctx->dsi[1])
ctx->dsi[1]->mode_flags &= ~MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 35);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 20);
}
static int rm69380_prepare(struct drm_panel *panel)
{
struct rm69380_panel *ctx = to_rm69380_panel(panel);
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
if (ret < 0)
return ret;
rm69380_reset(ctx);
ret = rm69380_on(ctx);
if (ret < 0) {
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
}
return ret;
}
static int rm69380_unprepare(struct drm_panel *panel)
{
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/of_device.h`, `linux/of_graph.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct rm69380_panel`, `function rm69380_reset`, `function rm69380_on`, `function rm69380_off`, `function rm69380_prepare`, `function rm69380_unprepare`, `function rm69380_get_modes`, `function rm69380_bl_update_status`, `function rm69380_bl_get_brightness`, `function rm69380_create_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.