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
6 This patch fixed LCD framebuffer driver data swap bug
9 Signed-off-by: Alison Wang <b18965@freescale.com>
11 drivers/video/fsl-ssd1289-fb.c | 13 ++++++++++---
12 1 files changed, 10 insertions(+), 3 deletions(-)
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++) {
19 spi_block_buffer[i] = 0x01;
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);
27 spi_block_buffer[i] = 0;
29 @@ -331,6 +333,9 @@ static int ssd1289fbd(void *arg)
31 unsigned short *buf_p;
32 struct fsl_ssd1289_fb_info *fbinfo = info->par;
33 +#if defined(CONFIG_SSD1289_FLEXBUS_MODE)
36 #if defined(CONFIG_SSD1289_SPI_MODE)
37 unsigned char *bufspi_p;
39 @@ -344,7 +349,9 @@ static int ssd1289fbd(void *arg)
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);
49 #elif defined(CONFIG_SSD1289_SPI_MODE)