aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c2410fb.c
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 /drivers/video/s3c2410fb.c
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>
Diffstat (limited to 'drivers/video/s3c2410fb.c')
-rw-r--r--drivers/video/s3c2410fb.c34
1 files changed, 16 insertions, 18 deletions
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;