summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-03-18 11:29:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-08-07 12:10:56 +0200
commitf497d0153a6b53b4cfd004de5f10b14bf630d852 (patch)
treec541967f2612fb28402a4bab3609462856da3ac5 /drivers
parent9b0e6db0da1ea433f38b8d952108746f3fc67304 (diff)
imxfb: calculate bpix value from bits_per_pixel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/imxfb.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 15a0ee6d8e23..a8c41cb60fff 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -33,6 +33,7 @@
#include <linux/math64.h>
#include <mach/imxfb.h>
+#include <mach/hardware.h>
/*
* Complain if VAR is out of range.
@@ -530,8 +531,24 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
lcd_clk / pcr);
}
+ switch (var->bits_per_pixel) {
+ case 32:
+ pcr |= PCR_BPIX_18;
+ break;
+ case 16:
+ default:
+ if (cpu_is_mx1())
+ pcr |= PCR_BPIX_12;
+ else
+ pcr |= PCR_BPIX_16;
+ break;
+ case 8:
+ pcr |= PCR_BPIX_8;
+ break;
+ }
+
/* add sync polarities */
- pcr |= fbi->pcr & ~0x3F;
+ pcr |= fbi->pcr & ~(0x3f | (7 << 25));
writel(pcr, fbi->regs + LCDC_PCR);
writel(fbi->pwmr, fbi->regs + LCDC_PWMR);