drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c- Extension
.c- Size
- 8570 bytes
- Lines
- 326
- 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/media-bus-format.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct mantixfunction mantix_init_sequencefunction mantix_enablefunction mantix_disablefunction mantix_unpreparefunction mantix_preparefunction mantix_get_modesfunction mantix_probefunction mantix_remove
Annotated Snippet
struct mantix {
struct device *dev;
struct drm_panel panel;
struct gpio_desc *reset_gpio;
struct gpio_desc *tp_rstn_gpio;
struct regulator *avdd;
struct regulator *avee;
struct regulator *vddi;
const struct drm_display_mode *default_mode;
};
static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
{
return container_of(panel, struct mantix, panel);
}
static void mantix_init_sequence(struct mipi_dsi_multi_context *dsi_ctx)
{
/*
* Init sequence was supplied by the panel vendor.
*/
mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a);
mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_INT_CANCEL, 0x03);
mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x03);
mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xa9, 0x00); /* VCOM */
mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xa5);
mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2f);
}
static int mantix_enable(struct drm_panel *panel)
{
struct mantix *ctx = panel_to_mantix(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
mantix_init_sequence(&dsi_ctx);
if (!dsi_ctx.accum_err)
dev_dbg(ctx->dev, "Panel init sequence done\n");
/* remainder to 120ms (7.3.1 Note 4) */
mipi_dsi_msleep(&dsi_ctx, 70);
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 120);
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
mipi_dsi_usleep_range(&dsi_ctx, 10000, 12000);
return dsi_ctx.accum_err;
}
static int mantix_disable(struct drm_panel *panel)
{
struct mantix *ctx = panel_to_mantix(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
/* T10 */
mipi_dsi_msleep(&dsi_ctx, 150);
return dsi_ctx.accum_err;
}
static int mantix_unprepare(struct drm_panel *panel)
{
struct mantix *ctx = panel_to_mantix(panel);
regulator_disable(ctx->avee);
regulator_disable(ctx->avdd);
/* T11 */
usleep_range(5000, 6000);
regulator_disable(ctx->vddi);
gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
/* T14 */
msleep(50);
return 0;
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/media-bus-format.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`.
- Detected declarations: `struct mantix`, `function mantix_init_sequence`, `function mantix_enable`, `function mantix_disable`, `function mantix_unprepare`, `function mantix_prepare`, `function mantix_get_modes`, `function mantix_probe`, `function mantix_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.