30 #include <linux/module.h>
31 #include <linux/kernel.h>
32 #include <linux/errno.h>
33 #include <linux/string.h>
41 #include <linux/list.h>
64 .xres_virtual =
DPY_W,
65 .yres_virtual =
DPY_H,
75 par->
board->set_data(par, data);
81 par->
board->wait_for_ack(par, 0);
87 par->
board->wait_for_ack(par, 1);
90 static void apollo_send_command(
struct hecubafb_par *par,
unsigned char data)
96 apollo_send_data(par, data);
102 static void hecubafb_dpy_update(
struct hecubafb_par *par)
105 unsigned char *
buf = (
unsigned char __force *)par->
info->screen_base;
110 apollo_send_data(par, *(buf++));
118 static void hecubafb_dpy_deferred_io(
struct fb_info *
info,
121 hecubafb_dpy_update(info->
par);
124 static void hecubafb_fillrect(
struct fb_info *
info,
131 hecubafb_dpy_update(par);
134 static void hecubafb_copyarea(
struct fb_info *
info,
141 hecubafb_dpy_update(par);
144 static void hecubafb_imageblit(
struct fb_info *
info,
151 hecubafb_dpy_update(par);
159 size_t count, loff_t *ppos)
162 unsigned long p = *ppos;
170 total_size = info->
fix.smem_len;
175 if (count > total_size) {
180 if (count + p > total_size) {
184 count = total_size -
p;
195 hecubafb_dpy_update(par);
197 return (err) ? err :
count;
200 static struct fb_ops hecubafb_ops = {
203 .fb_write = hecubafb_write,
204 .fb_fillrect = hecubafb_fillrect,
205 .fb_copyarea = hecubafb_copyarea,
206 .fb_imageblit = hecubafb_imageblit,
209 static struct fb_deferred_io hecubafb_defio = {
211 .deferred_io = hecubafb_dpy_deferred_io,
220 unsigned char *videomemory;
224 board = dev->
dev.platform_data;
229 if (!try_module_get(board->
owner))
234 videomemory =
vzalloc(videomemorysize);
236 goto err_videomem_alloc;
243 info->
fbops = &hecubafb_ops;
245 info->
var = hecubafb_var;
246 info->
fix = hecubafb_fix;
247 info->
fix.smem_len = videomemorysize;
256 info->fbdefio = &hecubafb_defio;
262 platform_set_drvdata(dev, info);
265 "fb%d: Hecuba frame buffer device, using %dK of video memory\n",
266 info->
node, videomemorysize >> 10);
269 retval = par->
board->init(par);
279 module_put(board->
owner);
285 struct fb_info *info = platform_get_drvdata(dev);
292 if (par->
board->remove)
293 par->
board->remove(par);
294 module_put(par->
board->owner);
301 .probe = hecubafb_probe,
309 static int __init hecubafb_init(
void)
314 static void __exit hecubafb_exit(
void)