diff options
| author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-05-04 06:42:57 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-06-16 07:56:38 -0400 |
| commit | 0d76cb2606cbb2e21f3832773458bb0241f99c6d (patch) | |
| tree | 4cd0e32a062b87de1b66dbd9868f86bd87ac23b0 | |
| parent | 8803f7afe6370af8cd97991bde0c3b53eca4e8da (diff) | |
p9100: 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>
| -rw-r--r-- | drivers/video/p9100.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c index 7000f2cd5854..7fa4ab01b0d3 100644 --- a/drivers/video/p9100.c +++ b/drivers/video/p9100.c | |||
| @@ -134,9 +134,7 @@ struct p9100_par { | |||
| 134 | u32 flags; | 134 | u32 flags; |
| 135 | #define P9100_FLAG_BLANKED 0x00000001 | 135 | #define P9100_FLAG_BLANKED 0x00000001 |
| 136 | 136 | ||
| 137 | unsigned long physbase; | ||
| 138 | unsigned long which_io; | 137 | unsigned long which_io; |
| 139 | unsigned long fbsize; | ||
| 140 | }; | 138 | }; |
| 141 | 139 | ||
| 142 | /** | 140 | /** |
| @@ -224,18 +222,16 @@ static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
| 224 | struct p9100_par *par = (struct p9100_par *)info->par; | 222 | struct p9100_par *par = (struct p9100_par *)info->par; |
| 225 | 223 | ||
| 226 | return sbusfb_mmap_helper(p9100_mmap_map, | 224 | return sbusfb_mmap_helper(p9100_mmap_map, |
| 227 | par->physbase, par->fbsize, | 225 | info->fix.smem_start, info->fix.smem_len, |
| 228 | par->which_io, vma); | 226 | par->which_io, vma); |
| 229 | } | 227 | } |
| 230 | 228 | ||
| 231 | static int p9100_ioctl(struct fb_info *info, unsigned int cmd, | 229 | static int p9100_ioctl(struct fb_info *info, unsigned int cmd, |
| 232 | unsigned long arg) | 230 | unsigned long arg) |
| 233 | { | 231 | { |
| 234 | struct p9100_par *par = (struct p9100_par *) info->par; | ||
| 235 | |||
| 236 | /* Make it look like a cg3. */ | 232 | /* Make it look like a cg3. */ |
| 237 | return sbusfb_ioctl_helper(cmd, arg, info, | 233 | return sbusfb_ioctl_helper(cmd, arg, info, |
| 238 | FBTYPE_SUN3COLOR, 8, par->fbsize); | 234 | FBTYPE_SUN3COLOR, 8, info->fix.smem_len); |
| 239 | } | 235 | } |
| 240 | 236 | ||
| 241 | /* | 237 | /* |
| @@ -271,7 +267,7 @@ static int __devinit p9100_probe(struct of_device *op, const struct of_device_id | |||
| 271 | spin_lock_init(&par->lock); | 267 | spin_lock_init(&par->lock); |
| 272 | 268 | ||
| 273 | /* This is the framebuffer and the only resource apps can mmap. */ | 269 | /* This is the framebuffer and the only resource apps can mmap. */ |
| 274 | par->physbase = op->resource[2].start; | 270 | info->fix.smem_start = op->resource[2].start; |
| 275 | par->which_io = op->resource[2].flags & IORESOURCE_BITS; | 271 | par->which_io = op->resource[2].flags & IORESOURCE_BITS; |
| 276 | 272 | ||
| 277 | sbusfb_fill_var(&info->var, dp, 8); | 273 | sbusfb_fill_var(&info->var, dp, 8); |
| @@ -280,7 +276,7 @@ static int __devinit p9100_probe(struct of_device *op, const struct of_device_id | |||
| 280 | info->var.blue.length = 8; | 276 | info->var.blue.length = 8; |
| 281 | 277 | ||
| 282 | linebytes = of_getintprop_default(dp, "linebytes", info->var.xres); | 278 | linebytes = of_getintprop_default(dp, "linebytes", info->var.xres); |
| 283 | par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); | 279 | info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); |
| 284 | 280 | ||
| 285 | par->regs = of_ioremap(&op->resource[0], 0, | 281 | par->regs = of_ioremap(&op->resource[0], 0, |
| 286 | sizeof(struct p9100_regs), "p9100 regs"); | 282 | sizeof(struct p9100_regs), "p9100 regs"); |
| @@ -290,7 +286,7 @@ static int __devinit p9100_probe(struct of_device *op, const struct of_device_id | |||
| 290 | info->flags = FBINFO_DEFAULT; | 286 | info->flags = FBINFO_DEFAULT; |
| 291 | info->fbops = &p9100_ops; | 287 | info->fbops = &p9100_ops; |
| 292 | info->screen_base = of_ioremap(&op->resource[2], 0, | 288 | info->screen_base = of_ioremap(&op->resource[2], 0, |
| 293 | par->fbsize, "p9100 ram"); | 289 | info->fix.smem_len, "p9100 ram"); |
| 294 | if (!info->screen_base) | 290 | if (!info->screen_base) |
| 295 | goto out_unmap_regs; | 291 | goto out_unmap_regs; |
| 296 | 292 | ||
| @@ -311,7 +307,7 @@ static int __devinit p9100_probe(struct of_device *op, const struct of_device_id | |||
| 311 | 307 | ||
| 312 | printk(KERN_INFO "%s: p9100 at %lx:%lx\n", | 308 | printk(KERN_INFO "%s: p9100 at %lx:%lx\n", |
| 313 | dp->full_name, | 309 | dp->full_name, |
| 314 | par->which_io, par->physbase); | 310 | par->which_io, info->fix.smem_start); |
| 315 | 311 | ||
| 316 | return 0; | 312 | return 0; |
| 317 | 313 | ||
| @@ -319,7 +315,7 @@ out_dealloc_cmap: | |||
| 319 | fb_dealloc_cmap(&info->cmap); | 315 | fb_dealloc_cmap(&info->cmap); |
| 320 | 316 | ||
| 321 | out_unmap_screen: | 317 | out_unmap_screen: |
| 322 | of_iounmap(&op->resource[2], info->screen_base, par->fbsize); | 318 | of_iounmap(&op->resource[2], info->screen_base, info->fix.smem_len); |
| 323 | 319 | ||
| 324 | out_unmap_regs: | 320 | out_unmap_regs: |
| 325 | of_iounmap(&op->resource[0], par->regs, sizeof(struct p9100_regs)); | 321 | of_iounmap(&op->resource[0], par->regs, sizeof(struct p9100_regs)); |
| @@ -340,7 +336,7 @@ static int __devexit p9100_remove(struct of_device *op) | |||
| 340 | fb_dealloc_cmap(&info->cmap); | 336 | fb_dealloc_cmap(&info->cmap); |
| 341 | 337 | ||
| 342 | of_iounmap(&op->resource[0], par->regs, sizeof(struct p9100_regs)); | 338 | of_iounmap(&op->resource[0], par->regs, sizeof(struct p9100_regs)); |
| 343 | of_iounmap(&op->resource[2], info->screen_base, par->fbsize); | 339 | of_iounmap(&op->resource[2], info->screen_base, info->fix.smem_len); |
| 344 | 340 | ||
| 345 | framebuffer_release(info); | 341 | framebuffer_release(info); |
| 346 | 342 | ||
