aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 05:21:27 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-16 05:21:27 -0400
commit688d22e23ab1caacb2c36c615854294b58f2ea47 (patch)
tree95c8163c0b1f56902f5537bc256d7e5507f56cee /drivers/video
parent7e0edc1bc343231029084761ebf59e522902eb49 (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into x86/xen
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/aty/radeon_base.c4
-rw-r--r--drivers/video/cirrusfb.c6
-rw-r--r--drivers/video/console/fbcon.c4
-rw-r--r--drivers/video/fsl-diu-fb.c4
-rw-r--r--drivers/video/hgafb.c26
-rw-r--r--drivers/video/leo.c58
-rw-r--r--drivers/video/matrox/matroxfb_base.h2
-rw-r--r--drivers/video/modedb.c2
-rw-r--r--drivers/video/pxafb.c7
-rw-r--r--drivers/video/s3c2410fb.c130
-rw-r--r--drivers/video/s3c2410fb.h20
-rw-r--r--drivers/video/sis/sis_main.c2
-rw-r--r--drivers/video/sm501fb.c8
14 files changed, 108 insertions, 167 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index e4bcf5376a99..bd4ac0bafecb 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3356,7 +3356,7 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i
3356 3356
3357 info->fix.mmio_start = raddr; 3357 info->fix.mmio_start = raddr;
3358 par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000); 3358 par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000);
3359 if (par->ati_regbase == 0) 3359 if (par->ati_regbase == NULL)
3360 return -ENOMEM; 3360 return -ENOMEM;
3361 3361
3362 info->fix.mmio_start += par->aux_start ? 0x400 : 0xc00; 3362 info->fix.mmio_start += par->aux_start ? 0x400 : 0xc00;
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 72cd0d2f14ec..400e9264e456 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -2277,8 +2277,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
2277 do { 2277 do {
2278 rinfo->fb_base = ioremap (rinfo->fb_base_phys, 2278 rinfo->fb_base = ioremap (rinfo->fb_base_phys,
2279 rinfo->mapped_vram); 2279 rinfo->mapped_vram);
2280 } while ( rinfo->fb_base == 0 && 2280 } while (rinfo->fb_base == NULL &&
2281 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) ); 2281 ((rinfo->mapped_vram /= 2) >= MIN_MAPPED_VRAM));
2282 2282
2283 if (rinfo->fb_base == NULL) { 2283 if (rinfo->fb_base == NULL) {
2284 printk (KERN_ERR "radeonfb (%s): cannot map FB\n", 2284 printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 35ac9d956b3d..c14b2435d23e 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -2432,9 +2432,9 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
2432 info->screen_size = board_size; 2432 info->screen_size = board_size;
2433 cinfo->unmap = cirrusfb_pci_unmap; 2433 cinfo->unmap = cirrusfb_pci_unmap;
2434 2434
2435 printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ", 2435 printk(KERN_INFO "RAM (%lu kB) at 0x%lx, Cirrus "
2436 info->screen_size >> 10, board_addr); 2436 "Logic chipset on PCI bus\n",
2437 printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n"); 2437 info->screen_size >> 10, board_addr);
2438 pci_set_drvdata(pdev, info); 2438 pci_set_drvdata(pdev, info);
2439 2439
2440 ret = cirrusfb_register(info); 2440 ret = cirrusfb_register(info);
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 5fa8b76673cb..97aff8db10bf 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2275,9 +2275,7 @@ static int fbcon_switch(struct vc_data *vc)
2275 * in fb_set_var() 2275 * in fb_set_var()
2276 */ 2276 */
2277 info->var.activate = var.activate; 2277 info->var.activate = var.activate;
2278 var.yoffset = info->var.yoffset; 2278 var.vmode |= info->var.vmode & ~FB_VMODE_MASK;
2279 var.xoffset = info->var.xoffset;
2280 var.vmode = info->var.vmode;
2281 fb_set_var(info, &var); 2279 fb_set_var(info, &var);
2282 ops->var = info->var; 2280 ops->var = info->var;
2283 2281
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index b50bb03cb5ab..0a2785361ca3 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1320,7 +1320,7 @@ static void free_irq_local(int irq)
1320 * Power management hooks. Note that we won't be called from IRQ context, 1320 * Power management hooks. Note that we won't be called from IRQ context,
1321 * unlike the blank functions above, so we may sleep. 1321 * unlike the blank functions above, so we may sleep.
1322 */ 1322 */
1323static int fsl_diu_suspend(struct of_device *dev, pm_message_t state) 1323static int fsl_diu_suspend(struct of_device *ofdev, pm_message_t state)
1324{ 1324{
1325 struct fsl_diu_data *machine_data; 1325 struct fsl_diu_data *machine_data;
1326 1326
@@ -1330,7 +1330,7 @@ static int fsl_diu_suspend(struct of_device *dev, pm_message_t state)
1330 return 0; 1330 return 0;
1331} 1331}
1332 1332
1333static int fsl_diu_resume(struct of_device *dev) 1333static int fsl_diu_resume(struct of_device *ofdev)
1334{ 1334{
1335 struct fsl_diu_data *machine_data; 1335 struct fsl_diu_data *machine_data;
1336 1336
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index fb9e67228543..c18880d9db1f 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -279,7 +279,7 @@ static void hga_blank(int blank_mode)
279 279
280static int __init hga_card_detect(void) 280static int __init hga_card_detect(void)
281{ 281{
282 int count=0; 282 int count = 0;
283 void __iomem *p, *q; 283 void __iomem *p, *q;
284 unsigned short p_save, q_save; 284 unsigned short p_save, q_save;
285 285
@@ -303,20 +303,18 @@ static int __init hga_card_detect(void)
303 writew(0x55aa, p); if (readw(p) == 0x55aa) count++; 303 writew(0x55aa, p); if (readw(p) == 0x55aa) count++;
304 writew(p_save, p); 304 writew(p_save, p);
305 305
306 if (count != 2) { 306 if (count != 2)
307 return 0; 307 goto error;
308 }
309 308
310 /* Ok, there is definitely a card registering at the correct 309 /* Ok, there is definitely a card registering at the correct
311 * memory location, so now we do an I/O port test. 310 * memory location, so now we do an I/O port test.
312 */ 311 */
313 312
314 if (!test_hga_b(0x66, 0x0f)) { /* cursor low register */ 313 if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
315 return 0; 314 goto error;
316 } 315
317 if (!test_hga_b(0x99, 0x0f)) { /* cursor low register */ 316 if (!test_hga_b(0x99, 0x0f)) /* cursor low register */
318 return 0; 317 goto error;
319 }
320 318
321 /* See if the card is a Hercules, by checking whether the vsync 319 /* See if the card is a Hercules, by checking whether the vsync
322 * bit of the status register is changing. This test lasts for 320 * bit of the status register is changing. This test lasts for
@@ -331,7 +329,7 @@ static int __init hga_card_detect(void)
331 } 329 }
332 330
333 if (p_save == q_save) 331 if (p_save == q_save)
334 return 0; 332 goto error;
335 333
336 switch (inb_p(HGA_STATUS_PORT) & 0x70) { 334 switch (inb_p(HGA_STATUS_PORT) & 0x70) {
337 case 0x10: 335 case 0x10:
@@ -348,6 +346,12 @@ static int __init hga_card_detect(void)
348 break; 346 break;
349 } 347 }
350 return 1; 348 return 1;
349error:
350 if (release_io_ports)
351 release_region(0x3b0, 12);
352 if (release_io_port)
353 release_region(0x3bf, 1);
354 return 0;
351} 355}
352 356
353/** 357/**
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 8bc46e930340..13fea61d6ae4 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -17,8 +17,8 @@
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/of_device.h> 19#include <linux/of_device.h>
20#include <linux/io.h>
20 21
21#include <asm/io.h>
22#include <asm/fbio.h> 22#include <asm/fbio.h>
23 23
24#include "sbuslib.h" 24#include "sbuslib.h"
@@ -33,7 +33,6 @@ static int leo_blank(int, struct fb_info *);
33 33
34static int leo_mmap(struct fb_info *, struct vm_area_struct *); 34static int leo_mmap(struct fb_info *, struct vm_area_struct *);
35static int leo_ioctl(struct fb_info *, unsigned int, unsigned long); 35static int leo_ioctl(struct fb_info *, unsigned int, unsigned long);
36static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *);
37 36
38/* 37/*
39 * Frame buffer operations 38 * Frame buffer operations
@@ -43,7 +42,6 @@ static struct fb_ops leo_ops = {
43 .owner = THIS_MODULE, 42 .owner = THIS_MODULE,
44 .fb_setcolreg = leo_setcolreg, 43 .fb_setcolreg = leo_setcolreg,
45 .fb_blank = leo_blank, 44 .fb_blank = leo_blank,
46 .fb_pan_display = leo_pan_display,
47 .fb_fillrect = cfb_fillrect, 45 .fb_fillrect = cfb_fillrect,
48 .fb_copyarea = cfb_copyarea, 46 .fb_copyarea = cfb_copyarea,
49 .fb_imageblit = cfb_imageblit, 47 .fb_imageblit = cfb_imageblit,
@@ -78,7 +76,7 @@ static struct fb_ops leo_ops = {
78#define LEO_CUR_TYPE_CMAP 0x00000050 76#define LEO_CUR_TYPE_CMAP 0x00000050
79 77
80struct leo_cursor { 78struct leo_cursor {
81 u8 xxx0[16]; 79 u8 xxx0[16];
82 u32 cur_type; 80 u32 cur_type;
83 u32 cur_misc; 81 u32 cur_misc;
84 u32 cur_cursxy; 82 u32 cur_cursxy;
@@ -105,7 +103,7 @@ struct leo_lx_krn {
105 103
106struct leo_lc_ss0_krn { 104struct leo_lc_ss0_krn {
107 u32 misc; 105 u32 misc;
108 u8 xxx0[0x800-4]; 106 u8 xxx0[0x800-4];
109 u32 rev; 107 u32 rev;
110}; 108};
111 109
@@ -116,7 +114,7 @@ struct leo_lc_ss0_usr {
116 u32 fontt; 114 u32 fontt;
117 u32 extent; 115 u32 extent;
118 u32 src; 116 u32 src;
119 u32 dst; 117 u32 dst;
120 u32 copy; 118 u32 copy;
121 u32 fill; 119 u32 fill;
122}; 120};
@@ -129,8 +127,8 @@ struct leo_lc_ss1_usr {
129 u8 unknown; 127 u8 unknown;
130}; 128};
131 129
132struct leo_ld { 130struct leo_ld_ss0 {
133 u8 xxx0[0xe00]; 131 u8 xxx0[0xe00];
134 u32 csr; 132 u32 csr;
135 u32 wid; 133 u32 wid;
136 u32 wmask; 134 u32 wmask;
@@ -144,13 +142,13 @@ struct leo_ld {
144 u32 src; /* Copy/Scroll (SS0 only) */ 142 u32 src; /* Copy/Scroll (SS0 only) */
145 u32 dst; /* Copy/Scroll/Fill (SS0 only) */ 143 u32 dst; /* Copy/Scroll/Fill (SS0 only) */
146 u32 extent; /* Copy/Scroll/Fill size (SS0 only) */ 144 u32 extent; /* Copy/Scroll/Fill size (SS0 only) */
147 u32 xxx1[3]; 145 u32 xxx1[3];
148 u32 setsem; /* SS1 only */ 146 u32 setsem; /* SS1 only */
149 u32 clrsem; /* SS1 only */ 147 u32 clrsem; /* SS1 only */
150 u32 clrpick; /* SS1 only */ 148 u32 clrpick; /* SS1 only */
151 u32 clrdat; /* SS1 only */ 149 u32 clrdat; /* SS1 only */
152 u32 alpha; /* SS1 only */ 150 u32 alpha; /* SS1 only */
153 u8 xxx2[0x2c]; 151 u8 xxx2[0x2c];
154 u32 winbg; 152 u32 winbg;
155 u32 planemask; 153 u32 planemask;
156 u32 rop; 154 u32 rop;
@@ -199,11 +197,12 @@ struct leo_par {
199static void leo_wait(struct leo_lx_krn __iomem *lx_krn) 197static void leo_wait(struct leo_lx_krn __iomem *lx_krn)
200{ 198{
201 int i; 199 int i;
202 200
203 for (i = 0; 201 for (i = 0;
204 (sbus_readl(&lx_krn->krn_csr) & LEO_KRN_CSR_PROGRESS) && i < 300000; 202 (sbus_readl(&lx_krn->krn_csr) & LEO_KRN_CSR_PROGRESS) &&
203 i < 300000;
205 i++) 204 i++)
206 udelay (1); /* Busy wait at most 0.3 sec */ 205 udelay(1); /* Busy wait at most 0.3 sec */
207 return; 206 return;
208} 207}
209 208
@@ -221,7 +220,7 @@ static int leo_setcolreg(unsigned regno,
221 unsigned transp, struct fb_info *info) 220 unsigned transp, struct fb_info *info)
222{ 221{
223 struct leo_par *par = (struct leo_par *) info->par; 222 struct leo_par *par = (struct leo_par *) info->par;
224 struct leo_lx_krn __iomem *lx_krn = par->lx_krn; 223 struct leo_lx_krn __iomem *lx_krn = par->lx_krn;
225 unsigned long flags; 224 unsigned long flags;
226 u32 val; 225 u32 val;
227 int i; 226 int i;
@@ -408,7 +407,7 @@ static void leo_wid_put(struct fb_info *info, struct fb_wid_list *wl)
408 leo_wait(lx_krn); 407 leo_wait(lx_krn);
409 408
410 for (i = 0, wi = wl->wl_list; i < wl->wl_count; i++, wi++) { 409 for (i = 0, wi = wl->wl_list; i < wl->wl_count; i++, wi++) {
411 switch(wi->wi_type) { 410 switch (wi->wi_type) {
412 case FB_WID_DBL_8: 411 case FB_WID_DBL_8:
413 j = (wi->wi_index & 0xf) + 0x40; 412 j = (wi->wi_index & 0xf) + 0x40;
414 break; 413 break;
@@ -453,13 +452,12 @@ static void leo_init_wids(struct fb_info *info)
453 wi.wi_index = 1; 452 wi.wi_index = 1;
454 wi.wi_values [0] = 0x30; 453 wi.wi_values [0] = 0x30;
455 leo_wid_put(info, &wl); 454 leo_wid_put(info, &wl);
456
457} 455}
458 456
459static void leo_switch_from_graph(struct fb_info *info) 457static void leo_switch_from_graph(struct fb_info *info)
460{ 458{
461 struct leo_par *par = (struct leo_par *) info->par; 459 struct leo_par *par = (struct leo_par *) info->par;
462 struct leo_ld __iomem *ss = (struct leo_ld __iomem *) par->ld_ss0; 460 struct leo_ld_ss0 __iomem *ss = par->ld_ss0;
463 unsigned long flags; 461 unsigned long flags;
464 u32 val; 462 u32 val;
465 463
@@ -485,19 +483,13 @@ static void leo_switch_from_graph(struct fb_info *info)
485 val = sbus_readl(&par->lc_ss0_usr->csr); 483 val = sbus_readl(&par->lc_ss0_usr->csr);
486 } while (val & 0x20000000); 484 } while (val & 0x20000000);
487 485
488 spin_unlock_irqrestore(&par->lock, flags); 486 /* setup screen buffer for cfb_* functions */
489} 487 sbus_writel(1, &ss->wid);
490 488 sbus_writel(0x00ffffff, &ss->planemask);
491static int leo_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) 489 sbus_writel(0x310b90, &ss->rop);
492{ 490 sbus_writel(0, &par->lc_ss0_usr->addrspace);
493 /* We just use this to catch switches out of
494 * graphics mode.
495 */
496 leo_switch_from_graph(info);
497 491
498 if (var->xoffset || var->yoffset || var->vmode) 492 spin_unlock_irqrestore(&par->lock, flags);
499 return -EINVAL;
500 return 0;
501} 493}
502 494
503static void leo_init_hw(struct fb_info *info) 495static void leo_init_hw(struct fb_info *info)
@@ -542,7 +534,8 @@ static void leo_unmap_regs(struct of_device *op, struct fb_info *info,
542 of_iounmap(&op->resource[0], info->screen_base, 0x800000); 534 of_iounmap(&op->resource[0], info->screen_base, 0x800000);
543} 535}
544 536
545static int __devinit leo_probe(struct of_device *op, const struct of_device_id *match) 537static int __devinit leo_probe(struct of_device *op,
538 const struct of_device_id *match)
546{ 539{
547 struct device_node *dp = op->node; 540 struct device_node *dp = op->node;
548 struct fb_info *info; 541 struct fb_info *info;
@@ -594,8 +587,9 @@ static int __devinit leo_probe(struct of_device *op, const struct of_device_id *
594 !info->screen_base) 587 !info->screen_base)
595 goto out_unmap_regs; 588 goto out_unmap_regs;
596 589
597 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; 590 info->flags = FBINFO_DEFAULT;
598 info->fbops = &leo_ops; 591 info->fbops = &leo_ops;
592 info->pseudo_palette = par->clut_data;
599 593
600 leo_init_wids(info); 594 leo_init_wids(info);
601 leo_init_hw(info); 595 leo_init_hw(info);
@@ -649,7 +643,7 @@ static int __devexit leo_remove(struct of_device *op)
649 643
650static struct of_device_id leo_match[] = { 644static struct of_device_id leo_match[] = {
651 { 645 {
652 .name = "leo", 646 .name = "SUNW,leo",
653 }, 647 },
654 {}, 648 {},
655}; 649};
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index f3107ad7e545..95883236c0cd 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -200,7 +200,7 @@ static inline int mga_ioremap(unsigned long phys, unsigned long size, int flags,
200 virt->vaddr = ioremap_nocache(phys, size); 200 virt->vaddr = ioremap_nocache(phys, size);
201 else 201 else
202 virt->vaddr = ioremap(phys, size); 202 virt->vaddr = ioremap(phys, size);
203 return (virt->vaddr == 0); /* 0, !0... 0, error_code in future */ 203 return (virt->vaddr == NULL); /* 0, !0... 0, error_code in future */
204} 204}
205 205
206static inline void mga_iounmap(vaddr_t va) { 206static inline void mga_iounmap(vaddr_t va) {
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 473562191586..d3c3af53a290 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -28,6 +28,7 @@
28#endif 28#endif
29 29
30const char *fb_mode_option; 30const char *fb_mode_option;
31EXPORT_SYMBOL_GPL(fb_mode_option);
31 32
32 /* 33 /*
33 * Standard video mode definitions (taken from XFree86) 34 * Standard video mode definitions (taken from XFree86)
@@ -590,6 +591,7 @@ done:
590 "", (margins) ? " with margins" : "", (interlace) ? 591 "", (margins) ? " with margins" : "", (interlace) ?
591 " interlaced" : ""); 592 " interlaced" : "");
592 593
594 memset(&cvt_mode, 0, sizeof(cvt_mode));
593 cvt_mode.xres = xres; 595 cvt_mode.xres = xres;
594 cvt_mode.yres = yres; 596 cvt_mode.yres = yres;
595 cvt_mode.refresh = (refresh) ? refresh : 60; 597 cvt_mode.refresh = (refresh) ? refresh : 60;
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 3ee314beacc1..7dcda187d9ba 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -573,8 +573,8 @@ static int setup_frame_dma(struct pxafb_info *fbi, int dma, int pal,
573 dma_desc->fdadr = fbi->dma_buff_phys + dma_desc_off; 573 dma_desc->fdadr = fbi->dma_buff_phys + dma_desc_off;
574 fbi->fdadr[dma] = fbi->dma_buff_phys + dma_desc_off; 574 fbi->fdadr[dma] = fbi->dma_buff_phys + dma_desc_off;
575 } else { 575 } else {
576 pal_desc = &fbi->dma_buff->pal_desc[dma]; 576 pal_desc = &fbi->dma_buff->pal_desc[pal];
577 pal_desc_off = offsetof(struct pxafb_dma_buff, dma_desc[pal]); 577 pal_desc_off = offsetof(struct pxafb_dma_buff, pal_desc[pal]);
578 578
579 pal_desc->fsadr = fbi->dma_buff_phys + pal * PALETTE_SIZE; 579 pal_desc->fsadr = fbi->dma_buff_phys + pal * PALETTE_SIZE;
580 pal_desc->fidr = 0; 580 pal_desc->fidr = 0;
@@ -1276,6 +1276,8 @@ static int __init pxafb_map_video_memory(struct pxafb_info *fbi)
1276 fbi->dma_buff_phys = fbi->map_dma; 1276 fbi->dma_buff_phys = fbi->map_dma;
1277 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette; 1277 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette;
1278 1278
1279 pr_debug("pxafb: palette_mem_size = 0x%08lx\n", fbi->palette_size*sizeof(u16));
1280
1279#ifdef CONFIG_FB_PXA_SMARTPANEL 1281#ifdef CONFIG_FB_PXA_SMARTPANEL
1280 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff; 1282 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
1281 fbi->n_smart_cmds = 0; 1283 fbi->n_smart_cmds = 0;
@@ -1351,7 +1353,6 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
1351 struct pxafb_info *fbi; 1353 struct pxafb_info *fbi;
1352 void *addr; 1354 void *addr;
1353 struct pxafb_mach_info *inf = dev->platform_data; 1355 struct pxafb_mach_info *inf = dev->platform_data;
1354 struct pxafb_mode_info *mode = inf->modes;
1355 1356
1356 /* Alloc the pxafb_info and pseudo_palette in one step */ 1357 /* Alloc the pxafb_info and pseudo_palette in one step */
1357 fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL); 1358 fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL);
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 13b38cbbe4cf..f0598961c6b0 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -1,75 +1,15 @@
1/* 1/* linux/drivers/video/s3c2410fb.c
2 * linux/drivers/video/s3c2410fb.c 2 * Copyright (c) 2004,2005 Arnaud Patard
3 * Copyright (c) Arnaud Patard, Ben Dooks 3 * Copyright (c) 2004-2008 Ben Dooks
4 *
5 * S3C2410 LCD Framebuffer Driver
4 * 6 *
5 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file COPYING in the main directory of this archive for 8 * License. See the file COPYING in the main directory of this archive for
7 * more details. 9 * more details.
8 * 10 *
9 * S3C2410 LCD Controller Frame Buffer Driver 11 * Driver based on skeletonfb.c, sa1100fb.c and others.
10 * based on skeletonfb.c, sa1100fb.c and others 12*/
11 *
12 * ChangeLog
13 * 2005-04-07: Arnaud Patard <arnaud.patard@rtp-net.org>
14 * - u32 state -> pm_message_t state
15 * - S3C2410_{VA,SZ}_LCD -> S3C24XX
16 *
17 * 2005-03-15: Arnaud Patard <arnaud.patard@rtp-net.org>
18 * - Removed the ioctl
19 * - use readl/writel instead of __raw_writel/__raw_readl
20 *
21 * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
22 * - Added the possibility to set on or off the
23 * debugging messages
24 * - Replaced 0 and 1 by on or off when reading the
25 * /sys files
26 *
27 * 2005-03-23: Ben Dooks <ben-linux@fluff.org>
28 * - added non 16bpp modes
29 * - updated platform information for range of x/y/bpp
30 * - add code to ensure palette is written correctly
31 * - add pixel clock divisor control
32 *
33 * 2004-11-11: Arnaud Patard <arnaud.patard@rtp-net.org>
34 * - Removed the use of currcon as it no more exists
35 * - Added LCD power sysfs interface
36 *
37 * 2004-11-03: Ben Dooks <ben-linux@fluff.org>
38 * - minor cleanups
39 * - add suspend/resume support
40 * - s3c2410fb_setcolreg() not valid in >8bpp modes
41 * - removed last CONFIG_FB_S3C2410_FIXED
42 * - ensure lcd controller stopped before cleanup
43 * - added sysfs interface for backlight power
44 * - added mask for gpio configuration
45 * - ensured IRQs disabled during GPIO configuration
46 * - disable TPAL before enabling video
47 *
48 * 2004-09-20: Arnaud Patard <arnaud.patard@rtp-net.org>
49 * - Suppress command line options
50 *
51 * 2004-09-15: Arnaud Patard <arnaud.patard@rtp-net.org>
52 * - code cleanup
53 *
54 * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
55 * - Renamed from h1940fb.c to s3c2410fb.c
56 * - Add support for different devices
57 * - Backlight support
58 *
59 * 2004-09-05: Herbert Pƶtzl <herbert@13thfloor.at>
60 * - added clock (de-)allocation code
61 * - added fixem fbmem option
62 *
63 * 2004-07-27: Arnaud Patard <arnaud.patard@rtp-net.org>
64 * - code cleanup
65 * - added a forgotten return in h1940fb_init
66 *
67 * 2004-07-19: Herbert Pƶtzl <herbert@13thfloor.at>
68 * - code cleanup and extended debugging
69 *
70 * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
71 * - First version
72 */
73 13
74#include <linux/module.h> 14#include <linux/module.h>
75#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -580,6 +520,27 @@ static int s3c2410fb_setcolreg(unsigned regno,
580 return 0; 520 return 0;
581} 521}
582 522
523/* s3c2410fb_lcd_enable
524 *
525 * shutdown the lcd controller
526 */
527static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
528{
529 unsigned long flags;
530
531 local_irq_save(flags);
532
533 if (enable)
534 fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
535 else
536 fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
537
538 writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
539
540 local_irq_restore(flags);
541}
542
543
583/* 544/*
584 * s3c2410fb_blank 545 * s3c2410fb_blank
585 * @blank_mode: the blank mode we want. 546 * @blank_mode: the blank mode we want.
@@ -589,9 +550,6 @@ static int s3c2410fb_setcolreg(unsigned regno,
589 * blanking succeeded, != 0 if un-/blanking failed due to e.g. a 550 * blanking succeeded, != 0 if un-/blanking failed due to e.g. a
590 * video mode which doesn't support it. Implements VESA suspend 551 * video mode which doesn't support it. Implements VESA suspend
591 * and powerdown modes on hardware that supports disabling hsync/vsync: 552 * and powerdown modes on hardware that supports disabling hsync/vsync:
592 * blank_mode == 2: suspend vsync
593 * blank_mode == 3: suspend hsync
594 * blank_mode == 4: powerdown
595 * 553 *
596 * Returns negative errno on error, or zero on success. 554 * Returns negative errno on error, or zero on success.
597 * 555 *
@@ -605,6 +563,12 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
605 563
606 tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL; 564 tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL;
607 565
566 if (blank_mode == FB_BLANK_POWERDOWN) {
567 s3c2410fb_lcd_enable(fbi, 0);
568 } else {
569 s3c2410fb_lcd_enable(fbi, 1);
570 }
571
608 if (blank_mode == FB_BLANK_UNBLANK) 572 if (blank_mode == FB_BLANK_UNBLANK)
609 writel(0x0, tpal_reg); 573 writel(0x0, tpal_reg);
610 else { 574 else {
@@ -948,7 +912,10 @@ static int __init s3c24xxfb_probe(struct platform_device *pdev,
948 } 912 }
949 913
950 /* create device files */ 914 /* create device files */
951 device_create_file(&pdev->dev, &dev_attr_debug); 915 ret = device_create_file(&pdev->dev, &dev_attr_debug);
916 if (ret) {
917 printk(KERN_ERR "failed to add debug attribute\n");
918 }
952 919
953 printk(KERN_INFO "fb%d: %s frame buffer device\n", 920 printk(KERN_INFO "fb%d: %s frame buffer device\n",
954 fbinfo->node, fbinfo->fix.id); 921 fbinfo->node, fbinfo->fix.id);
@@ -983,21 +950,6 @@ static int __init s3c2412fb_probe(struct platform_device *pdev)
983 return s3c24xxfb_probe(pdev, DRV_S3C2412); 950 return s3c24xxfb_probe(pdev, DRV_S3C2412);
984} 951}
985 952
986/* s3c2410fb_stop_lcd
987 *
988 * shutdown the lcd controller
989 */
990static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
991{
992 unsigned long flags;
993
994 local_irq_save(flags);
995
996 fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
997 writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
998
999 local_irq_restore(flags);
1000}
1001 953
1002/* 954/*
1003 * Cleanup 955 * Cleanup
@@ -1010,7 +962,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
1010 962
1011 unregister_framebuffer(fbinfo); 963 unregister_framebuffer(fbinfo);
1012 964
1013 s3c2410fb_stop_lcd(info); 965 s3c2410fb_lcd_enable(info, 0);
1014 msleep(1); 966 msleep(1);
1015 967
1016 s3c2410fb_unmap_video_memory(fbinfo); 968 s3c2410fb_unmap_video_memory(fbinfo);
@@ -1043,7 +995,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
1043 struct fb_info *fbinfo = platform_get_drvdata(dev); 995 struct fb_info *fbinfo = platform_get_drvdata(dev);
1044 struct s3c2410fb_info *info = fbinfo->par; 996 struct s3c2410fb_info *info = fbinfo->par;
1045 997
1046 s3c2410fb_stop_lcd(info); 998 s3c2410fb_lcd_enable(info, 0);
1047 999
1048 /* sleep before disabling the clock, we need to ensure 1000 /* sleep before disabling the clock, we need to ensure
1049 * the LCD DMA engine is not going to get back on the bus 1001 * the LCD DMA engine is not going to get back on the bus
@@ -1118,3 +1070,5 @@ MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>, "
1118 "Ben Dooks <ben-linux@fluff.org>"); 1070 "Ben Dooks <ben-linux@fluff.org>");
1119MODULE_DESCRIPTION("Framebuffer driver for the s3c2410"); 1071MODULE_DESCRIPTION("Framebuffer driver for the s3c2410");
1120MODULE_LICENSE("GPL"); 1072MODULE_LICENSE("GPL");
1073MODULE_ALIAS("platform:s3c2410-lcd");
1074MODULE_ALIAS("platform:s3c2412-lcd");
diff --git a/drivers/video/s3c2410fb.h b/drivers/video/s3c2410fb.h
index dbb73b95e2ef..9a6ba3e9d1b8 100644
--- a/drivers/video/s3c2410fb.h
+++ b/drivers/video/s3c2410fb.h
@@ -1,26 +1,14 @@
1/* 1/*
2 * linux/drivers/video/s3c2410fb.h 2 * linux/drivers/video/s3c2410fb.h
3 * Copyright (c) Arnaud Patard 3 * Copyright (c) 2004 Arnaud Patard
4 *
5 * S3C2410 LCD Framebuffer Driver
4 * 6 *
5 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file COPYING in the main directory of this archive for 8 * License. See the file COPYING in the main directory of this archive for
7 * more details. 9 * more details.
8 * 10 *
9 * S3C2410 LCD Controller Frame Buffer Driver 11*/
10 * based on skeletonfb.c, sa1100fb.h
11 *
12 * ChangeLog
13 *
14 * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
15 * - Moved dprintk to s3c2410fb.c
16 *
17 * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
18 * - Renamed from h1940fb.h to s3c2410fb.h
19 * - Changed h1940 to s3c2410
20 *
21 * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
22 * - First version
23 */
24 12
25#ifndef __S3C2410FB_H 13#ifndef __S3C2410FB_H
26#define __S3C2410FB_H 14#define __S3C2410FB_H
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 73803624c131..b9343844cd1f 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -5787,7 +5787,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5787 } else { 5787 } else {
5788 struct sis_video_info *countvideo = card_list; 5788 struct sis_video_info *countvideo = card_list;
5789 ivideo->cardnumber = 1; 5789 ivideo->cardnumber = 1;
5790 while((countvideo = countvideo->next) != 0) 5790 while((countvideo = countvideo->next) != NULL)
5791 ivideo->cardnumber++; 5791 ivideo->cardnumber++;
5792 } 5792 }
5793 5793
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 742b5c656d66..15d4a768b1f6 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -663,14 +663,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
663 sm501fb_sync_regs(fbi); 663 sm501fb_sync_regs(fbi);
664 mdelay(10); 664 mdelay(10);
665 665
666 if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) { 666 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
667 control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */ 667 control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
668 writel(control, ctrl_reg); 668 writel(control, ctrl_reg);
669 sm501fb_sync_regs(fbi); 669 sm501fb_sync_regs(fbi);
670 mdelay(10); 670 mdelay(10);
671 } 671 }
672 672
673 if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) { 673 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
674 control |= SM501_DC_PANEL_CONTROL_FPEN; 674 control |= SM501_DC_PANEL_CONTROL_FPEN;
675 writel(control, ctrl_reg); 675 writel(control, ctrl_reg);
676 sm501fb_sync_regs(fbi); 676 sm501fb_sync_regs(fbi);
@@ -678,14 +678,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
678 } 678 }
679 } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) { 679 } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
680 /* disable panel power */ 680 /* disable panel power */
681 if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) { 681 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
682 control &= ~SM501_DC_PANEL_CONTROL_FPEN; 682 control &= ~SM501_DC_PANEL_CONTROL_FPEN;
683 writel(control, ctrl_reg); 683 writel(control, ctrl_reg);
684 sm501fb_sync_regs(fbi); 684 sm501fb_sync_regs(fbi);
685 mdelay(10); 685 mdelay(10);
686 } 686 }
687 687
688 if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) { 688 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
689 control &= ~SM501_DC_PANEL_CONTROL_BIAS; 689 control &= ~SM501_DC_PANEL_CONTROL_BIAS;
690 writel(control, ctrl_reg); 690 writel(control, ctrl_reg);
691 sm501fb_sync_regs(fbi); 691 sm501fb_sync_regs(fbi);