11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/string.h>
30 static int bw2_blank(
int,
struct fb_info *);
33 static int bw2_ioctl(
struct fb_info *,
unsigned int,
unsigned long);
39 static struct fb_ops bw2_ops = {
41 .fb_blank = bw2_blank,
46 .fb_ioctl = bw2_ioctl,
53 #define BWTWO_REGISTER_OFFSET 0x400000
83 #define BWTWO_SR_RES_MASK 0x70
84 #define BWTWO_SR_1600_1280 0x50
85 #define BWTWO_SR_1152_900_76_A 0x40
86 #define BWTWO_SR_1152_900_76_B 0x60
87 #define BWTWO_SR_ID_MASK 0x0f
88 #define BWTWO_SR_ID_MONO 0x02
89 #define BWTWO_SR_ID_MONO_ECL 0x03
90 #define BWTWO_SR_ID_MSYNC 0x04
91 #define BWTWO_SR_ID_NOCONN 0x0a
94 #define BWTWO_CTL_ENABLE_INTS 0x80
95 #define BWTWO_CTL_ENABLE_VIDEO 0x40
96 #define BWTWO_CTL_ENABLE_TIMING 0x20
97 #define BWTWO_CTL_ENABLE_CURCMP 0x10
98 #define BWTWO_CTL_XTAL_MASK 0x0C
99 #define BWTWO_CTL_DIVISOR_MASK 0x03
102 #define BWTWO_STAT_PENDING_INT 0x80
103 #define BWTWO_STAT_MSENSE_MASK 0x70
104 #define BWTWO_STAT_ID_MASK 0x0f
111 #define BW2_FLAG_BLANKED 0x00000001
150 spin_unlock_irqrestore(&par->
lock,
flags);
167 info->
fix.smem_start, info->
fix.smem_len,
172 static int bw2_ioctl(
struct fb_info *info,
unsigned int cmd,
unsigned long arg)
189 info->
fix.line_length = linebytes;
195 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
196 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
197 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01,
201 static u8 bw2regs_ecl[] __devinitdata = {
202 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c,
203 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23,
204 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01,
208 static u8 bw2regs_analog[] __devinitdata = {
209 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13,
210 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22,
211 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
215 static u8 bw2regs_76hz[] __devinitdata = {
216 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
217 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
218 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
222 static u8 bw2regs_66hz[] __devinitdata = {
223 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
224 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
225 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
242 info->
var.xres = info->
var.xres_virtual = 1600;
243 info->
var.yres = info->
var.yres_virtual = 1280;
244 *linebytes = 1600 / 8;
269 for ( ; *
p; p += 2) {
299 info->
var.red.length = info->
var.green.length =
300 info->
var.blue.length = info->
var.bits_per_pixel;
301 info->
var.red.offset = info->
var.green.offset =
302 info->
var.blue.offset = 0;
305 sizeof(
struct bw2_regs),
"bw2 regs");
310 err = bw2_do_default_mode(par, info, &linebytes);
318 info->
fbops = &bw2_ops;
321 info->
fix.smem_len,
"bw2 ram");
329 bw2_init_fix(info, linebytes);
333 goto out_unmap_screen;
384 .of_match_table = bw2_match,
390 static int __init bw2_init(
void)
398 static void __exit bw2_exit(
void)