b948d1f833436f8e3f97047542df4f736e12b57c
[openwrt/staging/blogic.git] /
1 From 633531cdbaa3ed70a364db78fd7f8ae11da3e394 Mon Sep 17 00:00:00 2001
2 From: Wang Huan <wanghuan@zch06.freescale.net>
3 Date: Wed, 14 Sep 2011 17:40:41 +0800
4 Subject: [PATCH] Fix LCD framebuffer driver data swap bug for MCF54418
5
6 This patch fixed LCD framebuffer driver data swap bug
7 for MCF54418.
8
9 Signed-off-by: Alison Wang <b18965@freescale.com>
10 ---
11 drivers/video/fsl-ssd1289-fb.c | 13 ++++++++++---
12 1 files changed, 10 insertions(+), 3 deletions(-)
13
14 --- a/drivers/video/fsl-ssd1289-fb.c
15 +++ b/drivers/video/fsl-ssd1289-fb.c
16 @@ -54,8 +54,10 @@ static int ssd1289_spi_writeblock(struct
17 for (i = 0; i < SPI_LCD_BLOCK_SIZE; i++) {
18 if (i % 2 == 0)
19 spi_block_buffer[i] = 0x01;
20 - else if (flag == 1)
21 - spi_block_buffer[i] = *(daddr + (i >> 1));
22 + else if ((flag == 1) && (i % 4 == 1))
23 + spi_block_buffer[i] = *(daddr + (i >> 1) + 1);
24 + else if ((flag == 1) && (i % 4 == 3))
25 + spi_block_buffer[i] = *(daddr + (i >> 1) - 1);
26 else if (flag == 0)
27 spi_block_buffer[i] = 0;
28 }
29 @@ -331,6 +333,9 @@ static int ssd1289fbd(void *arg)
30 int i;
31 unsigned short *buf_p;
32 struct fsl_ssd1289_fb_info *fbinfo = info->par;
33 +#if defined(CONFIG_SSD1289_FLEXBUS_MODE)
34 + unsigned short tmp;
35 +#endif
36 #if defined(CONFIG_SSD1289_SPI_MODE)
37 unsigned char *bufspi_p;
38 int count;
39 @@ -344,7 +349,9 @@ static int ssd1289fbd(void *arg)
40
41 #if defined(CONFIG_SSD1289_FLEXBUS_MODE)
42 for (i = 0; i < info->screen_size; i += 2) {
43 - ssd1289_write(info, *buf_p, 1);
44 + tmp = ((((*buf_p) & 0x00ff) << 8) |
45 + (((*buf_p) & 0xff00) >> 8));
46 + ssd1289_write(info, tmp, 1);
47 buf_p++;
48 }
49 #elif defined(CONFIG_SSD1289_SPI_MODE)