static int bw2_blank(int, struct fb_info *);
-static int bw2_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
-static int bw2_ioctl(struct inode *, struct file *, unsigned int,
- unsigned long, struct fb_info *);
+static int bw2_mmap(struct fb_info *, struct vm_area_struct *);
+static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);
/*
* Frame buffer operations
.fb_imageblit = cfb_imageblit,
.fb_mmap = bw2_mmap,
.fb_ioctl = bw2_ioctl,
- .fb_cursor = soft_cursor,
+#ifdef CONFIG_COMPAT
+ .fb_compat_ioctl = sbusfb_compat_ioctl,
+#endif
};
/* OBio addresses for the bwtwo registers */
struct bw2_par {
spinlock_t lock;
- struct bw2_regs *regs;
+ struct bw2_regs __iomem *regs;
u32 flags;
#define BW2_FLAG_BLANKED 0x00000001
unsigned long fbsize;
struct sbus_dev *sdev;
- struct list_head list;
};
/**
bw2_blank(int blank, struct fb_info *info)
{
struct bw2_par *par = (struct bw2_par *) info->par;
- struct bw2_regs *regs = par->regs;
+ struct bw2_regs __iomem *regs = par->regs;
unsigned long flags;
u8 val;
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
- case 0: /* Unblanking */
+ case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readb(®s->control);
val |= BWTWO_CTL_ENABLE_VIDEO;
sbus_writeb(val, ®s->control);
par->flags &= ~BW2_FLAG_BLANKED;
break;
- case 1: /* Normal blanking */
- case 2: /* VESA blank (vsync off) */
- case 3: /* VESA blank (hsync off) */
- case 4: /* Poweroff */
+ case FB_BLANK_NORMAL: /* Normal blanking */
+ case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
+ case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
+ case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readb(®s->control);
val &= ~BWTWO_CTL_ENABLE_VIDEO;
sbus_writeb(val, ®s->control);
{ .size = 0 }
};
-static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma)
+static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct bw2_par *par = (struct bw2_par *)info->par;
vma);
}
-static int bw2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
- unsigned long arg, struct fb_info *info)
+static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
struct bw2_par *par = (struct bw2_par *) info->par;
prom_halt();
}
for ( ; *p; p += 2) {
- u8 *regp = &((u8 *)par->regs)[p[0]];
+ u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]];
sbus_writeb(p[1], regp);
}
}
resp = &res;
all->info.var.xres = all->info.var.xres_virtual = 1152;
all->info.var.yres = all->info.var.yres_virtual = 900;
- all->info.bits_per_pixel = 1;
+ all->info.var.bits_per_pixel = 1;
linebytes = 1152 / 8;
} else
#else
all->info.var.xres);
}
#endif
+ all->info.var.red.length = all->info.var.green.length =
+ all->info.var.blue.length = all->info.var.bits_per_pixel;
+ all->info.var.red.offset = all->info.var.green.offset =
+ all->info.var.blue.offset = 0;
- all->par.regs = (struct bw2_regs *)
- sbus_ioremap(resp, BWTWO_REGISTER_OFFSET,
+ all->par.regs = sbus_ioremap(resp, BWTWO_REGISTER_OFFSET,
sizeof(struct bw2_regs), "bw2 regs");
if (sdev && !prom_getbool(sdev->prom_node, "width"))
all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
- all->info.flags = FBINFO_FLAG_DEFAULT;
+ all->info.flags = FBINFO_DEFAULT;
all->info.fbops = &bw2_ops;
#if defined(CONFIG_SPARC32)
if (sdev)
- all->info.screen_base = (char *)
+ all->info.screen_base = (char __iomem *)
prom_getintdefault(sdev->prom_node, "address", 0);
#endif
if (!all->info.screen_base)
- all->info.screen_base = (char *)
+ all->info.screen_base =
sbus_ioremap(resp, 0, all->par.fbsize, "bw2 ram");
- all->info.currcon = -1;
all->info.par = &all->par;
bw2_blank(0, &all->info);
struct sbus_bus *sbus;
struct sbus_dev *sdev;
+ if (fb_get_options("bw2fb", NULL))
+ return -ENODEV;
+
#ifdef CONFIG_SUN4
bw2_init_one(NULL);
#endif
return 0;
}
-#ifdef MODULE
module_init(bw2_init);
+
+#ifdef MODULE
module_exit(bw2_exit);
#endif