Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
#define PCR_BPIX_4 (2 << 25)
#define PCR_BPIX_8 (3 << 25)
#define PCR_BPIX_12 (4 << 25)
-#define PCR_BPIX_16 (4 << 25)
+#define PCR_BPIX_16 (5 << 25)
+#define PCR_BPIX_18 (6 << 25)
#define PCR_PIXPOL (1 << 24)
#define PCR_FLMPOL (1 << 23)
#define PCR_LPPOL (1 << 22)
#include <linux/math64.h>
#include <mach/imxfb.h>
+#include <mach/hardware.h>
/*
* Complain if VAR is out of range.
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);