aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-05-04 06:39:45 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-16 07:56:35 -0400
commit963b916c1cb42450c7a061b13fcce6c9a2cdea28 (patch)
tree6e7ae4c58a4781c49ea11383d2c47897cce7a602 /drivers
parent9fbfd4b8a4d8c097bcb0efd14a84a6869c0ac4d5 (diff)
cg6: 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 are displayed correctly. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/cg6.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 940ec04f0f1b..0d47c6030e3d 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -263,9 +263,7 @@ struct cg6_par {
263 u32 flags; 263 u32 flags;
264#define CG6_FLAG_BLANKED 0x00000001 264#define CG6_FLAG_BLANKED 0x00000001
265 265
266 unsigned long physbase;
267 unsigned long which_io; 266 unsigned long which_io;
268 unsigned long fbsize;
269}; 267};
270 268
271static int cg6_sync(struct fb_info *info) 269static int cg6_sync(struct fb_info *info)
@@ -596,16 +594,14 @@ static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma)
596 struct cg6_par *par = (struct cg6_par *)info->par; 594 struct cg6_par *par = (struct cg6_par *)info->par;
597 595
598 return sbusfb_mmap_helper(cg6_mmap_map, 596 return sbusfb_mmap_helper(cg6_mmap_map,
599 par->physbase, par->fbsize, 597 info->fix.smem_start, info->fix.smem_len,
600 par->which_io, vma); 598 par->which_io, vma);
601} 599}
602 600
603static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 601static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
604{ 602{
605 struct cg6_par *par = (struct cg6_par *)info->par;
606
607 return sbusfb_ioctl_helper(cmd, arg, info, 603 return sbusfb_ioctl_helper(cmd, arg, info,
608 FBTYPE_SUNFAST_COLOR, 8, par->fbsize); 604 FBTYPE_SUNFAST_COLOR, 8, info->fix.smem_len);
609} 605}
610 606
611/* 607/*
@@ -631,12 +627,12 @@ static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
631 break; 627 break;
632 }; 628 };
633 if (((conf >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK) >= 11) { 629 if (((conf >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK) >= 11) {
634 if (par->fbsize <= 0x100000) 630 if (info->fix.smem_len <= 0x100000)
635 cg6_card_name = "TGX"; 631 cg6_card_name = "TGX";
636 else 632 else
637 cg6_card_name = "TGX+"; 633 cg6_card_name = "TGX+";
638 } else { 634 } else {
639 if (par->fbsize <= 0x100000) 635 if (info->fix.smem_len <= 0x100000)
640 cg6_card_name = "GX"; 636 cg6_card_name = "GX";
641 else 637 else
642 cg6_card_name = "GX+"; 638 cg6_card_name = "GX+";
@@ -738,7 +734,8 @@ static void cg6_unmap_regs(struct of_device *op, struct fb_info *info,
738 of_iounmap(&op->resource[0], par->fhc, sizeof(u32)); 734 of_iounmap(&op->resource[0], par->fhc, sizeof(u32));
739 735
740 if (info->screen_base) 736 if (info->screen_base)
741 of_iounmap(&op->resource[0], info->screen_base, par->fbsize); 737 of_iounmap(&op->resource[0], info->screen_base,
738 info->fix.smem_len);
742} 739}
743 740
744static int __devinit cg6_probe(struct of_device *op, 741static int __devinit cg6_probe(struct of_device *op,
@@ -759,7 +756,7 @@ static int __devinit cg6_probe(struct of_device *op,
759 756
760 spin_lock_init(&par->lock); 757 spin_lock_init(&par->lock);
761 758
762 par->physbase = op->resource[0].start; 759 info->fix.smem_start = op->resource[0].start;
763 par->which_io = op->resource[0].flags & IORESOURCE_BITS; 760 par->which_io = op->resource[0].flags & IORESOURCE_BITS;
764 761
765 sbusfb_fill_var(&info->var, dp, 8); 762 sbusfb_fill_var(&info->var, dp, 8);
@@ -769,11 +766,11 @@ static int __devinit cg6_probe(struct of_device *op,
769 766
770 linebytes = of_getintprop_default(dp, "linebytes", 767 linebytes = of_getintprop_default(dp, "linebytes",
771 info->var.xres); 768 info->var.xres);
772 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); 769 info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
773 770
774 dblbuf = of_getintprop_default(dp, "dblbuf", 0); 771 dblbuf = of_getintprop_default(dp, "dblbuf", 0);
775 if (dblbuf) 772 if (dblbuf)
776 par->fbsize *= 4; 773 info->fix.smem_len *= 4;
777 774
778 par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET, 775 par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET,
779 4096, "cgsix fbc"); 776 4096, "cgsix fbc");
@@ -792,7 +789,7 @@ static int __devinit cg6_probe(struct of_device *op,
792 info->fbops = &cg6_ops; 789 info->fbops = &cg6_ops;
793 790
794 info->screen_base = of_ioremap(&op->resource[0], CG6_RAM_OFFSET, 791 info->screen_base = of_ioremap(&op->resource[0], CG6_RAM_OFFSET,
795 par->fbsize, "cgsix ram"); 792 info->fix.smem_len, "cgsix ram");
796 if (!par->fbc || !par->tec || !par->thc || 793 if (!par->fbc || !par->tec || !par->thc ||
797 !par->bt || !par->fhc || !info->screen_base) 794 !par->bt || !par->fhc || !info->screen_base)
798 goto out_unmap_regs; 795 goto out_unmap_regs;
@@ -817,7 +814,7 @@ static int __devinit cg6_probe(struct of_device *op,
817 814
818 printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n", 815 printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n",
819 dp->full_name, info->fix.id, 816 dp->full_name, info->fix.id,
820 par->which_io, par->physbase); 817 par->which_io, info->fix.smem_start);
821 818
822 return 0; 819 return 0;
823 820