Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: platforming hecubafb and n411

This patch splits hecubafb into the platform independent hecubafb and the
platform dependent n411.

Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jaya Kumar and committed by
Linus Torvalds
0e27aa3d 2422fbba

+314 -206
+10 -7
drivers/video/Kconfig
··· 178 178 depends on FB 179 179 depends on FB_DEFERRED_IO 180 180 181 + config FB_HECUBA 182 + tristate 183 + depends on FB 184 + depends on FB_DEFERRED_IO 185 + 181 186 config FB_SVGALIB 182 187 tristate 183 188 depends on FB ··· 708 703 help 709 704 This is the frame buffer device driver for the Intel-based Macintosh 710 705 711 - config FB_HECUBA 712 - tristate "Hecuba board support" 706 + config FB_N411 707 + tristate "N411 Apollo/Hecuba devkit support" 713 708 depends on FB && X86 && MMU 714 709 select FB_SYS_FILLRECT 715 710 select FB_SYS_COPYAREA 716 711 select FB_SYS_IMAGEBLIT 717 712 select FB_SYS_FOPS 718 713 select FB_DEFERRED_IO 714 + select FB_HECUBA 719 715 help 720 - This enables support for the Hecuba board. This driver was tested 721 - with an E-Ink 800x600 display and x86 SBCs through a 16 bit GPIO 722 - interface (8 bit data, 4 bit control). If you anticipate using 723 - this driver, say Y or M; otherwise say N. You must specify the 724 - GPIO IO address to be used for setting control and data. 716 + This enables support for the Apollo display controller in its 717 + Hecuba form using the n411 devkit. 725 718 726 719 config FB_HGA 727 720 tristate "Hercules mono graphics support"
+51 -199
drivers/video/hecubafb.c
··· 1 1 /* 2 - * linux/drivers/video/hecubafb.c -- FB driver for Hecuba controller 2 + * linux/drivers/video/hecubafb.c -- FB driver for Hecuba/Apollo controller 3 3 * 4 4 * Copyright (C) 2006, Jaya Kumar 5 5 * This work was sponsored by CIS(M) Sdn Bhd ··· 17 17 * values. There are other commands that the display is capable of, 18 18 * beyond the 5 used here but they are more complex. 19 19 * 20 - * This driver is written to be used with the Hecuba display controller 21 - * board, and tested with the EInk 800x600 display in 1 bit mode. 22 - * The interface between Hecuba and the host is TTL based GPIO. The 23 - * GPIO requirements are 8 writable data lines and 6 lines for control. 24 - * Only 4 of the controls are actually used here but 6 for future use. 25 - * The driver requires the IO addresses for data and control GPIO at 26 - * load time. It is also possible to use this display with a standard 27 - * PC parallel port. 20 + * This driver is written to be used with the Hecuba display architecture. 21 + * The actual display chip is called Apollo and the interface electronics 22 + * it needs is called Hecuba. 28 23 * 29 - * General notes: 30 - * - User must set hecubafb_enable=1 to enable it 31 - * - User must set dio_addr=0xIOADDR cio_addr=0xIOADDR c2io_addr=0xIOADDR 24 + * It is intended to be architecture independent. A board specific driver 25 + * must be used to perform all the physical IO interactions. An example 26 + * is provided as n411.c 32 27 * 33 28 */ 34 29 ··· 42 47 #include <linux/list.h> 43 48 #include <linux/uaccess.h> 44 49 45 - /* Apollo controller specific defines */ 46 - #define APOLLO_START_NEW_IMG 0xA0 47 - #define APOLLO_STOP_IMG_DATA 0xA1 48 - #define APOLLO_DISPLAY_IMG 0xA2 49 - #define APOLLO_ERASE_DISPLAY 0xA3 50 - #define APOLLO_INIT_DISPLAY 0xA4 51 - 52 - /* Hecuba interface specific defines */ 53 - /* WUP is inverted, CD is inverted, DS is inverted */ 54 - #define HCB_NWUP_BIT 0x01 55 - #define HCB_NDS_BIT 0x02 56 - #define HCB_RW_BIT 0x04 57 - #define HCB_NCD_BIT 0x08 58 - #define HCB_ACK_BIT 0x80 50 + #include <video/hecubafb.h> 59 51 60 52 /* Display specific information */ 61 53 #define DPY_W 600 62 54 #define DPY_H 800 63 - 64 - struct hecubafb_par { 65 - unsigned long dio_addr; 66 - unsigned long cio_addr; 67 - unsigned long c2io_addr; 68 - unsigned char ctl; 69 - struct fb_info *info; 70 - unsigned int irq; 71 - }; 72 55 73 56 static struct fb_fix_screeninfo hecubafb_fix __devinitdata = { 74 57 .id = "hecubafb", ··· 55 82 .xpanstep = 0, 56 83 .ypanstep = 0, 57 84 .ywrapstep = 0, 85 + .line_length = DPY_W, 58 86 .accel = FB_ACCEL_NONE, 59 87 }; 60 88 ··· 68 94 .nonstd = 1, 69 95 }; 70 96 71 - static unsigned long dio_addr; 72 - static unsigned long cio_addr; 73 - static unsigned long c2io_addr; 74 - static unsigned long splashval; 75 - static unsigned int nosplash; 76 - static unsigned int hecubafb_enable; 77 - static unsigned int irq; 78 - 79 - static DECLARE_WAIT_QUEUE_HEAD(hecubafb_waitq); 80 - 81 - static void hcb_set_ctl(struct hecubafb_par *par) 82 - { 83 - outb(par->ctl, par->cio_addr); 84 - } 85 - 86 - static unsigned char hcb_get_ctl(struct hecubafb_par *par) 87 - { 88 - return inb(par->c2io_addr); 89 - } 90 - 91 - static void hcb_set_data(struct hecubafb_par *par, unsigned char value) 92 - { 93 - outb(value, par->dio_addr); 94 - } 95 - 96 - static int __devinit apollo_init_control(struct hecubafb_par *par) 97 - { 98 - unsigned char ctl; 99 - /* for init, we want the following setup to be set: 100 - WUP = lo 101 - ACK = hi 102 - DS = hi 103 - RW = hi 104 - CD = lo 105 - */ 106 - 107 - /* write WUP to lo, DS to hi, RW to hi, CD to lo */ 108 - par->ctl = HCB_NWUP_BIT | HCB_RW_BIT | HCB_NCD_BIT ; 109 - par->ctl &= ~HCB_NDS_BIT; 110 - hcb_set_ctl(par); 111 - 112 - /* check ACK is not lo */ 113 - ctl = hcb_get_ctl(par); 114 - if ((ctl & HCB_ACK_BIT)) { 115 - printk(KERN_ERR "Fail because ACK is already low\n"); 116 - return -ENXIO; 117 - } 118 - 119 - return 0; 120 - } 121 - 122 - static void hcb_wait_for_ack(struct hecubafb_par *par) 123 - { 124 - 125 - int timeout; 126 - unsigned char ctl; 127 - 128 - timeout=500; 129 - do { 130 - ctl = hcb_get_ctl(par); 131 - if ((ctl & HCB_ACK_BIT)) 132 - return; 133 - udelay(1); 134 - } while (timeout--); 135 - printk(KERN_ERR "timed out waiting for ack\n"); 136 - } 137 - 138 - static void hcb_wait_for_ack_clear(struct hecubafb_par *par) 139 - { 140 - 141 - int timeout; 142 - unsigned char ctl; 143 - 144 - timeout=500; 145 - do { 146 - ctl = hcb_get_ctl(par); 147 - if (!(ctl & HCB_ACK_BIT)) 148 - return; 149 - udelay(1); 150 - } while (timeout--); 151 - printk(KERN_ERR "timed out waiting for clear\n"); 152 - } 97 + /* main hecubafb functions */ 153 98 154 99 static void apollo_send_data(struct hecubafb_par *par, unsigned char data) 155 100 { 156 101 /* set data */ 157 - hcb_set_data(par, data); 102 + par->board->set_data(par, data); 158 103 159 104 /* set DS low */ 160 - par->ctl |= HCB_NDS_BIT; 161 - hcb_set_ctl(par); 105 + par->board->set_ctl(par, HCB_DS_BIT, 0); 162 106 163 - hcb_wait_for_ack(par); 107 + /* wait for ack */ 108 + par->board->wait_for_ack(par, 0); 164 109 165 110 /* set DS hi */ 166 - par->ctl &= ~(HCB_NDS_BIT); 167 - hcb_set_ctl(par); 111 + par->board->set_ctl(par, HCB_DS_BIT, 1); 168 112 169 - hcb_wait_for_ack_clear(par); 113 + /* wait for ack to clear */ 114 + par->board->wait_for_ack(par, 1); 170 115 } 171 116 172 117 static void apollo_send_command(struct hecubafb_par *par, unsigned char data) 173 118 { 174 119 /* command so set CD to high */ 175 - par->ctl &= ~(HCB_NCD_BIT); 176 - hcb_set_ctl(par); 120 + par->board->set_ctl(par, HCB_CD_BIT, 1); 177 121 178 122 /* actually strobe with command */ 179 123 apollo_send_data(par, data); 180 124 181 125 /* clear CD back to low */ 182 - par->ctl |= (HCB_NCD_BIT); 183 - hcb_set_ctl(par); 126 + par->board->set_ctl(par, HCB_CD_BIT, 0); 184 127 } 185 - 186 - /* main hecubafb functions */ 187 128 188 129 static void hecubafb_dpy_update(struct hecubafb_par *par) 189 130 { 190 131 int i; 191 132 unsigned char *buf = (unsigned char __force *)par->info->screen_base; 192 133 193 - apollo_send_command(par, 0xA0); 134 + apollo_send_command(par, APOLLO_START_NEW_IMG); 194 135 195 136 for (i=0; i < (DPY_W*DPY_H/8); i++) { 196 137 apollo_send_data(par, *(buf++)); 197 138 } 198 139 199 - apollo_send_command(par, 0xA1); 200 - apollo_send_command(par, 0xA2); 140 + apollo_send_command(par, APOLLO_STOP_IMG_DATA); 141 + apollo_send_command(par, APOLLO_DISPLAY_IMG); 201 142 } 202 143 203 144 /* this is called back from the deferred io workqueue */ ··· 215 326 static int __devinit hecubafb_probe(struct platform_device *dev) 216 327 { 217 328 struct fb_info *info; 329 + struct hecuba_board *board; 218 330 int retval = -ENOMEM; 219 331 int videomemorysize; 220 332 unsigned char *videomemory; 221 333 struct hecubafb_par *par; 334 + 335 + /* pick up board specific routines */ 336 + board = dev->dev.platform_data; 337 + if (!board) 338 + return -EINVAL; 339 + 340 + /* try to count device specific driver, if can't, platform recalls */ 341 + if (!try_module_get(board->owner)) 342 + return -ENODEV; 222 343 223 344 videomemorysize = (DPY_W*DPY_H)/8; 224 345 ··· 239 340 240 341 info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev); 241 342 if (!info) 242 - goto err; 343 + goto err_fballoc; 243 344 244 - info->screen_base = (char __iomem *) videomemory; 345 + info->screen_base = (char __force __iomem *)videomemory; 245 346 info->fbops = &hecubafb_ops; 246 347 247 348 info->var = hecubafb_var; ··· 249 350 info->fix.smem_len = videomemorysize; 250 351 par = info->par; 251 352 par->info = info; 353 + par->board = board; 354 + par->send_command = apollo_send_command; 355 + par->send_data = apollo_send_data; 252 356 253 - if (!dio_addr || !cio_addr || !c2io_addr) { 254 - printk(KERN_WARNING "no IO addresses supplied\n"); 255 - goto err1; 256 - } 257 - par->dio_addr = dio_addr; 258 - par->cio_addr = cio_addr; 259 - par->c2io_addr = c2io_addr; 260 357 info->flags = FBINFO_FLAG_DEFAULT; 261 358 262 359 info->fbdefio = &hecubafb_defio; ··· 260 365 261 366 retval = register_framebuffer(info); 262 367 if (retval < 0) 263 - goto err1; 368 + goto err_fbreg; 264 369 platform_set_drvdata(dev, info); 265 370 266 371 printk(KERN_INFO ··· 268 373 info->node, videomemorysize >> 10); 269 374 270 375 /* this inits the dpy */ 271 - apollo_init_control(par); 272 - 273 - apollo_send_command(par, APOLLO_INIT_DISPLAY); 274 - apollo_send_data(par, 0x81); 275 - 276 - /* have to wait while display resets */ 277 - udelay(1000); 278 - 279 - /* if we were told to splash the screen, we just clear it */ 280 - if (!nosplash) { 281 - apollo_send_command(par, APOLLO_ERASE_DISPLAY); 282 - apollo_send_data(par, splashval); 283 - } 376 + retval = par->board->init(par); 377 + if (retval < 0) 378 + goto err_fbreg; 284 379 285 380 return 0; 286 - err1: 381 + err_fbreg: 287 382 framebuffer_release(info); 288 - err: 383 + err_fballoc: 289 384 vfree(videomemory); 385 + module_put(board->owner); 290 386 return retval; 291 387 } 292 388 ··· 286 400 struct fb_info *info = platform_get_drvdata(dev); 287 401 288 402 if (info) { 403 + struct hecubafb_par *par = info->par; 289 404 fb_deferred_io_cleanup(info); 290 405 unregister_framebuffer(info); 291 406 vfree((void __force *)info->screen_base); 407 + if (par->board->remove) 408 + par->board->remove(par); 409 + module_put(par->board->owner); 292 410 framebuffer_release(info); 293 411 } 294 412 return 0; ··· 302 412 .probe = hecubafb_probe, 303 413 .remove = hecubafb_remove, 304 414 .driver = { 415 + .owner = THIS_MODULE, 305 416 .name = "hecubafb", 306 417 }, 307 418 }; 308 419 309 - static struct platform_device *hecubafb_device; 310 - 311 420 static int __init hecubafb_init(void) 312 421 { 313 - int ret; 314 - 315 - if (!hecubafb_enable) { 316 - printk(KERN_ERR "Use hecubafb_enable to enable the device\n"); 317 - return -ENXIO; 318 - } 319 - 320 - ret = platform_driver_register(&hecubafb_driver); 321 - if (!ret) { 322 - hecubafb_device = platform_device_alloc("hecubafb", 0); 323 - if (hecubafb_device) 324 - ret = platform_device_add(hecubafb_device); 325 - else 326 - ret = -ENOMEM; 327 - 328 - if (ret) { 329 - platform_device_put(hecubafb_device); 330 - platform_driver_unregister(&hecubafb_driver); 331 - } 332 - } 333 - return ret; 334 - 422 + return platform_driver_register(&hecubafb_driver); 335 423 } 336 424 337 425 static void __exit hecubafb_exit(void) 338 426 { 339 - platform_device_unregister(hecubafb_device); 340 427 platform_driver_unregister(&hecubafb_driver); 341 428 } 342 - 343 - module_param(nosplash, uint, 0); 344 - MODULE_PARM_DESC(nosplash, "Disable doing the splash screen"); 345 - module_param(hecubafb_enable, uint, 0); 346 - MODULE_PARM_DESC(hecubafb_enable, "Enable communication with Hecuba board"); 347 - module_param(dio_addr, ulong, 0); 348 - MODULE_PARM_DESC(dio_addr, "IO address for data, eg: 0x480"); 349 - module_param(cio_addr, ulong, 0); 350 - MODULE_PARM_DESC(cio_addr, "IO address for control, eg: 0x400"); 351 - module_param(c2io_addr, ulong, 0); 352 - MODULE_PARM_DESC(c2io_addr, "IO address for secondary control, eg: 0x408"); 353 - module_param(splashval, ulong, 0); 354 - MODULE_PARM_DESC(splashval, "Splash pattern: 0x00 is black, 0x01 is white"); 355 - module_param(irq, uint, 0); 356 - MODULE_PARM_DESC(irq, "IRQ for the Hecuba board"); 357 429 358 430 module_init(hecubafb_init); 359 431 module_exit(hecubafb_exit); 360 432 361 - MODULE_DESCRIPTION("fbdev driver for Hecuba board"); 433 + MODULE_DESCRIPTION("fbdev driver for Hecuba/Apollo controller"); 362 434 MODULE_AUTHOR("Jaya Kumar"); 363 435 MODULE_LICENSE("GPL");
+202
drivers/video/n411.c
··· 1 + /* 2 + * linux/drivers/video/n411.c -- Platform device for N411 EPD kit 3 + * 4 + * Copyright (C) 2008, Jaya Kumar 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file COPYING in the main directory of this archive for 8 + * more details. 9 + * 10 + * Layout is based on skeletonfb.c by James Simmons and Geert Uytterhoeven. 11 + * 12 + * This driver is written to be used with the Hecuba display controller 13 + * board, and tested with the EInk 800x600 display in 1 bit mode. 14 + * The interface between Hecuba and the host is TTL based GPIO. The 15 + * GPIO requirements are 8 writable data lines and 6 lines for control. 16 + * Only 4 of the controls are actually used here but 6 for future use. 17 + * The driver requires the IO addresses for data and control GPIO at 18 + * load time. It is also possible to use this display with a standard 19 + * PC parallel port. 20 + * 21 + * General notes: 22 + * - User must set dio_addr=0xIOADDR cio_addr=0xIOADDR c2io_addr=0xIOADDR 23 + * 24 + */ 25 + 26 + #include <linux/module.h> 27 + #include <linux/kernel.h> 28 + #include <linux/errno.h> 29 + #include <linux/string.h> 30 + #include <linux/delay.h> 31 + #include <linux/interrupt.h> 32 + #include <linux/fb.h> 33 + #include <linux/init.h> 34 + #include <linux/platform_device.h> 35 + #include <linux/list.h> 36 + #include <linux/uaccess.h> 37 + #include <linux/irq.h> 38 + 39 + #include <video/hecubafb.h> 40 + 41 + static unsigned long dio_addr; 42 + static unsigned long cio_addr; 43 + static unsigned long c2io_addr; 44 + static unsigned long splashval; 45 + static unsigned int nosplash; 46 + static unsigned char ctl; 47 + 48 + static void n411_set_ctl(struct hecubafb_par *par, unsigned char bit, unsigned 49 + char state) 50 + { 51 + switch (bit) { 52 + case HCB_CD_BIT: 53 + if (state) 54 + ctl &= ~(HCB_CD_BIT); 55 + else 56 + ctl |= HCB_CD_BIT; 57 + break; 58 + case HCB_DS_BIT: 59 + if (state) 60 + ctl &= ~(HCB_DS_BIT); 61 + else 62 + ctl |= HCB_DS_BIT; 63 + break; 64 + } 65 + outb(ctl, cio_addr); 66 + } 67 + 68 + static unsigned char n411_get_ctl(struct hecubafb_par *par) 69 + { 70 + return inb(c2io_addr); 71 + } 72 + 73 + static void n411_set_data(struct hecubafb_par *par, unsigned char value) 74 + { 75 + outb(value, dio_addr); 76 + } 77 + 78 + static void n411_wait_for_ack(struct hecubafb_par *par, int clear) 79 + { 80 + int timeout; 81 + unsigned char tmp; 82 + 83 + timeout = 500; 84 + do { 85 + tmp = n411_get_ctl(par); 86 + if ((tmp & HCB_ACK_BIT) && (!clear)) 87 + return; 88 + else if (!(tmp & HCB_ACK_BIT) && (clear)) 89 + return; 90 + udelay(1); 91 + } while (timeout--); 92 + printk(KERN_ERR "timed out waiting for ack\n"); 93 + } 94 + 95 + static int n411_init_control(struct hecubafb_par *par) 96 + { 97 + unsigned char tmp; 98 + /* for init, we want the following setup to be set: 99 + WUP = lo 100 + ACK = hi 101 + DS = hi 102 + RW = hi 103 + CD = lo 104 + */ 105 + 106 + /* write WUP to lo, DS to hi, RW to hi, CD to lo */ 107 + ctl = HCB_WUP_BIT | HCB_RW_BIT | HCB_CD_BIT ; 108 + n411_set_ctl(par, HCB_DS_BIT, 1); 109 + 110 + /* check ACK is not lo */ 111 + tmp = n411_get_ctl(par); 112 + if (tmp & HCB_ACK_BIT) { 113 + printk(KERN_ERR "Fail because ACK is already low\n"); 114 + return -ENXIO; 115 + } 116 + 117 + return 0; 118 + } 119 + 120 + 121 + static int n411_init_board(struct hecubafb_par *par) 122 + { 123 + int retval; 124 + 125 + retval = n411_init_control(par); 126 + if (retval) 127 + return retval; 128 + 129 + par->send_command(par, APOLLO_INIT_DISPLAY); 130 + par->send_data(par, 0x81); 131 + 132 + /* have to wait while display resets */ 133 + udelay(1000); 134 + 135 + /* if we were told to splash the screen, we just clear it */ 136 + if (!nosplash) { 137 + par->send_command(par, APOLLO_ERASE_DISPLAY); 138 + par->send_data(par, splashval); 139 + } 140 + 141 + return 0; 142 + } 143 + 144 + static struct hecuba_board n411_board = { 145 + .owner = THIS_MODULE, 146 + .init = n411_init_board, 147 + .set_ctl = n411_set_ctl, 148 + .set_data = n411_set_data, 149 + .wait_for_ack = n411_wait_for_ack, 150 + }; 151 + 152 + static struct platform_device *n411_device; 153 + static int __init n411_init(void) 154 + { 155 + int ret; 156 + if (!dio_addr || !cio_addr || !c2io_addr) { 157 + printk(KERN_WARNING "no IO addresses supplied\n"); 158 + return -EINVAL; 159 + } 160 + 161 + /* request our platform independent driver */ 162 + request_module("hecubafb"); 163 + 164 + n411_device = platform_device_alloc("hecubafb", -1); 165 + if (!n411_device) 166 + return -ENOMEM; 167 + 168 + platform_device_add_data(n411_device, &n411_board, sizeof(n411_board)); 169 + 170 + /* this _add binds hecubafb to n411. hecubafb refcounts n411 */ 171 + ret = platform_device_add(n411_device); 172 + 173 + if (ret) 174 + platform_device_put(n411_device); 175 + 176 + return ret; 177 + 178 + } 179 + 180 + static void __exit n411_exit(void) 181 + { 182 + platform_device_unregister(n411_device); 183 + } 184 + 185 + module_init(n411_init); 186 + module_exit(n411_exit); 187 + 188 + module_param(nosplash, uint, 0); 189 + MODULE_PARM_DESC(nosplash, "Disable doing the splash screen"); 190 + module_param(dio_addr, ulong, 0); 191 + MODULE_PARM_DESC(dio_addr, "IO address for data, eg: 0x480"); 192 + module_param(cio_addr, ulong, 0); 193 + MODULE_PARM_DESC(cio_addr, "IO address for control, eg: 0x400"); 194 + module_param(c2io_addr, ulong, 0); 195 + MODULE_PARM_DESC(c2io_addr, "IO address for secondary control, eg: 0x408"); 196 + module_param(splashval, ulong, 0); 197 + MODULE_PARM_DESC(splashval, "Splash pattern: 0x00 is black, 0x01 is white"); 198 + 199 + MODULE_DESCRIPTION("board driver for n411 hecuba/apollo epd kit"); 200 + MODULE_AUTHOR("Jaya Kumar"); 201 + MODULE_LICENSE("GPL"); 202 +
+51
include/video/hecubafb.h
··· 1 + /* 2 + * hecubafb.h - definitions for the hecuba framebuffer driver 3 + * 4 + * Copyright (C) 2008 by Jaya Kumar 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file COPYING in the main directory of this archive for 8 + * more details. 9 + * 10 + */ 11 + 12 + #ifndef _LINUX_HECUBAFB_H_ 13 + #define _LINUX_HECUBAFB_H_ 14 + 15 + /* Apollo controller specific defines */ 16 + #define APOLLO_START_NEW_IMG 0xA0 17 + #define APOLLO_STOP_IMG_DATA 0xA1 18 + #define APOLLO_DISPLAY_IMG 0xA2 19 + #define APOLLO_ERASE_DISPLAY 0xA3 20 + #define APOLLO_INIT_DISPLAY 0xA4 21 + 22 + /* Hecuba interface specific defines */ 23 + #define HCB_WUP_BIT 0x01 24 + #define HCB_DS_BIT 0x02 25 + #define HCB_RW_BIT 0x04 26 + #define HCB_CD_BIT 0x08 27 + #define HCB_ACK_BIT 0x80 28 + 29 + /* struct used by hecuba. board specific stuff comes from *board */ 30 + struct hecubafb_par { 31 + struct fb_info *info; 32 + struct hecuba_board *board; 33 + void (*send_command)(struct hecubafb_par *, unsigned char); 34 + void (*send_data)(struct hecubafb_par *, unsigned char); 35 + }; 36 + 37 + /* board specific routines 38 + board drivers can implement wait_for_ack with interrupts if desired. if 39 + wait_for_ack is called with clear=0, then go to sleep and return when ack 40 + goes hi or if wait_for_ack with clear=1, then return when ack goes lo */ 41 + struct hecuba_board { 42 + struct module *owner; 43 + void (*remove)(struct hecubafb_par *); 44 + void (*set_ctl)(struct hecubafb_par *, unsigned char, unsigned char); 45 + void (*set_data)(struct hecubafb_par *, unsigned char); 46 + void (*wait_for_ack)(struct hecubafb_par *, int); 47 + int (*init)(struct hecubafb_par *); 48 + }; 49 + 50 + 51 + #endif