diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-03-31 15:25:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 08:59:28 -0700 |
commit | dd14f71cc62dd07b588cc6de935155e6fd3911c9 (patch) | |
tree | d046369dd130cf4ce16c75d61377e0dda79ce9ea /drivers/video | |
parent | 7cade31cabec33c396b1dfd9c2842e793c2648ef (diff) | |
download | op-kernel-dev-dd14f71cc62dd07b588cc6de935155e6fd3911c9.zip op-kernel-dev-dd14f71cc62dd07b588cc6de935155e6fd3911c9.tar.gz |
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')
-rw-r--r-- | drivers/video/cirrusfb.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 65a1831..15e2e6b 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, /* If the frequency is greater than we can support, we might be able * to use multiplexing for the video mode */ if (freq > maxclock) { + dev_err(info->device, + "Frequency greater than maxclock (%ld kHz)\n", + maxclock); + return -EINVAL; + } + /* + * Additional constraint: 8bpp uses DAC clock doubling to allow maximum + * pixel clock + */ + if (var->bits_per_pixel == 8) { switch (cinfo->btype) { case BT_ALPINE: + case BT_PICASSO4: + if (freq > 85500) + cinfo->multiplexing = 1; + break; case BT_GD5480: - cinfo->multiplexing = 1; + if (freq > 135100) + cinfo->multiplexing = 1; break; default: @@ -815,6 +830,8 @@ static int cirrusfb_set_par_foo(struct fb_info *info) freq = PICOS2KHZ(var->pixclock); if (cinfo->btype == BT_ALPINE && var->bits_per_pixel == 24) freq *= 3; + if (cinfo->multiplexing) + freq /= 2; bestclock(freq, &nom, &den, &div); |