aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/gxt4500.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/video/gxt4500.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/video/gxt4500.c')
-rw-r--r--drivers/video/gxt4500.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
index c35663f6a54..896e53dea90 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -1,6 +1,5 @@
1/* 1/*
2 * Frame buffer device for IBM GXT4500P/6500P and GXT4000P/6000P 2 * Frame buffer device for IBM GXT4500P and GXT6000P display adaptors
3 * display adaptors
4 * 3 *
5 * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org> 4 * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org>
6 */ 5 */
@@ -15,8 +14,6 @@
15#include <linux/string.h> 14#include <linux/string.h>
16 15
17#define PCI_DEVICE_ID_IBM_GXT4500P 0x21c 16#define PCI_DEVICE_ID_IBM_GXT4500P 0x21c
18#define PCI_DEVICE_ID_IBM_GXT6500P 0x21b
19#define PCI_DEVICE_ID_IBM_GXT4000P 0x16e
20#define PCI_DEVICE_ID_IBM_GXT6000P 0x170 17#define PCI_DEVICE_ID_IBM_GXT6000P 0x170
21 18
22/* GXT4500P registers */ 19/* GXT4500P registers */
@@ -159,7 +156,7 @@ struct gxt4500_par {
159static char *mode_option; 156static char *mode_option;
160 157
161/* default mode: 1280x1024 @ 60 Hz, 8 bpp */ 158/* default mode: 1280x1024 @ 60 Hz, 8 bpp */
162static const struct fb_videomode defaultmode = { 159static const struct fb_videomode defaultmode __devinitdata = {
163 .refresh = 60, 160 .refresh = 60,
164 .xres = 1280, 161 .xres = 1280,
165 .yres = 1024, 162 .yres = 1024,
@@ -176,8 +173,6 @@ static const struct fb_videomode defaultmode = {
176/* List of supported cards */ 173/* List of supported cards */
177enum gxt_cards { 174enum gxt_cards {
178 GXT4500P, 175 GXT4500P,
179 GXT6500P,
180 GXT4000P,
181 GXT6000P 176 GXT6000P
182}; 177};
183 178
@@ -187,8 +182,6 @@ static const struct cardinfo {
187 const char *cardname; 182 const char *cardname;
188} cardinfo[] = { 183} cardinfo[] = {
189 [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" }, 184 [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" },
190 [GXT6500P] = { .refclk_ps = 9259, .cardname = "IBM GXT6500P" },
191 [GXT4000P] = { .refclk_ps = 40000, .cardname = "IBM GXT4000P" },
192 [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" }, 185 [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" },
193}; 186};
194 187
@@ -550,8 +543,8 @@ static int gxt4500_pan_display(struct fb_var_screeninfo *var,
550 543
551 if (var->xoffset & 7) 544 if (var->xoffset & 7)
552 return -EINVAL; 545 return -EINVAL;
553 if (var->xoffset + info->var.xres > info->var.xres_virtual || 546 if (var->xoffset + var->xres > var->xres_virtual ||
554 var->yoffset + info->var.yres > info->var.yres_virtual) 547 var->yoffset + var->yres > var->yres_virtual)
555 return -EINVAL; 548 return -EINVAL;
556 549
557 writereg(par, REFRESH_START, (var->xoffset << 16) | var->yoffset); 550 writereg(par, REFRESH_START, (var->xoffset << 16) | var->yoffset);
@@ -588,7 +581,7 @@ static int gxt4500_blank(int blank, struct fb_info *info)
588 return 0; 581 return 0;
589} 582}
590 583
591static const struct fb_fix_screeninfo gxt4500_fix = { 584static const struct fb_fix_screeninfo gxt4500_fix __devinitdata = {
592 .id = "IBM GXT4500P", 585 .id = "IBM GXT4500P",
593 .type = FB_TYPE_PACKED_PIXELS, 586 .type = FB_TYPE_PACKED_PIXELS,
594 .visual = FB_VISUAL_PSEUDOCOLOR, 587 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -610,7 +603,8 @@ static struct fb_ops gxt4500_ops = {
610}; 603};
611 604
612/* PCI functions */ 605/* PCI functions */
613static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 606static int __devinit gxt4500_probe(struct pci_dev *pdev,
607 const struct pci_device_id *ent)
614{ 608{
615 int err; 609 int err;
616 unsigned long reg_phys, fb_phys; 610 unsigned long reg_phys, fb_phys;
@@ -719,7 +713,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
719 return -ENODEV; 713 return -ENODEV;
720} 714}
721 715
722static void gxt4500_remove(struct pci_dev *pdev) 716static void __devexit gxt4500_remove(struct pci_dev *pdev)
723{ 717{
724 struct fb_info *info = pci_get_drvdata(pdev); 718 struct fb_info *info = pci_get_drvdata(pdev);
725 struct gxt4500_par *par; 719 struct gxt4500_par *par;
@@ -742,10 +736,6 @@ static void gxt4500_remove(struct pci_dev *pdev)
742static const struct pci_device_id gxt4500_pci_tbl[] = { 736static const struct pci_device_id gxt4500_pci_tbl[] = {
743 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P), 737 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P),
744 .driver_data = GXT4500P }, 738 .driver_data = GXT4500P },
745 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6500P),
746 .driver_data = GXT6500P },
747 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4000P),
748 .driver_data = GXT4000P },
749 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P), 739 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P),
750 .driver_data = GXT6000P }, 740 .driver_data = GXT6000P },
751 { 0 } 741 { 0 }
@@ -757,10 +747,10 @@ static struct pci_driver gxt4500_driver = {
757 .name = "gxt4500", 747 .name = "gxt4500",
758 .id_table = gxt4500_pci_tbl, 748 .id_table = gxt4500_pci_tbl,
759 .probe = gxt4500_probe, 749 .probe = gxt4500_probe,
760 .remove = gxt4500_remove, 750 .remove = __devexit_p(gxt4500_remove),
761}; 751};
762 752
763static int gxt4500_init(void) 753static int __devinit gxt4500_init(void)
764{ 754{
765#ifndef MODULE 755#ifndef MODULE
766 if (fb_get_options("gxt4500", &mode_option)) 756 if (fb_get_options("gxt4500", &mode_option))
@@ -778,7 +768,7 @@ static void __exit gxt4500_exit(void)
778module_exit(gxt4500_exit); 768module_exit(gxt4500_exit);
779 769
780MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 770MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>");
781MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6500P and GXT4000P/6000P"); 771MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6000P");
782MODULE_LICENSE("GPL"); 772MODULE_LICENSE("GPL");
783module_param(mode_option, charp, 0); 773module_param(mode_option, charp, 0);
784MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\""); 774MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\"");