drivers/video/fbdev/ep93xx-fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/ep93xx-fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/ep93xx-fb.c- Extension
.c- Size
- 16836 bytes
- Lines
- 607
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/module.hlinux/dma-mapping.hlinux/slab.hlinux/clk.hlinux/fb.hlinux/io.hlinux/platform_data/video-ep93xx.h
Detected Declarations
struct ep93xx_fbifunction ep93xxfb_readlfunction ep93xxfb_writelfunction ep93xxfb_out_lockedfunction ep93xxfb_set_video_attribsfunction ep93xxfb_set_pixelmodefunction ep93xxfb_set_timingfunction ep93xxfb_set_parfunction ep93xxfb_check_varfunction ep93xxfb_mmapfunction ep93xxfb_blankfunction ep93xxfb_convert_colorfunction ep93xxfb_setcolregfunction ep93xxfb_alloc_videomemfunction hardwarefunction ep93xxfb_dealloc_videomemfunction ep93xxfb_probefunction ep93xxfb_remove
Annotated Snippet
struct ep93xx_fbi {
struct ep93xxfb_mach_info *mach_info;
struct clk *clk;
struct resource *res;
void __iomem *mmio_base;
unsigned int pseudo_palette[256];
};
static int check_screenpage_bug = 1;
module_param(check_screenpage_bug, int, 0644);
MODULE_PARM_DESC(check_screenpage_bug,
"Check for bit 27 screen page bug. Default = 1");
static inline unsigned int ep93xxfb_readl(struct ep93xx_fbi *fbi,
unsigned int off)
{
return __raw_readl(fbi->mmio_base + off);
}
static inline void ep93xxfb_writel(struct ep93xx_fbi *fbi,
unsigned int val, unsigned int off)
{
__raw_writel(val, fbi->mmio_base + off);
}
/*
* Write to one of the locked raster registers.
*/
static inline void ep93xxfb_out_locked(struct ep93xx_fbi *fbi,
unsigned int val, unsigned int reg)
{
/*
* We don't need a lock or delay here since the raster register
* block will remain unlocked until the next access.
*/
ep93xxfb_writel(fbi, 0xaa, EP93XXFB_SWLOCK);
ep93xxfb_writel(fbi, val, reg);
}
static void ep93xxfb_set_video_attribs(struct fb_info *info)
{
struct ep93xx_fbi *fbi = info->par;
unsigned int attribs;
attribs = EP93XXFB_ENABLE;
attribs |= fbi->mach_info->flags;
ep93xxfb_out_locked(fbi, attribs, EP93XXFB_ATTRIBS);
}
static int ep93xxfb_set_pixelmode(struct fb_info *info)
{
struct ep93xx_fbi *fbi = info->par;
unsigned int val;
info->var.transp.offset = 0;
info->var.transp.length = 0;
switch (info->var.bits_per_pixel) {
case 8:
val = EP93XXFB_PIXELMODE_8BPP | EP93XXFB_PIXELMODE_COLOR_LUT |
EP93XXFB_PIXELMODE_SHIFT_1P_18B;
info->var.red.offset = 0;
info->var.red.length = 8;
info->var.green.offset = 0;
info->var.green.length = 8;
info->var.blue.offset = 0;
info->var.blue.length = 8;
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
break;
case 16:
val = EP93XXFB_PIXELMODE_16BPP | EP93XXFB_PIXELMODE_COLOR_555 |
EP93XXFB_PIXELMODE_SHIFT_1P_18B;
info->var.red.offset = 11;
info->var.red.length = 5;
info->var.green.offset = 5;
info->var.green.length = 6;
info->var.blue.offset = 0;
info->var.blue.length = 5;
info->fix.visual = FB_VISUAL_TRUECOLOR;
break;
case 24:
val = EP93XXFB_PIXELMODE_24BPP | EP93XXFB_PIXELMODE_COLOR_888 |
EP93XXFB_PIXELMODE_SHIFT_1P_24B;
info->var.red.offset = 16;
info->var.red.length = 8;
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/module.h`, `linux/dma-mapping.h`, `linux/slab.h`, `linux/clk.h`, `linux/fb.h`, `linux/io.h`, `linux/platform_data/video-ep93xx.h`.
- Detected declarations: `struct ep93xx_fbi`, `function ep93xxfb_readl`, `function ep93xxfb_writel`, `function ep93xxfb_out_locked`, `function ep93xxfb_set_video_attribs`, `function ep93xxfb_set_pixelmode`, `function ep93xxfb_set_timing`, `function ep93xxfb_set_par`, `function ep93xxfb_check_var`, `function ep93xxfb_mmap`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.