drivers/staging/fbtft/fb_ili9481.c
Source file repositories/reference/linux-study-clean/drivers/staging/fbtft/fb_ili9481.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/fbtft/fb_ili9481.c- Extension
.c- Size
- 2015 bytes
- Lines
- 92
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/module.hlinux/kernel.hlinux/init.hlinux/delay.hvideo/mipi_display.hfbtft.h
Detected Declarations
function set_var
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/*
* FB driver for the ILI9481 LCD Controller
*
* Copyright (c) 2014 Petr Olivka
* Copyright (c) 2013 Noralf Tronnes
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <video/mipi_display.h>
#include "fbtft.h"
#define DRVNAME "fb_ili9481"
#define WIDTH 320
#define HEIGHT 480
static const s16 default_init_sequence[] = {
/* SLP_OUT - Sleep out */
-1, MIPI_DCS_EXIT_SLEEP_MODE,
-2, 50,
/* Power setting */
-1, 0xD0, 0x07, 0x42, 0x18,
/* VCOM */
-1, 0xD1, 0x00, 0x07, 0x10,
/* Power setting for norm. mode */
-1, 0xD2, 0x01, 0x02,
/* Panel driving setting */
-1, 0xC0, 0x10, 0x3B, 0x00, 0x02, 0x11,
/* Frame rate & inv. */
-1, 0xC5, 0x03,
/* Pixel format */
-1, MIPI_DCS_SET_PIXEL_FORMAT, 0x55,
/* Gamma */
-1, 0xC8, 0x00, 0x32, 0x36, 0x45, 0x06, 0x16,
0x37, 0x75, 0x77, 0x54, 0x0C, 0x00,
/* DISP_ON */
-1, MIPI_DCS_SET_DISPLAY_ON,
-3
};
#define HFLIP 0x01
#define VFLIP 0x02
#define ROW_X_COL 0x20
static int set_var(struct fbtft_par *par)
{
switch (par->info->var.rotate) {
case 270:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
ROW_X_COL | HFLIP | VFLIP | (par->bgr << 3));
break;
case 180:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
VFLIP | (par->bgr << 3));
break;
case 90:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
ROW_X_COL | (par->bgr << 3));
break;
default:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
HFLIP | (par->bgr << 3));
break;
}
return 0;
}
static struct fbtft_display display = {
.regwidth = 8,
.width = WIDTH,
.height = HEIGHT,
.init_sequence = default_init_sequence,
.fbtftops = {
.set_var = set_var,
},
};
FBTFT_REGISTER_DRIVER(DRVNAME, "ilitek,ili9481", &display);
MODULE_ALIAS("spi:" DRVNAME);
MODULE_ALIAS("platform:" DRVNAME);
MODULE_ALIAS("spi:ili9481");
MODULE_ALIAS("platform:ili9481");
MODULE_DESCRIPTION("FB driver for the ILI9481 LCD Controller");
MODULE_AUTHOR("Petr Olivka");
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `video/mipi_display.h`, `fbtft.h`.
- Detected declarations: `function set_var`.
- Atlas domain: Driver Families / drivers/staging.
- 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.