Driver methods
Drivers methods consist of probe()
and remove()
functions. Prior to going further with these method descriptions, let us set up our fb_ops
structure:
static struct fb_ops myfb_ops = { .owner = THIS_MODULE, .fb_check_var = myfb_check_var, .fb_set_par = myfb_set_par, .fb_setcolreg = myfb_setcolreg, .fb_fillrect = cfb_fillrect, /* Those three hooks are */ .fb_copyarea = cfb_copyarea, /* non accelerated and */ .fb_imageblit = cfb_imageblit, /* are provided by kernel */ .fb_blank = myfb_blank, };
probe
: The driverprobe
function is in charge of initializing the hardware, creating thestruct fb_info
structure using theframebuffer_alloc()
function, and usingregister_framebuffer()
on it. The following sample assumes the device is memory mapped. Therefore, your non-memory map can exist, such as screen sitting on SPI buses. In this case, bus-specific routines should be used:
static int myfb_probe(struct platform_device *pdev) { struct...