diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-06-16 18:34:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:48:00 -0400 |
commit | fe3a1aa239a74bcbf25211aab33b6ecc80acf0f9 (patch) | |
tree | a871d7de247d8ea1bdefdeb1f379a3d7ac700dee | |
parent | 4410f3910947dcea8672280b3adecd53cec4e85e (diff) |
tcx: 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>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/tcx.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c index 643afbfe8277..45b883598bf0 100644 --- a/drivers/video/tcx.c +++ b/drivers/video/tcx.c | |||
@@ -116,17 +116,16 @@ struct tcx_par { | |||
116 | u32 flags; | 116 | u32 flags; |
117 | #define TCX_FLAG_BLANKED 0x00000001 | 117 | #define TCX_FLAG_BLANKED 0x00000001 |
118 | 118 | ||
119 | unsigned long physbase; | ||
120 | unsigned long which_io; | 119 | unsigned long which_io; |
121 | unsigned long fbsize; | ||
122 | 120 | ||
123 | struct sbus_mmap_map mmap_map[TCX_MMAP_ENTRIES]; | 121 | struct sbus_mmap_map mmap_map[TCX_MMAP_ENTRIES]; |
124 | int lowdepth; | 122 | int lowdepth; |
125 | }; | 123 | }; |
126 | 124 | ||
127 | /* Reset control plane so that WID is 8-bit plane. */ | 125 | /* Reset control plane so that WID is 8-bit plane. */ |
128 | static void __tcx_set_control_plane(struct tcx_par *par) | 126 | static void __tcx_set_control_plane(struct fb_info *info) |
129 | { | 127 | { |
128 | struct tcx_par *par = info->par; | ||
130 | u32 __iomem *p, *pend; | 129 | u32 __iomem *p, *pend; |
131 | 130 | ||
132 | if (par->lowdepth) | 131 | if (par->lowdepth) |
@@ -135,7 +134,7 @@ static void __tcx_set_control_plane(struct tcx_par *par) | |||
135 | p = par->cplane; | 134 | p = par->cplane; |
136 | if (p == NULL) | 135 | if (p == NULL) |
137 | return; | 136 | return; |
138 | for (pend = p + par->fbsize; p < pend; p++) { | 137 | for (pend = p + info->fix.smem_len; p < pend; p++) { |
139 | u32 tmp = sbus_readl(p); | 138 | u32 tmp = sbus_readl(p); |
140 | 139 | ||
141 | tmp &= 0xffffff; | 140 | tmp &= 0xffffff; |
@@ -149,7 +148,7 @@ static void tcx_reset(struct fb_info *info) | |||
149 | unsigned long flags; | 148 | unsigned long flags; |
150 | 149 | ||
151 | spin_lock_irqsave(&par->lock, flags); | 150 | spin_lock_irqsave(&par->lock, flags); |
152 | __tcx_set_control_plane(par); | 151 | __tcx_set_control_plane(info); |
153 | spin_unlock_irqrestore(&par->lock, flags); | 152 | spin_unlock_irqrestore(&par->lock, flags); |
154 | } | 153 | } |
155 | 154 | ||
@@ -304,7 +303,7 @@ static int tcx_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
304 | struct tcx_par *par = (struct tcx_par *)info->par; | 303 | struct tcx_par *par = (struct tcx_par *)info->par; |
305 | 304 | ||
306 | return sbusfb_mmap_helper(par->mmap_map, | 305 | return sbusfb_mmap_helper(par->mmap_map, |
307 | par->physbase, par->fbsize, | 306 | info->fix.smem_start, info->fix.smem_len, |
308 | par->which_io, vma); | 307 | par->which_io, vma); |
309 | } | 308 | } |
310 | 309 | ||
@@ -316,7 +315,7 @@ static int tcx_ioctl(struct fb_info *info, unsigned int cmd, | |||
316 | return sbusfb_ioctl_helper(cmd, arg, info, | 315 | return sbusfb_ioctl_helper(cmd, arg, info, |
317 | FBTYPE_TCXCOLOR, | 316 | FBTYPE_TCXCOLOR, |
318 | (par->lowdepth ? 8 : 24), | 317 | (par->lowdepth ? 8 : 24), |
319 | par->fbsize); | 318 | info->fix.smem_len); |
320 | } | 319 | } |
321 | 320 | ||
322 | /* | 321 | /* |
@@ -358,10 +357,10 @@ static void tcx_unmap_regs(struct of_device *op, struct fb_info *info, | |||
358 | par->bt, sizeof(struct bt_regs)); | 357 | par->bt, sizeof(struct bt_regs)); |
359 | if (par->cplane) | 358 | if (par->cplane) |
360 | of_iounmap(&op->resource[4], | 359 | of_iounmap(&op->resource[4], |
361 | par->cplane, par->fbsize * sizeof(u32)); | 360 | par->cplane, info->fix.smem_len * sizeof(u32)); |
362 | if (info->screen_base) | 361 | if (info->screen_base) |
363 | of_iounmap(&op->resource[0], | 362 | of_iounmap(&op->resource[0], |
364 | info->screen_base, par->fbsize); | 363 | info->screen_base, info->fix.smem_len); |
365 | } | 364 | } |
366 | 365 | ||
367 | static int __devinit tcx_probe(struct of_device *op, | 366 | static int __devinit tcx_probe(struct of_device *op, |
@@ -391,7 +390,7 @@ static int __devinit tcx_probe(struct of_device *op, | |||
391 | 390 | ||
392 | linebytes = of_getintprop_default(dp, "linebytes", | 391 | linebytes = of_getintprop_default(dp, "linebytes", |
393 | info->var.xres); | 392 | info->var.xres); |
394 | par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); | 393 | info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); |
395 | 394 | ||
396 | par->tec = of_ioremap(&op->resource[7], 0, | 395 | par->tec = of_ioremap(&op->resource[7], 0, |
397 | sizeof(struct tcx_tec), "tcx tec"); | 396 | sizeof(struct tcx_tec), "tcx tec"); |
@@ -400,7 +399,7 @@ static int __devinit tcx_probe(struct of_device *op, | |||
400 | par->bt = of_ioremap(&op->resource[8], 0, | 399 | par->bt = of_ioremap(&op->resource[8], 0, |
401 | sizeof(struct bt_regs), "tcx dac"); | 400 | sizeof(struct bt_regs), "tcx dac"); |
402 | info->screen_base = of_ioremap(&op->resource[0], 0, | 401 | info->screen_base = of_ioremap(&op->resource[0], 0, |
403 | par->fbsize, "tcx ram"); | 402 | info->fix.smem_len, "tcx ram"); |
404 | if (!par->tec || !par->thc || | 403 | if (!par->tec || !par->thc || |
405 | !par->bt || !info->screen_base) | 404 | !par->bt || !info->screen_base) |
406 | goto out_unmap_regs; | 405 | goto out_unmap_regs; |
@@ -408,7 +407,7 @@ static int __devinit tcx_probe(struct of_device *op, | |||
408 | memcpy(&par->mmap_map, &__tcx_mmap_map, sizeof(par->mmap_map)); | 407 | memcpy(&par->mmap_map, &__tcx_mmap_map, sizeof(par->mmap_map)); |
409 | if (!par->lowdepth) { | 408 | if (!par->lowdepth) { |
410 | par->cplane = of_ioremap(&op->resource[4], 0, | 409 | par->cplane = of_ioremap(&op->resource[4], 0, |
411 | par->fbsize * sizeof(u32), | 410 | info->fix.smem_len * sizeof(u32), |
412 | "tcx cplane"); | 411 | "tcx cplane"); |
413 | if (!par->cplane) | 412 | if (!par->cplane) |
414 | goto out_unmap_regs; | 413 | goto out_unmap_regs; |
@@ -419,7 +418,7 @@ static int __devinit tcx_probe(struct of_device *op, | |||
419 | par->mmap_map[6].size = SBUS_MMAP_EMPTY; | 418 | par->mmap_map[6].size = SBUS_MMAP_EMPTY; |
420 | } | 419 | } |
421 | 420 | ||
422 | par->physbase = op->resource[0].start; | 421 | info->fix.smem_start = op->resource[0].start; |
423 | par->which_io = op->resource[0].flags & IORESOURCE_BITS; | 422 | par->which_io = op->resource[0].flags & IORESOURCE_BITS; |
424 | 423 | ||
425 | for (i = 0; i < TCX_MMAP_ENTRIES; i++) { | 424 | for (i = 0; i < TCX_MMAP_ENTRIES; i++) { |
@@ -473,7 +472,7 @@ static int __devinit tcx_probe(struct of_device *op, | |||
473 | printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n", | 472 | printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n", |
474 | dp->full_name, | 473 | dp->full_name, |
475 | par->which_io, | 474 | par->which_io, |
476 | par->physbase, | 475 | info->fix.smem_start, |
477 | par->lowdepth ? "8-bit only" : "24-bit depth"); | 476 | par->lowdepth ? "8-bit only" : "24-bit depth"); |
478 | 477 | ||
479 | return 0; | 478 | return 0; |