aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c2410fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/s3c2410fb.c')
-rw-r--r--drivers/video/s3c2410fb.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index e850f11488e1..108d49e6884e 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -123,6 +123,8 @@ static void s3c2410fb_set_lcdaddr(struct fb_info *info)
123{ 123{
124 unsigned long saddr1, saddr2, saddr3; 124 unsigned long saddr1, saddr2, saddr3;
125 int line_length = info->var.xres * info->var.bits_per_pixel; 125 int line_length = info->var.xres * info->var.bits_per_pixel;
126 struct s3c2410fb_info *fbi = info->par;
127 void __iomem *regs = fbi->io;
126 128
127 saddr1 = info->fix.smem_start >> 1; 129 saddr1 = info->fix.smem_start >> 1;
128 saddr2 = info->fix.smem_start; 130 saddr2 = info->fix.smem_start;
@@ -136,9 +138,9 @@ static void s3c2410fb_set_lcdaddr(struct fb_info *info)
136 dprintk("LCDSADDR2 = 0x%08lx\n", saddr2); 138 dprintk("LCDSADDR2 = 0x%08lx\n", saddr2);
137 dprintk("LCDSADDR3 = 0x%08lx\n", saddr3); 139 dprintk("LCDSADDR3 = 0x%08lx\n", saddr3);
138 140
139 writel(saddr1, S3C2410_LCDSADDR1); 141 writel(saddr1, regs + S3C2410_LCDSADDR1);
140 writel(saddr2, S3C2410_LCDSADDR2); 142 writel(saddr2, regs + S3C2410_LCDSADDR2);
141 writel(saddr3, S3C2410_LCDSADDR3); 143 writel(saddr3, regs + S3C2410_LCDSADDR3);
142} 144}
143 145
144/* s3c2410fb_calc_pixclk() 146/* s3c2410fb_calc_pixclk()
@@ -409,6 +411,7 @@ static void s3c2410fb_calculate_tft_lcd_regs(const struct fb_info *info,
409static void s3c2410fb_activate_var(struct fb_info *info) 411static void s3c2410fb_activate_var(struct fb_info *info)
410{ 412{
411 struct s3c2410fb_info *fbi = info->par; 413 struct s3c2410fb_info *fbi = info->par;
414 void __iomem *regs = fbi->io;
412 struct fb_var_screeninfo *var = &info->var; 415 struct fb_var_screeninfo *var = &info->var;
413 struct s3c2410fb_mach_info *mach_info = fbi->mach_info; 416 struct s3c2410fb_mach_info *mach_info = fbi->mach_info;
414 struct s3c2410fb_display *display = mach_info->displays + 417 struct s3c2410fb_display *display = mach_info->displays +
@@ -449,16 +452,17 @@ static void s3c2410fb_activate_var(struct fb_info *info)
449 dprintk("lcdcon[4] = 0x%08lx\n", fbi->regs.lcdcon4); 452 dprintk("lcdcon[4] = 0x%08lx\n", fbi->regs.lcdcon4);
450 dprintk("lcdcon[5] = 0x%08lx\n", fbi->regs.lcdcon5); 453 dprintk("lcdcon[5] = 0x%08lx\n", fbi->regs.lcdcon5);
451 454
452 writel(fbi->regs.lcdcon1 & ~S3C2410_LCDCON1_ENVID, S3C2410_LCDCON1); 455 writel(fbi->regs.lcdcon1 & ~S3C2410_LCDCON1_ENVID,
453 writel(fbi->regs.lcdcon2, S3C2410_LCDCON2); 456 regs + S3C2410_LCDCON1);
454 writel(fbi->regs.lcdcon3, S3C2410_LCDCON3); 457 writel(fbi->regs.lcdcon2, regs + S3C2410_LCDCON2);
455 writel(fbi->regs.lcdcon4, S3C2410_LCDCON4); 458 writel(fbi->regs.lcdcon3, regs + S3C2410_LCDCON3);
456 writel(fbi->regs.lcdcon5, S3C2410_LCDCON5); 459 writel(fbi->regs.lcdcon4, regs + S3C2410_LCDCON4);
460 writel(fbi->regs.lcdcon5, regs + S3C2410_LCDCON5);
457 461
458 /* set lcd address pointers */ 462 /* set lcd address pointers */
459 s3c2410fb_set_lcdaddr(info); 463 s3c2410fb_set_lcdaddr(info);
460 464
461 writel(fbi->regs.lcdcon1, S3C2410_LCDCON1); 465 writel(fbi->regs.lcdcon1, regs + S3C2410_LCDCON1);
462} 466}
463 467
464/* 468/*
@@ -527,6 +531,7 @@ static int s3c2410fb_setcolreg(unsigned regno,
527 unsigned transp, struct fb_info *info) 531 unsigned transp, struct fb_info *info)
528{ 532{
529 struct s3c2410fb_info *fbi = info->par; 533 struct s3c2410fb_info *fbi = info->par;
534 void __iomem *regs = fbi->io;
530 unsigned int val; 535 unsigned int val;
531 536
532 /* dprintk("setcol: regno=%d, rgb=%d,%d,%d\n", 537 /* dprintk("setcol: regno=%d, rgb=%d,%d,%d\n",
@@ -555,7 +560,7 @@ static int s3c2410fb_setcolreg(unsigned regno,
555 val |= ((green >> 5) & 0x07e0); 560 val |= ((green >> 5) & 0x07e0);
556 val |= ((blue >> 11) & 0x001f); 561 val |= ((blue >> 11) & 0x001f);
557 562
558 writel(val, S3C2410_TFTPAL(regno)); 563 writel(val, regs + S3C2410_TFTPAL(regno));
559 schedule_palette_update(fbi, regno, val); 564 schedule_palette_update(fbi, regno, val);
560 } 565 }
561 566
@@ -586,16 +591,19 @@ static int s3c2410fb_setcolreg(unsigned regno,
586 */ 591 */
587static int s3c2410fb_blank(int blank_mode, struct fb_info *info) 592static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
588{ 593{
594 struct s3c2410fb_info *fbi = info->par;
595 void __iomem *regs = fbi->io;
596
589 dprintk("blank(mode=%d, info=%p)\n", blank_mode, info); 597 dprintk("blank(mode=%d, info=%p)\n", blank_mode, info);
590 598
591 if (mach_info == NULL) 599 if (mach_info == NULL)
592 return -EINVAL; 600 return -EINVAL;
593 601
594 if (blank_mode == FB_BLANK_UNBLANK) 602 if (blank_mode == FB_BLANK_UNBLANK)
595 writel(0x0, S3C2410_TPAL); 603 writel(0x0, regs + S3C2410_TPAL);
596 else { 604 else {
597 dprintk("setting TPAL to output 0x000000\n"); 605 dprintk("setting TPAL to output 0x000000\n");
598 writel(S3C2410_TPAL_EN, S3C2410_TPAL); 606 writel(S3C2410_TPAL_EN, regs + S3C2410_TPAL);
599 } 607 }
600 608
601 return 0; 609 return 0;