aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cirrusfb.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-03-31 18:25:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:28 -0400
commitdd14f71cc62dd07b588cc6de935155e6fd3911c9 (patch)
treed046369dd130cf4ce16c75d61377e0dda79ce9ea /drivers/video/cirrusfb.c
parent7cade31cabec33c396b1dfd9c2842e793c2648ef (diff)
cirrusfb: fix clock doubling
Cirrus' Alpine and Picasso4 chips uses DAC clock doubling to achieve full range of pixclock frequencies. [akpm@linux-foundation.org: fix spelling, use usual comment layout] Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/cirrusfb.c')
-rw-r--r--drivers/video/cirrusfb.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 65a1831ddd0d..15e2e6bfcbff 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -470,10 +470,25 @@ static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var,
470 /* If the frequency is greater than we can support, we might be able 470 /* If the frequency is greater than we can support, we might be able
471 * to use multiplexing for the video mode */ 471 * to use multiplexing for the video mode */
472 if (freq > maxclock) { 472 if (freq > maxclock) {
473 dev_err(info->device,
474 "Frequency greater than maxclock (%ld kHz)\n",
475 maxclock);
476 return -EINVAL;
477 }
478 /*
479 * Additional constraint: 8bpp uses DAC clock doubling to allow maximum
480 * pixel clock
481 */
482 if (var->bits_per_pixel == 8) {
473 switch (cinfo->btype) { 483 switch (cinfo->btype) {
474 case BT_ALPINE: 484 case BT_ALPINE:
485 case BT_PICASSO4:
486 if (freq > 85500)
487 cinfo->multiplexing = 1;
488 break;
475 case BT_GD5480: 489 case BT_GD5480:
476 cinfo->multiplexing = 1; 490 if (freq > 135100)
491 cinfo->multiplexing = 1;
477 break; 492 break;
478 493
479 default: 494 default:
@@ -815,6 +830,8 @@ static int cirrusfb_set_par_foo(struct fb_info *info)
815 freq = PICOS2KHZ(var->pixclock); 830 freq = PICOS2KHZ(var->pixclock);
816 if (cinfo->btype == BT_ALPINE && var->bits_per_pixel == 24) 831 if (cinfo->btype == BT_ALPINE && var->bits_per_pixel == 24)
817 freq *= 3; 832 freq *= 3;
833 if (cinfo->multiplexing)
834 freq /= 2;
818 835
819 bestclock(freq, &nom, &den, &div); 836 bestclock(freq, &nom, &den, &div);
820 837