11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/string.h>
30 static int tcx_setcolreg(
unsigned,
unsigned,
unsigned,
unsigned,
32 static int tcx_blank(
int,
struct fb_info *);
35 static int tcx_ioctl(
struct fb_info *,
unsigned int,
unsigned long);
42 static struct fb_ops tcx_ops = {
44 .fb_setcolreg = tcx_setcolreg,
45 .fb_blank = tcx_blank,
46 .fb_pan_display = tcx_pan_display,
51 .fb_ioctl = tcx_ioctl,
58 #define TCX_THC_MISC_REV_SHIFT 16
59 #define TCX_THC_MISC_REV_MASK 15
60 #define TCX_THC_MISC_VSYNC_DIS (1 << 25)
61 #define TCX_THC_MISC_HSYNC_DIS (1 << 24)
62 #define TCX_THC_MISC_RESET (1 << 12)
63 #define TCX_THC_MISC_VIDEO (1 << 10)
64 #define TCX_THC_MISC_SYNC (1 << 9)
65 #define TCX_THC_MISC_VSYNC (1 << 8)
66 #define TCX_THC_MISC_SYNC_ENAB (1 << 7)
67 #define TCX_THC_MISC_CURS_RES (1 << 6)
68 #define TCX_THC_MISC_INT_ENAB (1 << 5)
69 #define TCX_THC_MISC_INT (1 << 4)
70 #define TCX_THC_MISC_INIT 0x9f
71 #define TCX_THC_REV_REV_SHIFT 20
72 #define TCX_THC_REV_REV_MASK 15
73 #define TCX_THC_REV_MINREV_SHIFT 28
74 #define TCX_THC_REV_MINREV_MASK 15
106 #define TCX_MMAP_ENTRIES 14
116 #define TCX_FLAG_BLANKED 0x00000001
125 static void __tcx_set_control_plane(
struct fb_info *
info)
136 for (pend = p + info->
fix.smem_len; p < pend; p++) {
150 __tcx_set_control_plane(info);
151 spin_unlock_irqrestore(&par->
lock,
flags);
169 static int tcx_setcolreg(
unsigned regno,
191 spin_unlock_irqrestore(&par->
lock,
flags);
202 tcx_blank(
int blank,
struct fb_info *info)
239 spin_unlock_irqrestore(&par->
lock,
flags);
305 info->
fix.smem_start, info->
fix.smem_len,
309 static int tcx_ioctl(
struct fb_info *info,
unsigned int cmd,
325 tcx_init_fix(
struct fb_info *info,
int linebytes)
328 const char *tcx_name;
340 info->
fix.line_length = linebytes;
370 int linebytes,
i,
err;
385 info->
var.red.length = 8;
386 info->
var.green.length = 8;
387 info->
var.blue.length = 8;
394 sizeof(
struct tcx_tec),
"tcx tec");
396 sizeof(
struct tcx_thc),
"tcx thc");
398 sizeof(
struct bt_regs),
"tcx dac");
400 info->
fix.smem_len,
"tcx ram");
401 if (!par->
tec || !par->
thc ||
408 info->
fix.smem_len *
sizeof(
u32),
442 info->
fbops = &tcx_ops;
462 tcx_init_fix(info, linebytes);
466 goto out_dealloc_cmap;
473 info->
fix.smem_start,
474 par->
lowdepth ?
"8-bit only" :
"24-bit depth");
482 tcx_unmap_regs(op, info, par);
497 tcx_unmap_regs(op, info, par);
518 .of_match_table = tcx_match,
524 static int __init tcx_init(
void)
532 static void __exit tcx_exit(
void)