drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c- Extension
.c- Size
- 9393 bytes
- Lines
- 324
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/device.hlinux/media-bus-format.hlinux/module.hlinux/spi/spi.hdrm/drm_mipi_dbi.hdrm/drm_panel.hdrm/drm_print.hvideo/mipi_display.hpanel-ilitek-ili9806e-core.h
Detected Declarations
struct ili9806e_spi_panelstruct ili9806e_spi_panel_descfunction ili9806e_spi_offfunction ili9806e_spi_unpreparefunction ili9806e_spi_preparefunction ili9806e_spi_get_modesfunction ili9806e_spi_probefunction ili9806e_spi_removefunction rk050hr345_ct106a_init
Annotated Snippet
struct ili9806e_spi_panel {
struct spi_device *spi;
struct mipi_dbi dbi;
const struct ili9806e_spi_panel_desc *desc;
};
struct ili9806e_spi_panel_desc {
const struct drm_display_mode *display_mode;
u32 bus_format;
u32 bus_flags;
void (*init_sequence)(struct ili9806e_spi_panel *ctx);
};
static int ili9806e_spi_off(struct ili9806e_spi_panel *ctx)
{
struct mipi_dbi *dbi = &ctx->dbi;
mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_OFF, 0x00);
mipi_dbi_command(dbi, MIPI_DCS_ENTER_SLEEP_MODE, 0x00);
return 0;
}
static int ili9806e_spi_unprepare(struct drm_panel *panel)
{
struct ili9806e_spi_panel *ctx = ili9806e_get_transport(panel);
struct device *dev = &ctx->spi->dev;
int ret;
ili9806e_spi_off(ctx);
ret = ili9806e_power_off(dev);
if (ret)
dev_err(dev, "power off failed: %d\n", ret);
return 0;
}
static int ili9806e_spi_prepare(struct drm_panel *panel)
{
struct ili9806e_spi_panel *ctx = ili9806e_get_transport(panel);
struct device *dev = &ctx->spi->dev;
int ret;
ret = ili9806e_power_on(dev);
if (ret)
return ret;
if (ctx->desc->init_sequence)
ctx->desc->init_sequence(ctx);
return 0;
}
static int ili9806e_spi_get_modes(struct drm_panel *panel,
struct drm_connector *connector)
{
struct ili9806e_spi_panel *ctx = ili9806e_get_transport(panel);
const struct ili9806e_spi_panel_desc *desc = ctx->desc;
struct drm_display_mode *mode;
mode = drm_mode_duplicate(connector->dev, desc->display_mode);
if (!mode)
return -ENOMEM;
drm_mode_set_name(mode);
connector->display_info.width_mm = mode->width_mm;
connector->display_info.height_mm = mode->height_mm;
connector->display_info.bus_flags = desc->bus_flags;
drm_display_info_set_bus_formats(&connector->display_info,
&desc->bus_format, 1);
drm_mode_probed_add(connector, mode);
return 1;
}
static const struct drm_panel_funcs ili9806e_spi_funcs = {
.unprepare = ili9806e_spi_unprepare,
.prepare = ili9806e_spi_prepare,
.get_modes = ili9806e_spi_get_modes,
};
static int ili9806e_spi_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
struct ili9806e_spi_panel *ctx;
int err;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/media-bus-format.h`, `linux/module.h`, `linux/spi/spi.h`, `drm/drm_mipi_dbi.h`, `drm/drm_panel.h`, `drm/drm_print.h`.
- Detected declarations: `struct ili9806e_spi_panel`, `struct ili9806e_spi_panel_desc`, `function ili9806e_spi_off`, `function ili9806e_spi_unprepare`, `function ili9806e_spi_prepare`, `function ili9806e_spi_get_modes`, `function ili9806e_spi_probe`, `function ili9806e_spi_remove`, `function rk050hr345_ct106a_init`.
- 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.