drivers/gpu/drm/panel/panel-lxd-m9189a.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-lxd-m9189a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-lxd-m9189a.c- Extension
.c- Size
- 6354 bytes
- Lines
- 245
- 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/types.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct m9189_panelfunction m9189_resetfunction m9189_onfunction m9189_disablefunction m9189_preparefunction m9189_unpreparefunction m9189_get_modesfunction lxd_m9189_probefunction lxd_m9189_remove
Annotated Snippet
struct m9189_panel {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator *supply;
struct gpio_desc *reset_gpio;
struct gpio_desc *standby_gpio;
};
static inline struct m9189_panel *to_m9189_panel(struct drm_panel *panel)
{
return container_of(panel, struct m9189_panel, panel);
}
static void m9189_reset(struct m9189_panel *m9189)
{
gpiod_set_value_cansleep(m9189->reset_gpio, 0);
msleep(20);
gpiod_set_value_cansleep(m9189->reset_gpio, 1);
msleep(30);
gpiod_set_value_cansleep(m9189->reset_gpio, 0);
msleep(55);
}
static int m9189_on(struct m9189_panel *m9189)
{
struct mipi_dsi_multi_context ctx = { .dsi = m9189->dsi };
ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
/* Gamma 2.2 */
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA1, 0x48);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA2, 0xB8);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA3, 0x88);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA4, 0x88);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA5, 0x58);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA6, 0xD2);
mipi_dsi_dcs_write_seq_multi(&ctx, EK79007AD3_GAMMA7, 0x88);
mipi_dsi_msleep(&ctx, 50);
/* 4 Lanes */
mipi_dsi_generic_write_multi(&ctx, (u8[]){ EK79007AD3_PANEL_CTRL3, 0x70 }, 2);
mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
mipi_dsi_msleep(&ctx, 120);
mipi_dsi_dcs_set_display_on_multi(&ctx);
mipi_dsi_msleep(&ctx, 120);
return ctx.accum_err;
}
static int m9189_disable(struct drm_panel *panel)
{
struct m9189_panel *m9189 = to_m9189_panel(panel);
struct mipi_dsi_multi_context ctx = { .dsi = m9189->dsi };
ctx.dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
mipi_dsi_msleep(&ctx, 120);
gpiod_set_value_cansleep(m9189->standby_gpio, 1);
return ctx.accum_err;
}
static int m9189_prepare(struct drm_panel *panel)
{
struct m9189_panel *m9189 = to_m9189_panel(panel);
struct device *dev = &m9189->dsi->dev;
int ret;
ret = regulator_enable(m9189->supply);
if (ret < 0) {
dev_err(dev, "Failed to enable regulators: %d\n", ret);
return ret;
}
gpiod_set_value_cansleep(m9189->standby_gpio, 0);
msleep(20);
m9189_reset(m9189);
ret = m9189_on(m9189);
if (ret < 0) {
dev_err(dev, "Failed to initialize panel: %d\n", ret);
gpiod_set_value_cansleep(m9189->reset_gpio, 1);
regulator_disable(m9189->supply);
return ret;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `linux/types.h`, `drm/drm_mipi_dsi.h`, `drm/drm_modes.h`.
- Detected declarations: `struct m9189_panel`, `function m9189_reset`, `function m9189_on`, `function m9189_disable`, `function m9189_prepare`, `function m9189_unprepare`, `function m9189_get_modes`, `function lxd_m9189_probe`, `function lxd_m9189_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.