aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cg14.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-05-04 06:36:50 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-16 07:56:31 -0400
commitde4dc48ee26ccc9dbc6a86b0710f7fd408149056 (patch)
tree54170edf9672fce7941b13775da1e229f06e0ed0 /drivers/video/cg14.c
parent3f06cd29358dd390d62afcde14fde54cec9deef9 (diff)
cg14: 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/cg14.c')
-rw-r--r--drivers/video/cg14.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index a2d1882791a5..fe45a3b8d0e0 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -196,9 +196,7 @@ struct cg14_par {
196 u32 flags; 196 u32 flags;
197#define CG14_FLAG_BLANKED 0x00000001 197#define CG14_FLAG_BLANKED 0x00000001
198 198
199 unsigned long physbase;
200 unsigned long iospace; 199 unsigned long iospace;
201 unsigned long fbsize;
202 200
203 struct sbus_mmap_map mmap_map[CG14_MMAP_ENTRIES]; 201 struct sbus_mmap_map mmap_map[CG14_MMAP_ENTRIES];
204 202
@@ -271,7 +269,7 @@ static int cg14_mmap(struct fb_info *info, struct vm_area_struct *vma)
271 struct cg14_par *par = (struct cg14_par *) info->par; 269 struct cg14_par *par = (struct cg14_par *) info->par;
272 270
273 return sbusfb_mmap_helper(par->mmap_map, 271 return sbusfb_mmap_helper(par->mmap_map,
274 par->physbase, par->fbsize, 272 info->fix.smem_start, info->fix.smem_len,
275 par->iospace, vma); 273 par->iospace, vma);
276} 274}
277 275
@@ -343,7 +341,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
343 341
344 default: 342 default:
345 ret = sbusfb_ioctl_helper(cmd, arg, info, 343 ret = sbusfb_ioctl_helper(cmd, arg, info,
346 FBTYPE_MDICOLOR, 8, par->fbsize); 344 FBTYPE_MDICOLOR, 8,
345 info->fix.smem_len);
347 break; 346 break;
348 }; 347 };
349 348
@@ -462,7 +461,7 @@ static void cg14_unmap_regs(struct of_device *op, struct fb_info *info,
462 par->cursor, sizeof(struct cg14_cursor)); 461 par->cursor, sizeof(struct cg14_cursor));
463 if (info->screen_base) 462 if (info->screen_base)
464 of_iounmap(&op->resource[1], 463 of_iounmap(&op->resource[1],
465 info->screen_base, par->fbsize); 464 info->screen_base, info->fix.smem_len);
466} 465}
467 466
468static int __devinit cg14_probe(struct of_device *op, const struct of_device_id *match) 467static int __devinit cg14_probe(struct of_device *op, const struct of_device_id *match)
@@ -488,14 +487,14 @@ static int __devinit cg14_probe(struct of_device *op, const struct of_device_id
488 487
489 linebytes = of_getintprop_default(dp, "linebytes", 488 linebytes = of_getintprop_default(dp, "linebytes",
490 info->var.xres); 489 info->var.xres);
491 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); 490 info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
492 491
493 if (!strcmp(dp->parent->name, "sbus") || 492 if (!strcmp(dp->parent->name, "sbus") ||
494 !strcmp(dp->parent->name, "sbi")) { 493 !strcmp(dp->parent->name, "sbi")) {
495 par->physbase = op->resource[0].start; 494 info->fix.smem_start = op->resource[0].start;
496 par->iospace = op->resource[0].flags & IORESOURCE_BITS; 495 par->iospace = op->resource[0].flags & IORESOURCE_BITS;
497 } else { 496 } else {
498 par->physbase = op->resource[1].start; 497 info->fix.smem_start = op->resource[1].start;
499 par->iospace = op->resource[0].flags & IORESOURCE_BITS; 498 par->iospace = op->resource[0].flags & IORESOURCE_BITS;
500 } 499 }
501 500
@@ -507,7 +506,7 @@ static int __devinit cg14_probe(struct of_device *op, const struct of_device_id
507 sizeof(struct cg14_cursor), "cg14 cursor"); 506 sizeof(struct cg14_cursor), "cg14 cursor");
508 507
509 info->screen_base = of_ioremap(&op->resource[1], 0, 508 info->screen_base = of_ioremap(&op->resource[1], 0,
510 par->fbsize, "cg14 ram"); 509 info->fix.smem_len, "cg14 ram");
511 510
512 if (!par->regs || !par->clut || !par->cursor || !info->screen_base) 511 if (!par->regs || !par->clut || !par->cursor || !info->screen_base)
513 goto out_unmap_regs; 512 goto out_unmap_regs;
@@ -557,7 +556,7 @@ static int __devinit cg14_probe(struct of_device *op, const struct of_device_id
557 556
558 printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n", 557 printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n",
559 dp->full_name, 558 dp->full_name,
560 par->iospace, par->physbase, 559 par->iospace, info->fix.smem_start,
561 par->ramsize >> 20); 560 par->ramsize >> 20);
562 561
563 return 0; 562 return 0;