diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-05-04 06:37:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-16 07:56:34 -0400 |
commit | 9fbfd4b8a4d8c097bcb0efd14a84a6869c0ac4d5 (patch) | |
tree | e1d6fceaac8a103f1bbd76424f0f2ab1ed0053f7 /drivers/video/cg3.c | |
parent | de4dc48ee26ccc9dbc6a86b0710f7fd408149056 (diff) |
cg3: use standard fields for framebuffer physical address and length
Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len
for physical address and length of framebuffer.
This also fixes output of the 'fbset -i' command - address and length
of the framebuffer is displayed correctly.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video/cg3.c')
-rw-r--r-- | drivers/video/cg3.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index 99f87fb61d05..b2319fa7286f 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c | |||
@@ -118,9 +118,7 @@ struct cg3_par { | |||
118 | #define CG3_FLAG_BLANKED 0x00000001 | 118 | #define CG3_FLAG_BLANKED 0x00000001 |
119 | #define CG3_FLAG_RDI 0x00000002 | 119 | #define CG3_FLAG_RDI 0x00000002 |
120 | 120 | ||
121 | unsigned long physbase; | ||
122 | unsigned long which_io; | 121 | unsigned long which_io; |
123 | unsigned long fbsize; | ||
124 | }; | 122 | }; |
125 | 123 | ||
126 | /** | 124 | /** |
@@ -231,17 +229,15 @@ static int cg3_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
231 | struct cg3_par *par = (struct cg3_par *)info->par; | 229 | struct cg3_par *par = (struct cg3_par *)info->par; |
232 | 230 | ||
233 | return sbusfb_mmap_helper(cg3_mmap_map, | 231 | return sbusfb_mmap_helper(cg3_mmap_map, |
234 | par->physbase, par->fbsize, | 232 | info->fix.smem_start, info->fix.smem_len, |
235 | par->which_io, | 233 | par->which_io, |
236 | vma); | 234 | vma); |
237 | } | 235 | } |
238 | 236 | ||
239 | static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | 237 | static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) |
240 | { | 238 | { |
241 | struct cg3_par *par = (struct cg3_par *) info->par; | ||
242 | |||
243 | return sbusfb_ioctl_helper(cmd, arg, info, | 239 | return sbusfb_ioctl_helper(cmd, arg, info, |
244 | FBTYPE_SUN3COLOR, 8, par->fbsize); | 240 | FBTYPE_SUN3COLOR, 8, info->fix.smem_len); |
245 | } | 241 | } |
246 | 242 | ||
247 | /* | 243 | /* |
@@ -368,7 +364,7 @@ static int __devinit cg3_probe(struct of_device *op, | |||
368 | 364 | ||
369 | spin_lock_init(&par->lock); | 365 | spin_lock_init(&par->lock); |
370 | 366 | ||
371 | par->physbase = op->resource[0].start; | 367 | info->fix.smem_start = op->resource[0].start; |
372 | par->which_io = op->resource[0].flags & IORESOURCE_BITS; | 368 | par->which_io = op->resource[0].flags & IORESOURCE_BITS; |
373 | 369 | ||
374 | sbusfb_fill_var(&info->var, dp, 8); | 370 | sbusfb_fill_var(&info->var, dp, 8); |
@@ -382,7 +378,7 @@ static int __devinit cg3_probe(struct of_device *op, | |||
382 | 378 | ||
383 | linebytes = of_getintprop_default(dp, "linebytes", | 379 | linebytes = of_getintprop_default(dp, "linebytes", |
384 | info->var.xres); | 380 | info->var.xres); |
385 | par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); | 381 | info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); |
386 | 382 | ||
387 | par->regs = of_ioremap(&op->resource[0], CG3_REGS_OFFSET, | 383 | par->regs = of_ioremap(&op->resource[0], CG3_REGS_OFFSET, |
388 | sizeof(struct cg3_regs), "cg3 regs"); | 384 | sizeof(struct cg3_regs), "cg3 regs"); |
@@ -392,7 +388,7 @@ static int __devinit cg3_probe(struct of_device *op, | |||
392 | info->flags = FBINFO_DEFAULT; | 388 | info->flags = FBINFO_DEFAULT; |
393 | info->fbops = &cg3_ops; | 389 | info->fbops = &cg3_ops; |
394 | info->screen_base = of_ioremap(&op->resource[0], CG3_RAM_OFFSET, | 390 | info->screen_base = of_ioremap(&op->resource[0], CG3_RAM_OFFSET, |
395 | par->fbsize, "cg3 ram"); | 391 | info->fix.smem_len, "cg3 ram"); |
396 | if (!info->screen_base) | 392 | if (!info->screen_base) |
397 | goto out_unmap_regs; | 393 | goto out_unmap_regs; |
398 | 394 | ||
@@ -418,7 +414,7 @@ static int __devinit cg3_probe(struct of_device *op, | |||
418 | dev_set_drvdata(&op->dev, info); | 414 | dev_set_drvdata(&op->dev, info); |
419 | 415 | ||
420 | printk(KERN_INFO "%s: cg3 at %lx:%lx\n", | 416 | printk(KERN_INFO "%s: cg3 at %lx:%lx\n", |
421 | dp->full_name, par->which_io, par->physbase); | 417 | dp->full_name, par->which_io, info->fix.smem_start); |
422 | 418 | ||
423 | return 0; | 419 | return 0; |
424 | 420 | ||
@@ -426,7 +422,7 @@ out_dealloc_cmap: | |||
426 | fb_dealloc_cmap(&info->cmap); | 422 | fb_dealloc_cmap(&info->cmap); |
427 | 423 | ||
428 | out_unmap_screen: | 424 | out_unmap_screen: |
429 | of_iounmap(&op->resource[0], info->screen_base, par->fbsize); | 425 | of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); |
430 | 426 | ||
431 | out_unmap_regs: | 427 | out_unmap_regs: |
432 | of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); | 428 | of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); |
@@ -447,7 +443,7 @@ static int __devexit cg3_remove(struct of_device *op) | |||
447 | fb_dealloc_cmap(&info->cmap); | 443 | fb_dealloc_cmap(&info->cmap); |
448 | 444 | ||
449 | of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); | 445 | of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs)); |
450 | of_iounmap(&op->resource[0], info->screen_base, par->fbsize); | 446 | of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); |
451 | 447 | ||
452 | framebuffer_release(info); | 448 | framebuffer_release(info); |
453 | 449 | ||