drivers/gpu/drm/tiny/mi0283qt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tiny/mi0283qt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tiny/mi0283qt.c- Extension
.c- Size
- 10603 bytes
- Lines
- 391
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/property.hlinux/regulator/consumer.hlinux/spi/spi.hdrm/clients/drm_client_setup.hdrm/drm_atomic_helper.hdrm/drm_drv.hdrm/drm_fbdev_dma.hdrm/drm_gem_atomic_helper.hdrm/drm_gem_dma_helper.hdrm/drm_managed.hdrm/drm_mipi_dbi.hdrm/drm_modeset_helper.hdrm/drm_print.hvideo/mipi_display.h
Detected Declarations
struct mi0283qt_devicefunction mi0283qt_crtc_helper_atomic_enablefunction mi0283qt_probefunction mi0283qt_removefunction mi0283qt_shutdownfunction mi0283qt_pm_suspendfunction mi0283qt_pm_resume
Annotated Snippet
struct mi0283qt_device {
struct mipi_dbi_dev dbidev;
struct drm_plane plane;
struct drm_crtc crtc;
struct drm_encoder encoder;
struct drm_connector connector;
};
static struct mi0283qt_device *to_mi0283qt_device(struct drm_device *dev)
{
return container_of(drm_to_mipi_dbi_dev(dev), struct mi0283qt_device, dbidev);
}
static const u32 mi0283qt_plane_formats[] = {
DRM_MIPI_DBI_PLANE_FORMATS,
};
static const u64 mi0283qt_plane_format_modifiers[] = {
DRM_MIPI_DBI_PLANE_FORMAT_MODIFIERS,
};
static const struct drm_plane_helper_funcs mi0283qt_plane_helper_funcs = {
DRM_MIPI_DBI_PLANE_HELPER_FUNCS,
};
static const struct drm_plane_funcs mi0283qt_plane_funcs = {
DRM_MIPI_DBI_PLANE_FUNCS,
.destroy = drm_plane_cleanup,
};
static void mi0283qt_crtc_helper_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_commit *state)
{
struct drm_device *drm = crtc->dev;
struct mi0283qt_device *mi0283qt = to_mi0283qt_device(drm);
struct mipi_dbi_dev *dbidev = &mi0283qt->dbidev;
struct mipi_dbi *dbi = &dbidev->dbi;
u8 addr_mode;
int ret, idx;
if (!drm_dev_enter(drm, &idx))
return;
DRM_DEBUG_KMS("\n");
ret = mipi_dbi_poweron_conditional_reset(dbidev);
if (ret < 0)
goto out_exit;
if (ret == 1)
goto out_enable;
mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_OFF);
mipi_dbi_command(dbi, ILI9341_PWCTRLB, 0x00, 0x83, 0x30);
mipi_dbi_command(dbi, ILI9341_PWRSEQ, 0x64, 0x03, 0x12, 0x81);
mipi_dbi_command(dbi, ILI9341_DTCTRLA, 0x85, 0x01, 0x79);
mipi_dbi_command(dbi, ILI9341_PWCTRLA, 0x39, 0x2c, 0x00, 0x34, 0x02);
mipi_dbi_command(dbi, ILI9341_PUMPCTRL, 0x20);
mipi_dbi_command(dbi, ILI9341_DTCTRLB, 0x00, 0x00);
/* Power Control */
mipi_dbi_command(dbi, ILI9341_PWCTRL1, 0x26);
mipi_dbi_command(dbi, ILI9341_PWCTRL2, 0x11);
/* VCOM */
mipi_dbi_command(dbi, ILI9341_VMCTRL1, 0x35, 0x3e);
mipi_dbi_command(dbi, ILI9341_VMCTRL2, 0xbe);
/* Memory Access Control */
mipi_dbi_command(dbi, MIPI_DCS_SET_PIXEL_FORMAT, MIPI_DCS_PIXEL_FMT_16BIT);
/* Frame Rate */
mipi_dbi_command(dbi, ILI9341_FRMCTR1, 0x00, 0x1b);
/* Gamma */
mipi_dbi_command(dbi, ILI9341_EN3GAM, 0x08);
mipi_dbi_command(dbi, MIPI_DCS_SET_GAMMA_CURVE, 0x01);
mipi_dbi_command(dbi, ILI9341_PGAMCTRL,
0x1f, 0x1a, 0x18, 0x0a, 0x0f, 0x06, 0x45, 0x87,
0x32, 0x0a, 0x07, 0x02, 0x07, 0x05, 0x00);
mipi_dbi_command(dbi, ILI9341_NGAMCTRL,
0x00, 0x25, 0x27, 0x05, 0x10, 0x09, 0x3a, 0x78,
0x4d, 0x05, 0x18, 0x0d, 0x38, 0x3a, 0x1f);
/* DDRAM */
mipi_dbi_command(dbi, ILI9341_ETMOD, 0x07);
/* Display */
mipi_dbi_command(dbi, ILI9341_DISCTRL, 0x0a, 0x82, 0x27, 0x00);
mipi_dbi_command(dbi, MIPI_DCS_EXIT_SLEEP_MODE);
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/property.h`, `linux/regulator/consumer.h`, `linux/spi/spi.h`, `drm/clients/drm_client_setup.h`.
- Detected declarations: `struct mi0283qt_device`, `function mi0283qt_crtc_helper_atomic_enable`, `function mi0283qt_probe`, `function mi0283qt_remove`, `function mi0283qt_shutdown`, `function mi0283qt_pm_suspend`, `function mi0283qt_pm_resume`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.