10 #include <linux/module.h>
11 #include <linux/kernel.h>
12 #include <linux/errno.h>
13 #include <linux/string.h>
29 static int leo_setcolreg(
unsigned,
unsigned,
unsigned,
unsigned,
31 static int leo_blank(
int,
struct fb_info *);
34 static int leo_ioctl(
struct fb_info *,
unsigned int,
unsigned long);
41 static struct fb_ops leo_ops = {
43 .fb_setcolreg = leo_setcolreg,
44 .fb_blank = leo_blank,
45 .fb_pan_display = leo_pan_display,
50 .fb_ioctl = leo_ioctl,
56 #define LEO_OFF_LC_SS0_KRN 0x00200000UL
57 #define LEO_OFF_LC_SS0_USR 0x00201000UL
58 #define LEO_OFF_LC_SS1_KRN 0x01200000UL
59 #define LEO_OFF_LC_SS1_USR 0x01201000UL
60 #define LEO_OFF_LD_SS0 0x00400000UL
61 #define LEO_OFF_LD_SS1 0x01400000UL
62 #define LEO_OFF_LD_GBL 0x00401000UL
63 #define LEO_OFF_LX_KRN 0x00600000UL
64 #define LEO_OFF_LX_CURSOR 0x00601000UL
65 #define LEO_OFF_SS0 0x00800000UL
66 #define LEO_OFF_SS1 0x01800000UL
67 #define LEO_OFF_UNK 0x00602000UL
68 #define LEO_OFF_UNK2 0x00000000UL
70 #define LEO_CUR_ENABLE 0x00000080
71 #define LEO_CUR_UPDATE 0x00000030
72 #define LEO_CUR_PROGRESS 0x00000006
73 #define LEO_CUR_UPDATECMAP 0x00000003
75 #define LEO_CUR_TYPE_MASK 0x00000000
76 #define LEO_CUR_TYPE_IMAGE 0x00000020
77 #define LEO_CUR_TYPE_CMAP 0x00000050
87 #define LEO_KRN_TYPE_CLUT0 0x00001000
88 #define LEO_KRN_TYPE_CLUT1 0x00001001
89 #define LEO_KRN_TYPE_CLUT2 0x00001002
90 #define LEO_KRN_TYPE_WID 0x00001003
91 #define LEO_KRN_TYPE_UNK 0x00001006
92 #define LEO_KRN_TYPE_VIDEO 0x00002003
93 #define LEO_KRN_TYPE_CLUTDATA 0x00004000
94 #define LEO_KRN_CSR_ENABLE 0x00000008
95 #define LEO_KRN_CSR_PROGRESS 0x00000004
96 #define LEO_KRN_CSR_UNK 0x00000002
97 #define LEO_KRN_CSR_UNK2 0x00000001
169 #define LEO_SS1_MISC_ENABLE 0x00000001
170 #define LEO_SS1_MISC_STEREO 0x00000002
191 #define LEO_FLAG_BLANKED 0x00000001
208 static void leo_switch_from_graph(
struct fb_info *
info)
219 ((info->
var.yres - 1) << 16));
236 }
while (
val & 0x20000000);
247 spin_unlock_irqrestore(&par->
lock,
flags);
255 leo_switch_from_graph(info);
271 static int leo_setcolreg(
unsigned regno,
288 par->
clut_data[regno] = red | (green << 8) | (blue << 16);
295 for (
i = 0;
i < 256;
i++)
303 spin_unlock_irqrestore(&par->
lock,
flags);
313 static int leo_blank(
int blank,
struct fb_info *info)
341 spin_unlock_irqrestore(&par->
lock,
flags);
420 info->
fix.smem_start, info->
fix.smem_len,
424 static int leo_ioctl(
struct fb_info *info,
unsigned int cmd,
unsigned long arg)
442 info->
fix.line_length = 8192;
460 for (i = 0, wi = wl->
wl_list; i < wl->wl_count; i++, wi++) {
461 switch (wi->wi_type) {
463 j = (wi->wi_index & 0xf) + 0x40;
467 j = wi->wi_index & 0x3f;
482 spin_unlock_irqrestore(&par->
lock,
flags);
485 static void leo_init_wids(
struct fb_info *info)
494 wi.wi_values [0] = 0x2c0;
495 leo_wid_put(info, &wl);
497 wi.wi_values [0] = 0x30;
498 leo_wid_put(info, &wl);
500 wi.wi_values [0] = 0x20;
501 leo_wid_put(info, &wl);
504 wi.wi_values [0] = 0x30;
505 leo_wid_put(info, &wl);
508 static void leo_init_hw(
struct fb_info *info)
517 leo_switch_from_graph(info);
524 var->
green.offset = 8;
525 var->
green.length = 8;
526 var->
blue.offset = 16;
527 var->
blue.length = 8;
570 leo_fixup_var_rgb(&info->
var);
578 0x1000,
"leolc ss0usr");
581 0x1000,
"leold ss0");
584 0x1000,
"leold ss1");
587 0x1000,
"leolx krn");
593 0x800000,
"leo ram");
603 info->
fbops = &leo_ops;
614 leo_init_fix(info, dp);
618 goto out_dealloc_cmap;
632 leo_unmap_regs(op, info, par);
647 leo_unmap_regs(op, info, par);
668 .of_match_table = leo_match,
674 static int __init leo_init(
void)
682 static void __exit leo_exit(
void)