drivers/video/fbdev/hecubafb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/hecubafb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/hecubafb.c- Extension
.c- Size
- 6265 bytes
- Lines
- 252
- 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.
- 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/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/vmalloc.hlinux/delay.hlinux/interrupt.hlinux/fb.hlinux/init.hlinux/platform_device.hlinux/list.hlinux/uaccess.hvideo/hecubafb.h
Detected Declarations
function apollo_send_datafunction apollo_send_commandfunction hecubafb_dpy_updatefunction hecubafb_dpy_deferred_iofunction hecubafb_defio_damage_rangefunction hecubafb_defio_damage_areafunction hecubafb_probefunction hecubafb_remove
Annotated Snippet
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <video/hecubafb.h>
/* Display specific information */
#define DPY_W 600
#define DPY_H 800
static const struct fb_fix_screeninfo hecubafb_fix = {
.id = "hecubafb",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_MONO01,
.xpanstep = 0,
.ypanstep = 0,
.ywrapstep = 0,
.line_length = DPY_W,
.accel = FB_ACCEL_NONE,
};
static const struct fb_var_screeninfo hecubafb_var = {
.xres = DPY_W,
.yres = DPY_H,
.xres_virtual = DPY_W,
.yres_virtual = DPY_H,
.bits_per_pixel = 1,
.nonstd = 1,
};
/* main hecubafb functions */
static void apollo_send_data(struct hecubafb_par *par, unsigned char data)
{
/* set data */
par->board->set_data(par, data);
/* set DS low */
par->board->set_ctl(par, HCB_DS_BIT, 0);
/* wait for ack */
par->board->wait_for_ack(par, 0);
/* set DS hi */
par->board->set_ctl(par, HCB_DS_BIT, 1);
/* wait for ack to clear */
par->board->wait_for_ack(par, 1);
}
static void apollo_send_command(struct hecubafb_par *par, unsigned char data)
{
/* command so set CD to high */
par->board->set_ctl(par, HCB_CD_BIT, 1);
/* actually strobe with command */
apollo_send_data(par, data);
/* clear CD back to low */
par->board->set_ctl(par, HCB_CD_BIT, 0);
}
static void hecubafb_dpy_update(struct hecubafb_par *par)
{
int i;
unsigned char *buf = par->info->screen_buffer;
apollo_send_command(par, APOLLO_START_NEW_IMG);
for (i=0; i < (DPY_W*DPY_H/8); i++) {
apollo_send_data(par, *(buf++));
}
apollo_send_command(par, APOLLO_STOP_IMG_DATA);
apollo_send_command(par, APOLLO_DISPLAY_IMG);
}
/* this is called back from the deferred io workqueue */
static void hecubafb_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/vmalloc.h`, `linux/delay.h`, `linux/interrupt.h`.
- Detected declarations: `function apollo_send_data`, `function apollo_send_command`, `function hecubafb_dpy_update`, `function hecubafb_dpy_deferred_io`, `function hecubafb_defio_damage_range`, `function hecubafb_defio_damage_area`, `function hecubafb_probe`, `function hecubafb_remove`.
- Atlas domain: Driver Families / drivers/video.
- 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.