drivers/gpu/drm/panel/panel-samsung-sofef00.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-samsung-sofef00.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-samsung-sofef00.c- Extension
.c- Size
- 7686 bytes
- Lines
- 294
- 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.hlinux/backlight.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct sofef00_panelfunction sofef00_panel_resetfunction sofef00_panel_onfunction sofef00_enablefunction sofef00_panel_offfunction sofef00_panel_preparefunction sofef00_disablefunction sofef00_panel_unpreparefunction sofef00_panel_get_modesfunction sofef00_panel_bl_update_statusfunction sofef00_create_backlightfunction sofef00_panel_probefunction sofef00_panel_remove
Annotated Snippet
struct sofef00_panel {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator_bulk_data *supplies;
struct gpio_desc *reset_gpio;
};
static const struct regulator_bulk_data sofef00_supplies[] = {
{ .supply = "vddio" },
{ .supply = "vci" },
{ .supply = "poc" },
};
static inline
struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
{
return container_of(panel, struct sofef00_panel, panel);
}
#define sofef00_test_key_on_lvl2(ctx) \
mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
#define sofef00_test_key_off_lvl2(ctx) \
mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
static void sofef00_panel_reset(struct sofef00_panel *ctx)
{
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(2000, 3000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(12000, 13000);
}
static int sofef00_panel_on(struct sofef00_panel *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_usleep_range(&dsi_ctx, 10000, 11000);
sofef00_test_key_on_lvl2(&dsi_ctx);
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
sofef00_test_key_off_lvl2(&dsi_ctx);
sofef00_test_key_on_lvl2(&dsi_ctx);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x07);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb6, 0x12);
sofef00_test_key_off_lvl2(&dsi_ctx);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
return dsi_ctx.accum_err;
}
static int sofef00_enable(struct drm_panel *panel)
{
struct sofef00_panel *ctx = to_sofef00_panel(panel);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
return dsi_ctx.accum_err;
}
static int sofef00_panel_off(struct sofef00_panel *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 40);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 160);
return dsi_ctx.accum_err;
}
static int sofef00_panel_prepare(struct drm_panel *panel)
{
struct sofef00_panel *ctx = to_sofef00_panel(panel);
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(sofef00_supplies), ctx->supplies);
if (ret < 0)
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `linux/backlight.h`, `video/mipi_display.h`, `drm/drm_mipi_dsi.h`.
- Detected declarations: `struct sofef00_panel`, `function sofef00_panel_reset`, `function sofef00_panel_on`, `function sofef00_enable`, `function sofef00_panel_off`, `function sofef00_panel_prepare`, `function sofef00_disable`, `function sofef00_panel_unprepare`, `function sofef00_panel_get_modes`, `function sofef00_panel_bl_update_status`.
- 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.