aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2007-10-16 04:29:00 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:17 -0400
commit93d11f5a15020a514e522e678b2b3e7a1bc01f86 (patch)
treef70e94a82e8a43ab5308f36b9658ce6aa0a06a70
parent3c9ffd0501157b38599b5bb7711366913f633f88 (diff)
s3c2410fb: add pulse length fields to s3c2410fb_display
This patch adds synchronization pulse lenght fields to the s3c2410fb_display structure and makes use of them in the driver. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c1
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c18
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c6
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c2
-rw-r--r--drivers/video/s3c2410fb.c34
7 files changed, 47 insertions, 18 deletions
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 5f51a80fcd5c..4c958b7c09d5 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -179,6 +179,7 @@ static struct s3c2410fb_display __initdata amlm5900_lcd_info = {
179 .bpp = 4, 179 .bpp = 4,
180 .left_margin = 1 << (4 + 3), 180 .left_margin = 1 << (4 + 3),
181 .right_margin = 8 << 3, 181 .right_margin = 8 << 3,
182 .hsync_len = 48,
182 .upper_margin = 0, 183 .upper_margin = 0,
183 .lower_margin = 0, 184 .lower_margin = 0,
184 185
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 7b54f3c2a2d7..e9c9df078925 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -477,8 +477,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
477 .yres = 240, 477 .yres = 240,
478 .left_margin = 40, 478 .left_margin = 40,
479 .right_margin = 20, 479 .right_margin = 20,
480 .hsync_len = 88,
480 .upper_margin = 30, 481 .upper_margin = 30,
481 .lower_margin = 32, 482 .lower_margin = 32,
483 .vsync_len = 3,
482 484
483 .bpp = 4, 485 .bpp = 4,
484 486
@@ -497,8 +499,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
497 .bpp = 4, 499 .bpp = 4,
498 .left_margin = 40, 500 .left_margin = 40,
499 .right_margin = 20, 501 .right_margin = 20,
502 .hsync_len = 88,
500 .upper_margin = 30, 503 .upper_margin = 30,
501 .lower_margin = 32, 504 .lower_margin = 32,
505 .vsync_len = 3,
502 506
503 .lcdcon1 = 0x00000176, 507 .lcdcon1 = 0x00000176,
504 .lcdcon2 = 0x1d77c7c2, 508 .lcdcon2 = 0x1d77c7c2,
@@ -515,8 +519,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
515 .bpp = 4, 519 .bpp = 4,
516 .left_margin = 40, 520 .left_margin = 40,
517 .right_margin = 20, 521 .right_margin = 20,
522 .hsync_len = 88,
518 .upper_margin = 30, 523 .upper_margin = 30,
519 .lower_margin = 32, 524 .lower_margin = 32,
525 .vsync_len = 3,
520 526
521 .lcdcon1 = 0x00000176, 527 .lcdcon1 = 0x00000176,
522 .lcdcon2 = 0x1d77c7c2, 528 .lcdcon2 = 0x1d77c7c2,
@@ -533,8 +539,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
533 .bpp = 8, 539 .bpp = 8,
534 .left_margin = 40, 540 .left_margin = 40,
535 .right_margin = 20, 541 .right_margin = 20,
542 .hsync_len = 88,
536 .upper_margin = 30, 543 .upper_margin = 30,
537 .lower_margin = 32, 544 .lower_margin = 32,
545 .vsync_len = 3,
538 546
539 .lcdcon1 = 0x00000176, 547 .lcdcon1 = 0x00000176,
540 .lcdcon2 = 0x1d77c7c2, 548 .lcdcon2 = 0x1d77c7c2,
@@ -551,8 +559,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
551 .bpp = 8, 559 .bpp = 8,
552 .left_margin = 40, 560 .left_margin = 40,
553 .right_margin = 20, 561 .right_margin = 20,
562 .hsync_len = 88,
554 .upper_margin = 30, 563 .upper_margin = 30,
555 .lower_margin = 32, 564 .lower_margin = 32,
565 .vsync_len = 3,
556 566
557 .lcdcon1 = 0x00000176, 567 .lcdcon1 = 0x00000176,
558 .lcdcon2 = 0x1d77c7c2, 568 .lcdcon2 = 0x1d77c7c2,
@@ -569,8 +579,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
569 .bpp = 8, 579 .bpp = 8,
570 .left_margin = 40, 580 .left_margin = 40,
571 .right_margin = 20, 581 .right_margin = 20,
582 .hsync_len = 88,
572 .upper_margin = 30, 583 .upper_margin = 30,
573 .lower_margin = 32, 584 .lower_margin = 32,
585 .vsync_len = 3,
574 586
575 .lcdcon1 = 0x00000176, 587 .lcdcon1 = 0x00000176,
576 .lcdcon2 = 0x1d77c7c2, 588 .lcdcon2 = 0x1d77c7c2,
@@ -587,8 +599,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
587 .bpp = 16, 599 .bpp = 16,
588 .left_margin = 40, 600 .left_margin = 40,
589 .right_margin = 20, 601 .right_margin = 20,
602 .hsync_len = 88,
590 .upper_margin = 30, 603 .upper_margin = 30,
591 .lower_margin = 32, 604 .lower_margin = 32,
605 .vsync_len = 3,
592 606
593 .lcdcon1 = 0x00000176, 607 .lcdcon1 = 0x00000176,
594 .lcdcon2 = 0x1d77c7c2, 608 .lcdcon2 = 0x1d77c7c2,
@@ -605,8 +619,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
605 .bpp = 16, 619 .bpp = 16,
606 .left_margin = 40, 620 .left_margin = 40,
607 .right_margin = 20, 621 .right_margin = 20,
622 .hsync_len = 88,
608 .upper_margin = 30, 623 .upper_margin = 30,
609 .lower_margin = 32, 624 .lower_margin = 32,
625 .vsync_len = 3,
610 626
611 .lcdcon1 = 0x00000176, 627 .lcdcon1 = 0x00000176,
612 .lcdcon2 = 0x1d77c7c2, 628 .lcdcon2 = 0x1d77c7c2,
@@ -623,8 +639,10 @@ static struct s3c2410fb_display __initdata bast_lcd_info[] = {
623 .bpp = 16, 639 .bpp = 16,
624 .left_margin = 40, 640 .left_margin = 40,
625 .right_margin = 20, 641 .right_margin = 20,
642 .hsync_len = 88,
626 .upper_margin = 30, 643 .upper_margin = 30,
627 .lower_margin = 32, 644 .lower_margin = 32,
645 .vsync_len = 3,
628 646
629 .lcdcon1 = 0x00000176, 647 .lcdcon1 = 0x00000176,
630 .lcdcon2 = 0x1d77c7c2, 648 .lcdcon2 = 0x1d77c7c2,
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 1c9d6c69b712..c0933b6c71b5 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -158,8 +158,10 @@ static struct s3c2410fb_display h1940_lcd __initdata = {
158 .bpp = 16, 158 .bpp = 16,
159 .left_margin = 20, 159 .left_margin = 20,
160 .right_margin = 8, 160 .right_margin = 8,
161 .hsync_len = 4,
161 .upper_margin = 8, 162 .upper_margin = 8,
162 .lower_margin = 7, 163 .lower_margin = 7,
164 .vsync_len = 1,
163}; 165};
164 166
165static struct s3c2410fb_mach_info h1940_fb_info __initdata = { 167static struct s3c2410fb_mach_info h1940_fb_info __initdata = {
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 98fbca2b7c20..50c0939a2492 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -125,8 +125,10 @@ static struct s3c2410fb_display qt2410_lcd_cfg[] __initdata = {
125 .bpp = 16, 125 .bpp = 16,
126 .left_margin = 44, 126 .left_margin = 44,
127 .right_margin = 116, 127 .right_margin = 116,
128 .hsync_len = 96,
128 .upper_margin = 19, 129 .upper_margin = 19,
129 .lower_margin = 11, 130 .lower_margin = 11,
131 .vsync_len = 15,
130 }, 132 },
131 { 133 {
132 /* Configuration for 480x640 toppoly TD028TTEC1 */ 134 /* Configuration for 480x640 toppoly TD028TTEC1 */
@@ -156,8 +158,10 @@ static struct s3c2410fb_display qt2410_lcd_cfg[] __initdata = {
156 .bpp = 16, 158 .bpp = 16,
157 .left_margin = 8, 159 .left_margin = 8,
158 .right_margin = 24, 160 .right_margin = 24,
161 .hsync_len = 8,
159 .upper_margin = 2, 162 .upper_margin = 2,
160 .lower_margin = 4, 163 .lower_margin = 4,
164 .vsync_len = 2,
161 }, 165 },
162 { 166 {
163 /* Config for 240x320 LCD */ 167 /* Config for 240x320 LCD */
@@ -187,8 +191,10 @@ static struct s3c2410fb_display qt2410_lcd_cfg[] __initdata = {
187 .bpp = 16, 191 .bpp = 16,
188 .left_margin = 13, 192 .left_margin = 13,
189 .right_margin = 8, 193 .right_margin = 8,
194 .hsync_len = 4,
190 .upper_margin = 2, 195 .upper_margin = 2,
191 .lower_margin = 7, 196 .lower_margin = 7,
197 .vsync_len = 4,
192 }, 198 },
193}; 199};
194 200
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index 9f874658a60d..da68b1fe923c 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -136,8 +136,10 @@ static struct s3c2410fb_display rx3715_lcdcfg __initdata = {
136 .bpp = 16, 136 .bpp = 16,
137 .left_margin = 36, 137 .left_margin = 36,
138 .right_margin = 36, 138 .right_margin = 36,
139 .hsync_len = 8,
139 .upper_margin = 6, 140 .upper_margin = 6,
140 .lower_margin = 7, 141 .lower_margin = 7,
142 .vsync_len = 3,
141}; 143};
142 144
143static struct s3c2410fb_mach_info rx3715_fb_info __initdata = { 145static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index f400eb7df5a8..2919e6bf02af 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -133,8 +133,10 @@ static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
133 .bpp = 16, 133 .bpp = 16,
134 .left_margin = 20, 134 .left_margin = 20,
135 .right_margin = 8, 135 .right_margin = 8,
136 .hsync_len = 4,
136 .upper_margin = 8, 137 .upper_margin = 8,
137 .lower_margin = 7, 138 .lower_margin = 7,
139 .vsync_len = 4,
138}; 140};
139 141
140static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = { 142static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index a30d538bc8c1..43749bd1fd67 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -290,6 +290,7 @@ static void s3c2410fb_calculate_stn_lcd_regs(const struct fb_info *info,
290 int type = regs->lcdcon1 & ~S3C2410_LCDCON1_TFT; 290 int type = regs->lcdcon1 & ~S3C2410_LCDCON1_TFT;
291 int hs = var->xres >> 2; 291 int hs = var->xres >> 2;
292 unsigned wdly = (var->left_margin >> 4) - 1; 292 unsigned wdly = (var->left_margin >> 4) - 1;
293 unsigned wlh = (var->hsync_len >> 4) - 1;
293 294
294 dprintk("%s: var->xres = %d\n", __FUNCTION__, var->xres); 295 dprintk("%s: var->xres = %d\n", __FUNCTION__, var->xres);
295 dprintk("%s: var->yres = %d\n", __FUNCTION__, var->yres); 296 dprintk("%s: var->yres = %d\n", __FUNCTION__, var->yres);
@@ -333,9 +334,15 @@ static void s3c2410fb_calculate_stn_lcd_regs(const struct fb_info *info,
333 if (wdly > 3) 334 if (wdly > 3)
334 wdly = 3; 335 wdly = 3;
335 336
337 if (wlh > 3)
338 wlh = 3;
339
336 regs->lcdcon3 = S3C2410_LCDCON3_WDLY(wdly) | 340 regs->lcdcon3 = S3C2410_LCDCON3_WDLY(wdly) |
337 S3C2410_LCDCON3_LINEBLANK(var->right_margin / 8) | 341 S3C2410_LCDCON3_LINEBLANK(var->right_margin / 8) |
338 S3C2410_LCDCON3_HOZVAL(hs - 1); 342 S3C2410_LCDCON3_HOZVAL(hs - 1);
343
344 regs->lcdcon4 &= ~S3C2410_LCDCON4_HSPW(0xff);
345 regs->lcdcon4 |= S3C2410_LCDCON4_HSPW(wlh);
339} 346}
340 347
341/* s3c2410fb_calculate_tft_lcd_regs 348/* s3c2410fb_calculate_tft_lcd_regs
@@ -383,14 +390,17 @@ static void s3c2410fb_calculate_tft_lcd_regs(const struct fb_info *info,
383 dprintk("setting horz: lft=%d, rt=%d, sync=%d\n", 390 dprintk("setting horz: lft=%d, rt=%d, sync=%d\n",
384 var->left_margin, var->right_margin, var->hsync_len); 391 var->left_margin, var->right_margin, var->hsync_len);
385 392
386 regs->lcdcon2 &= S3C2410_LCDCON2_VSPW(0x3f); 393 regs->lcdcon2 = S3C2410_LCDCON2_LINEVAL(var->yres - 1) |
387 regs->lcdcon2 |= S3C2410_LCDCON2_LINEVAL(var->yres - 1); 394 S3C2410_LCDCON2_VBPD(var->upper_margin - 1) |
388 regs->lcdcon2 |= S3C2410_LCDCON2_VBPD(var->upper_margin - 1); 395 S3C2410_LCDCON2_VFPD(var->lower_margin - 1) |
389 regs->lcdcon2 |= S3C2410_LCDCON2_VFPD(var->lower_margin - 1); 396 S3C2410_LCDCON2_VSPW(var->vsync_len - 1);
390 397
391 regs->lcdcon3 = S3C2410_LCDCON3_HBPD(var->right_margin - 1) | 398 regs->lcdcon3 = S3C2410_LCDCON3_HBPD(var->right_margin - 1) |
392 S3C2410_LCDCON3_HFPD(var->left_margin - 1) | 399 S3C2410_LCDCON3_HFPD(var->left_margin - 1) |
393 S3C2410_LCDCON3_HOZVAL(var->xres - 1); 400 S3C2410_LCDCON3_HOZVAL(var->xres - 1);
401
402 regs->lcdcon4 &= ~S3C2410_LCDCON4_HSPW(0xff);
403 regs->lcdcon4 |= S3C2410_LCDCON4_HSPW(var->hsync_len - 1);
394} 404}
395 405
396/* s3c2410fb_activate_var 406/* s3c2410fb_activate_var
@@ -410,16 +420,6 @@ static void s3c2410fb_activate_var(struct fb_info *info)
410 fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_TFT; 420 fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_TFT;
411 fbi->regs.lcdcon1 |= display->type; 421 fbi->regs.lcdcon1 |= display->type;
412 422
413 /* check to see if we need to update sync/borders */
414
415 if (!mach_info->fixed_syncs) {
416 fbi->regs.lcdcon2 =
417 S3C2410_LCDCON2_VSPW(var->vsync_len - 1);
418
419 fbi->regs.lcdcon4 &= ~S3C2410_LCDCON4_HSPW(0xff);
420 fbi->regs.lcdcon4 |= S3C2410_LCDCON4_HSPW(var->hsync_len - 1);
421 }
422
423 if (var->pixclock > 0) { 423 if (var->pixclock > 0) {
424 int clkdiv = s3c2410fb_calc_pixclk(fbi, var->pixclock); 424 int clkdiv = s3c2410fb_calc_pixclk(fbi, var->pixclock);
425 425
@@ -890,10 +890,8 @@ static int __init s3c2410fb_probe(struct platform_device *pdev)
890 890
891 fbinfo->var.upper_margin = display->upper_margin; 891 fbinfo->var.upper_margin = display->upper_margin;
892 fbinfo->var.lower_margin = display->lower_margin; 892 fbinfo->var.lower_margin = display->lower_margin;
893 fbinfo->var.vsync_len = 893 fbinfo->var.vsync_len = display->vsync_len;
894 S3C2410_LCDCON2_GET_VSPW(display->lcdcon2) + 1; 894 fbinfo->var.hsync_len = display->hsync_len;
895 fbinfo->var.hsync_len =
896 S3C2410_LCDCON4_GET_HSPW(display->lcdcon4) + 1;
897 895
898 fbinfo->var.red.offset = 11; 896 fbinfo->var.red.offset = 11;
899 fbinfo->var.green.offset = 5; 897 fbinfo->var.green.offset = 5;