Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* p9100.c: P9100 frame buffer driver |
| 2 | * |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 3 | * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * Copyright 1999 Derrick J Brashear (shadow@dementia.org) |
| 5 | * |
| 6 | * Driver layout based loosely on tgafb.c, see that file for credits. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/kernel.h> |
| 11 | #include <linux/errno.h> |
| 12 | #include <linux/string.h> |
| 13 | #include <linux/slab.h> |
| 14 | #include <linux/delay.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/fb.h> |
| 17 | #include <linux/mm.h> |
| 18 | |
| 19 | #include <asm/io.h> |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 20 | #include <asm/prom.h> |
| 21 | #include <asm/of_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <asm/fbio.h> |
| 23 | |
| 24 | #include "sbuslib.h" |
| 25 | |
| 26 | /* |
| 27 | * Local functions. |
| 28 | */ |
| 29 | |
| 30 | static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned, |
| 31 | unsigned, struct fb_info *); |
| 32 | static int p9100_blank(int, struct fb_info *); |
| 33 | |
Christoph Hellwig | 216d526 | 2006-01-14 13:21:25 -0800 | [diff] [blame] | 34 | static int p9100_mmap(struct fb_info *, struct vm_area_struct *); |
Christoph Hellwig | 67a6680 | 2006-01-14 13:21:25 -0800 | [diff] [blame] | 35 | static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * Frame buffer operations |
| 39 | */ |
| 40 | |
| 41 | static struct fb_ops p9100_ops = { |
| 42 | .owner = THIS_MODULE, |
| 43 | .fb_setcolreg = p9100_setcolreg, |
| 44 | .fb_blank = p9100_blank, |
| 45 | .fb_fillrect = cfb_fillrect, |
| 46 | .fb_copyarea = cfb_copyarea, |
| 47 | .fb_imageblit = cfb_imageblit, |
| 48 | .fb_mmap = p9100_mmap, |
| 49 | .fb_ioctl = p9100_ioctl, |
Christoph Hellwig | 9ffb83b | 2005-11-12 12:11:12 -0800 | [diff] [blame] | 50 | #ifdef CONFIG_COMPAT |
| 51 | .fb_compat_ioctl = sbusfb_compat_ioctl, |
| 52 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | /* P9100 control registers */ |
| 56 | #define P9100_SYSCTL_OFF 0x0UL |
| 57 | #define P9100_VIDEOCTL_OFF 0x100UL |
| 58 | #define P9100_VRAMCTL_OFF 0x180UL |
| 59 | #define P9100_RAMDAC_OFF 0x200UL |
| 60 | #define P9100_VIDEOCOPROC_OFF 0x400UL |
| 61 | |
| 62 | /* P9100 command registers */ |
| 63 | #define P9100_CMD_OFF 0x0UL |
| 64 | |
| 65 | /* P9100 framebuffer memory */ |
| 66 | #define P9100_FB_OFF 0x0UL |
| 67 | |
| 68 | /* 3 bits: 2=8bpp 3=16bpp 5=32bpp 7=24bpp */ |
| 69 | #define SYS_CONFIG_PIXELSIZE_SHIFT 26 |
| 70 | |
| 71 | #define SCREENPAINT_TIMECTL1_ENABLE_VIDEO 0x20 /* 0 = off, 1 = on */ |
| 72 | |
| 73 | struct p9100_regs { |
| 74 | /* Registers for the system control */ |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 75 | u32 sys_base; |
| 76 | u32 sys_config; |
| 77 | u32 sys_intr; |
| 78 | u32 sys_int_ena; |
| 79 | u32 sys_alt_rd; |
| 80 | u32 sys_alt_wr; |
| 81 | u32 sys_xxx[58]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | |
| 83 | /* Registers for the video control */ |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 84 | u32 vid_base; |
| 85 | u32 vid_hcnt; |
| 86 | u32 vid_htotal; |
| 87 | u32 vid_hsync_rise; |
| 88 | u32 vid_hblank_rise; |
| 89 | u32 vid_hblank_fall; |
| 90 | u32 vid_hcnt_preload; |
| 91 | u32 vid_vcnt; |
| 92 | u32 vid_vlen; |
| 93 | u32 vid_vsync_rise; |
| 94 | u32 vid_vblank_rise; |
| 95 | u32 vid_vblank_fall; |
| 96 | u32 vid_vcnt_preload; |
| 97 | u32 vid_screenpaint_addr; |
| 98 | u32 vid_screenpaint_timectl1; |
| 99 | u32 vid_screenpaint_qsfcnt; |
| 100 | u32 vid_screenpaint_timectl2; |
| 101 | u32 vid_xxx[15]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | |
| 103 | /* Registers for the video control */ |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 104 | u32 vram_base; |
| 105 | u32 vram_memcfg; |
| 106 | u32 vram_refresh_pd; |
| 107 | u32 vram_refresh_cnt; |
| 108 | u32 vram_raslo_max; |
| 109 | u32 vram_raslo_cur; |
| 110 | u32 pwrup_cfg; |
| 111 | u32 vram_xxx[25]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
| 113 | /* Registers for IBM RGB528 Palette */ |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 114 | u32 ramdac_cmap_wridx; |
| 115 | u32 ramdac_palette_data; |
| 116 | u32 ramdac_pixel_mask; |
| 117 | u32 ramdac_palette_rdaddr; |
| 118 | u32 ramdac_idx_lo; |
| 119 | u32 ramdac_idx_hi; |
| 120 | u32 ramdac_idx_data; |
| 121 | u32 ramdac_idx_ctl; |
| 122 | u32 ramdac_xxx[1784]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | struct p9100_cmd_parameng { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 126 | u32 parameng_status; |
| 127 | u32 parameng_bltcmd; |
| 128 | u32 parameng_quadcmd; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | }; |
| 130 | |
| 131 | struct p9100_par { |
| 132 | spinlock_t lock; |
| 133 | struct p9100_regs __iomem *regs; |
| 134 | |
| 135 | u32 flags; |
| 136 | #define P9100_FLAG_BLANKED 0x00000001 |
| 137 | |
| 138 | unsigned long physbase; |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 139 | unsigned long which_io; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | unsigned long fbsize; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | }; |
| 142 | |
| 143 | /** |
| 144 | * p9100_setcolreg - Optional function. Sets a color register. |
| 145 | * @regno: boolean, 0 copy local, 1 get_user() function |
| 146 | * @red: frame buffer colormap structure |
| 147 | * @green: The green value which can be up to 16 bits wide |
| 148 | * @blue: The blue value which can be up to 16 bits wide. |
| 149 | * @transp: If supported the alpha value which can be up to 16 bits wide. |
| 150 | * @info: frame buffer info structure |
| 151 | */ |
| 152 | static int p9100_setcolreg(unsigned regno, |
| 153 | unsigned red, unsigned green, unsigned blue, |
| 154 | unsigned transp, struct fb_info *info) |
| 155 | { |
| 156 | struct p9100_par *par = (struct p9100_par *) info->par; |
| 157 | struct p9100_regs __iomem *regs = par->regs; |
| 158 | unsigned long flags; |
| 159 | |
| 160 | if (regno >= 256) |
| 161 | return 1; |
| 162 | |
| 163 | red >>= 8; |
| 164 | green >>= 8; |
| 165 | blue >>= 8; |
| 166 | |
| 167 | spin_lock_irqsave(&par->lock, flags); |
| 168 | |
| 169 | sbus_writel((regno << 16), ®s->ramdac_cmap_wridx); |
| 170 | sbus_writel((red << 16), ®s->ramdac_palette_data); |
| 171 | sbus_writel((green << 16), ®s->ramdac_palette_data); |
| 172 | sbus_writel((blue << 16), ®s->ramdac_palette_data); |
| 173 | |
| 174 | spin_unlock_irqrestore(&par->lock, flags); |
| 175 | |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * p9100_blank - Optional function. Blanks the display. |
| 181 | * @blank_mode: the blank mode we want. |
| 182 | * @info: frame buffer structure that represents a single frame buffer |
| 183 | */ |
| 184 | static int |
| 185 | p9100_blank(int blank, struct fb_info *info) |
| 186 | { |
| 187 | struct p9100_par *par = (struct p9100_par *) info->par; |
| 188 | struct p9100_regs __iomem *regs = par->regs; |
| 189 | unsigned long flags; |
| 190 | u32 val; |
| 191 | |
| 192 | spin_lock_irqsave(&par->lock, flags); |
| 193 | |
| 194 | switch (blank) { |
| 195 | case FB_BLANK_UNBLANK: /* Unblanking */ |
| 196 | val = sbus_readl(®s->vid_screenpaint_timectl1); |
| 197 | val |= SCREENPAINT_TIMECTL1_ENABLE_VIDEO; |
| 198 | sbus_writel(val, ®s->vid_screenpaint_timectl1); |
| 199 | par->flags &= ~P9100_FLAG_BLANKED; |
| 200 | break; |
| 201 | |
| 202 | case FB_BLANK_NORMAL: /* Normal blanking */ |
| 203 | case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ |
| 204 | case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ |
| 205 | case FB_BLANK_POWERDOWN: /* Poweroff */ |
| 206 | val = sbus_readl(®s->vid_screenpaint_timectl1); |
| 207 | val &= ~SCREENPAINT_TIMECTL1_ENABLE_VIDEO; |
| 208 | sbus_writel(val, ®s->vid_screenpaint_timectl1); |
| 209 | par->flags |= P9100_FLAG_BLANKED; |
| 210 | break; |
| 211 | } |
| 212 | |
| 213 | spin_unlock_irqrestore(&par->lock, flags); |
| 214 | |
| 215 | return 0; |
| 216 | } |
| 217 | |
| 218 | static struct sbus_mmap_map p9100_mmap_map[] = { |
| 219 | { CG3_MMAP_OFFSET, 0, SBUS_MMAP_FBSIZE(1) }, |
| 220 | { 0, 0, 0 } |
| 221 | }; |
| 222 | |
Christoph Hellwig | 216d526 | 2006-01-14 13:21:25 -0800 | [diff] [blame] | 223 | static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | { |
| 225 | struct p9100_par *par = (struct p9100_par *)info->par; |
| 226 | |
| 227 | return sbusfb_mmap_helper(p9100_mmap_map, |
| 228 | par->physbase, par->fbsize, |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 229 | par->which_io, vma); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | } |
| 231 | |
Christoph Hellwig | 67a6680 | 2006-01-14 13:21:25 -0800 | [diff] [blame] | 232 | static int p9100_ioctl(struct fb_info *info, unsigned int cmd, |
| 233 | unsigned long arg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | { |
| 235 | struct p9100_par *par = (struct p9100_par *) info->par; |
| 236 | |
| 237 | /* Make it look like a cg3. */ |
| 238 | return sbusfb_ioctl_helper(cmd, arg, info, |
| 239 | FBTYPE_SUN3COLOR, 8, par->fbsize); |
| 240 | } |
| 241 | |
| 242 | /* |
| 243 | * Initialisation |
| 244 | */ |
| 245 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 246 | static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 248 | strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | |
| 250 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 251 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
| 252 | |
| 253 | info->fix.line_length = linebytes; |
| 254 | |
| 255 | info->fix.accel = FB_ACCEL_SUN_CGTHREE; |
| 256 | } |
| 257 | |
| 258 | struct all_info { |
| 259 | struct fb_info info; |
| 260 | struct p9100_par par; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 263 | static int __devinit p9100_init_one(struct of_device *op) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 265 | struct device_node *dp = op->node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | struct all_info *all; |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 267 | int linebytes, err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 269 | all = kzalloc(sizeof(*all), GFP_KERNEL); |
| 270 | if (!all) |
| 271 | return -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | |
| 273 | spin_lock_init(&all->par.lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | |
| 275 | /* This is the framebuffer and the only resource apps can mmap. */ |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 276 | all->par.physbase = op->resource[2].start; |
| 277 | all->par.which_io = op->resource[2].flags & IORESOURCE_BITS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 279 | sbusfb_fill_var(&all->info.var, dp->node, 8); |
Tom 'spot' Callaway | d85c355 | 2005-10-07 13:05:56 -0700 | [diff] [blame] | 280 | all->info.var.red.length = 8; |
| 281 | all->info.var.green.length = 8; |
| 282 | all->info.var.blue.length = 8; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 284 | linebytes = of_getintprop_default(dp, "linebytes", |
| 285 | all->info.var.xres); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); |
| 287 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 288 | all->par.regs = of_ioremap(&op->resource[0], 0, |
| 289 | sizeof(struct p9100_regs), "p9100 regs"); |
| 290 | if (!all->par.regs) { |
| 291 | kfree(all); |
| 292 | return -ENOMEM; |
| 293 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | |
| 295 | all->info.flags = FBINFO_DEFAULT; |
| 296 | all->info.fbops = &p9100_ops; |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 297 | all->info.screen_base = of_ioremap(&op->resource[2], 0, |
| 298 | all->par.fbsize, "p9100 ram"); |
| 299 | if (!all->info.screen_base) { |
| 300 | of_iounmap(all->par.regs, sizeof(struct p9100_regs)); |
| 301 | kfree(all); |
| 302 | return -ENOMEM; |
| 303 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | all->info.par = &all->par; |
| 305 | |
| 306 | p9100_blank(0, &all->info); |
| 307 | |
| 308 | if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 309 | of_iounmap(all->par.regs, sizeof(struct p9100_regs)); |
| 310 | of_iounmap(all->info.screen_base, all->par.fbsize); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | kfree(all); |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 312 | return -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | } |
| 314 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 315 | p9100_init_fix(&all->info, linebytes, dp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 317 | err = register_framebuffer(&all->info); |
| 318 | if (err < 0) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | fb_dealloc_cmap(&all->info.cmap); |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 320 | of_iounmap(all->par.regs, sizeof(struct p9100_regs)); |
| 321 | of_iounmap(all->info.screen_base, all->par.fbsize); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | kfree(all); |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 323 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | } |
Tom 'spot' Callaway | d85c355 | 2005-10-07 13:05:56 -0700 | [diff] [blame] | 325 | fb_set_cmap(&all->info.cmap, &all->info); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 327 | dev_set_drvdata(&op->dev, all); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 329 | printk("%s: p9100 at %lx:%lx\n", |
| 330 | dp->full_name, |
| 331 | all->par.which_io, all->par.physbase); |
| 332 | |
| 333 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 334 | } |
| 335 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 336 | static int __devinit p9100_probe(struct of_device *dev, const struct of_device_id *match) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 338 | struct of_device *op = to_of_device(&dev->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 340 | return p9100_init_one(op); |
| 341 | } |
| 342 | |
| 343 | static int __devexit p9100_remove(struct of_device *dev) |
| 344 | { |
| 345 | struct all_info *all = dev_get_drvdata(&dev->dev); |
| 346 | |
| 347 | unregister_framebuffer(&all->info); |
| 348 | fb_dealloc_cmap(&all->info.cmap); |
| 349 | |
| 350 | of_iounmap(all->par.regs, sizeof(struct p9100_regs)); |
| 351 | of_iounmap(all->info.screen_base, all->par.fbsize); |
| 352 | |
| 353 | kfree(all); |
| 354 | |
| 355 | dev_set_drvdata(&dev->dev, NULL); |
| 356 | |
| 357 | return 0; |
| 358 | } |
| 359 | |
| 360 | static struct of_device_id p9100_match[] = { |
| 361 | { |
| 362 | .name = "p9100", |
| 363 | }, |
| 364 | {}, |
| 365 | }; |
| 366 | MODULE_DEVICE_TABLE(of, p9100_match); |
| 367 | |
| 368 | static struct of_platform_driver p9100_driver = { |
| 369 | .name = "p9100", |
| 370 | .match_table = p9100_match, |
| 371 | .probe = p9100_probe, |
| 372 | .remove = __devexit_p(p9100_remove), |
| 373 | }; |
| 374 | |
| 375 | static int __init p9100_init(void) |
| 376 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | if (fb_get_options("p9100fb", NULL)) |
| 378 | return -ENODEV; |
| 379 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 380 | return of_register_driver(&p9100_driver, &of_bus_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | } |
| 382 | |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 383 | static void __exit p9100_exit(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 384 | { |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 385 | of_unregister_driver(&p9100_driver); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | module_init(p9100_init); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 389 | module_exit(p9100_exit); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | |
| 391 | MODULE_DESCRIPTION("framebuffer driver for P9100 chipsets"); |
David S. Miller | 50312ce | 2006-06-29 14:35:52 -0700 | [diff] [blame] | 392 | MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); |
| 393 | MODULE_VERSION("2.0"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | MODULE_LICENSE("GPL"); |