aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/platinumfb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 00:55:47 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 00:55:47 -0400
commite86908614f2c7fec401827e5cefd7a6ea9407f85 (patch)
treefcb5d9e52422b37bdaf0e647126ebdfc1680f162 /drivers/video/platinumfb.c
parent547307420931344a868275bd7ea7a30f117a15a9 (diff)
parent9b4b8feb962f4b3e74768b7205f1f8f6cce87238 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (408 commits) [POWERPC] Add memchr() to the bootwrapper [POWERPC] Implement logging of unhandled signals [POWERPC] Add legacy serial support for OPB with flattened device tree [POWERPC] Use 1TB segments [POWERPC] XilinxFB: Allow fixed framebuffer base address [POWERPC] XilinxFB: Add support for custom screen resolution [POWERPC] XilinxFB: Use pdata to pass around framebuffer parameters [POWERPC] PCI: Add 64-bit physical address support to setup_indirect_pci [POWERPC] 4xx: Kilauea defconfig file [POWERPC] 4xx: Kilauea DTS [POWERPC] 4xx: Add AMCC Kilauea eval board support to platforms/40x [POWERPC] 4xx: Add AMCC 405EX support to cputable.c [POWERPC] Adjust TASK_SIZE on ppc32 systems to 3GB that are capable [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig [POWERPC] 85xx: Killed <asm/mpc85xx.h> [POWERPC] 85xx: Add cpm nodes for 8541/8555 CDS [POWERPC] 85xx: Convert mpc8560ads to the new CPM binding. [POWERPC] mpc8272ads: Remove muram from the CPM reg property. [POWERPC] Make clockevents work on PPC601 processors ... Fixed up conflict in Documentation/powerpc/booting-without-of.txt manually.
Diffstat (limited to 'drivers/video/platinumfb.c')
-rw-r--r--drivers/video/platinumfb.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 8503e733a172..cbe71a5338d0 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -17,6 +17,8 @@
17 * more details. 17 * more details.
18 */ 18 */
19 19
20#undef DEBUG
21
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/errno.h> 24#include <linux/errno.h>
@@ -535,33 +537,35 @@ static int __devinit platinumfb_probe(struct of_device* odev,
535 volatile __u8 *fbuffer; 537 volatile __u8 *fbuffer;
536 int bank0, bank1, bank2, bank3, rc; 538 int bank0, bank1, bank2, bank3, rc;
537 539
538 printk(KERN_INFO "platinumfb: Found Apple Platinum video hardware\n"); 540 dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
539 541
540 info = framebuffer_alloc(sizeof(*pinfo), &odev->dev); 542 info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
541 if (info == NULL) 543 if (info == NULL) {
544 dev_err(&odev->dev, "Failed to allocate fbdev !\n");
542 return -ENOMEM; 545 return -ENOMEM;
546 }
543 pinfo = info->par; 547 pinfo = info->par;
544 548
545 if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) || 549 if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
546 of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) { 550 of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) {
547 printk(KERN_ERR "platinumfb: Can't get resources\n"); 551 dev_err(&odev->dev, "Can't get resources\n");
548 framebuffer_release(info);
549 return -ENXIO;
550 }
551 if (!request_mem_region(pinfo->rsrc_reg.start,
552 pinfo->rsrc_reg.start -
553 pinfo->rsrc_reg.end + 1,
554 "platinumfb registers")) {
555 framebuffer_release(info); 552 framebuffer_release(info);
556 return -ENXIO; 553 return -ENXIO;
557 } 554 }
555 dev_dbg(&odev->dev, " registers : 0x%llx...0x%llx\n",
556 (unsigned long long)pinfo->rsrc_reg.start,
557 (unsigned long long)pinfo->rsrc_reg.end);
558 dev_dbg(&odev->dev, " framebuffer: 0x%llx...0x%llx\n",
559 (unsigned long long)pinfo->rsrc_fb.start,
560 (unsigned long long)pinfo->rsrc_fb.end);
561
562 /* Do not try to request register space, they overlap with the
563 * northbridge and that can fail. Only request framebuffer
564 */
558 if (!request_mem_region(pinfo->rsrc_fb.start, 565 if (!request_mem_region(pinfo->rsrc_fb.start,
559 pinfo->rsrc_fb.start 566 pinfo->rsrc_fb.end - pinfo->rsrc_fb.start + 1,
560 - pinfo->rsrc_fb.end + 1,
561 "platinumfb framebuffer")) { 567 "platinumfb framebuffer")) {
562 release_mem_region(pinfo->rsrc_reg.start, 568 printk(KERN_ERR "platinumfb: Can't request framebuffer !\n");
563 pinfo->rsrc_reg.end -
564 pinfo->rsrc_reg.start + 1);
565 framebuffer_release(info); 569 framebuffer_release(info);
566 return -ENXIO; 570 return -ENXIO;
567 } 571 }
@@ -600,7 +604,8 @@ static int __devinit platinumfb_probe(struct of_device* odev,
600 bank2 = fbuffer[0x200000] == 0x56; 604 bank2 = fbuffer[0x200000] == 0x56;
601 bank3 = fbuffer[0x300000] == 0x78; 605 bank3 = fbuffer[0x300000] == 0x78;
602 pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000; 606 pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000;
603 printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n", (int) (pinfo->total_vram / 1024 / 1024), 607 printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n",
608 (unsigned int) (pinfo->total_vram / 1024 / 1024),
604 bank3, bank2, bank1, bank0); 609 bank3, bank2, bank1, bank0);
605 610
606 /* 611 /*
@@ -644,16 +649,15 @@ static int __devexit platinumfb_remove(struct of_device* odev)
644 unregister_framebuffer (info); 649 unregister_framebuffer (info);
645 650
646 /* Unmap frame buffer and registers */ 651 /* Unmap frame buffer and registers */
652 iounmap(pinfo->frame_buffer);
653 iounmap(pinfo->platinum_regs);
654 iounmap(pinfo->cmap_regs);
655
647 release_mem_region(pinfo->rsrc_fb.start, 656 release_mem_region(pinfo->rsrc_fb.start,
648 pinfo->rsrc_fb.end - 657 pinfo->rsrc_fb.end -
649 pinfo->rsrc_fb.start + 1); 658 pinfo->rsrc_fb.start + 1);
650 release_mem_region(pinfo->rsrc_reg.start, 659
651 pinfo->rsrc_reg.end -
652 pinfo->rsrc_reg.start + 1);
653 iounmap(pinfo->frame_buffer);
654 iounmap(pinfo->platinum_regs);
655 release_mem_region(pinfo->cmap_regs_phys, 0x1000); 660 release_mem_region(pinfo->cmap_regs_phys, 0x1000);
656 iounmap(pinfo->cmap_regs);
657 661
658 framebuffer_release(info); 662 framebuffer_release(info);
659 663