summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Minnick <michael.minnick@freescale.com>2012-10-09 18:06:31 -0500
committerMichael Minnick <michael.minnick@freescale.com>2012-10-12 11:51:48 -0500
commitb8c142d2e7cfc27b98990d39305b52d2208cb36e (patch)
tree3e02afe76a06a8d001b0335d3fe0259a539ceb51
parent1f82d60280ffa934968815547df2b231931dbd89 (diff)
ENGR00229290 EPDC: MX6: Adjust number of LUTs for 5-bit waveform
When a 5-bit waveform is loaded, the maximum number of available LUTs is 16. The LUT allocator must account for this. Note that 5-bit waveform loading is currently not supported in the driver. However, this fix makes sure the LUT allocator is correct when 5-bit support is added. Signed-off-by: Michael Minnick <michael.minnick@freescale.com>
-rw-r--r--drivers/video/mxc/mxc_epdc_fb.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c
index b702788ae823..38a183c8d861 100644
--- a/drivers/video/mxc/mxc_epdc_fb.c
+++ b/drivers/video/mxc/mxc_epdc_fb.c
@@ -735,18 +735,24 @@ static int epdc_choose_next_lut(int rev, int *next_lut)
{
u64 luts_status, unprocessed_luts;
bool next_lut_found = false;
+ /* Available LUTs are reduced to 16 in 5-bit waveform mode */
+ u32 format_p5n = __raw_readl(EPDC_FORMAT) &
+ EPDC_FORMAT_BUF_PIXEL_FORMAT_P5N;
luts_status = __raw_readl(EPDC_STATUS_LUTS);
- if (rev < 20)
+ if ((rev < 20) || format_p5n)
luts_status &= 0xFFFF;
else
luts_status |= ((u64)__raw_readl(EPDC_STATUS_LUTS2) << 32);
- if (rev < 20)
+ if (rev < 20) {
unprocessed_luts = __raw_readl(EPDC_IRQ) & 0xFFFF;
- else
+ } else {
unprocessed_luts = __raw_readl(EPDC_IRQ1) |
((u64)__raw_readl(EPDC_IRQ2) << 32);
+ if (format_p5n)
+ unprocessed_luts &= 0xFFFF;
+ }
while (!next_lut_found) {
/*
@@ -762,7 +768,7 @@ static int epdc_choose_next_lut(int rev, int *next_lut)
*/
*next_lut = fls64(luts_status);
- if (rev < 20) {
+ if ((rev < 20) || format_p5n) {
if (*next_lut > 15)
*next_lut = ffz(luts_status);
} else {