diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-19 18:29:12 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-19 06:08:15 -0500 |
commit | 9728c1b6a724daefc413b44e10253cdbb5e06d08 (patch) | |
tree | a5a820936dee258f023cfe78b1a3bbfa2a499ca2 /arch/arm/mach-versatile | |
parent | 95c34f831f0e06cda6dc0a26b4f693ed105c394d (diff) |
ARM: versatile: support CLCD RGB565 layout with blue LSB
RGB565 with blue in the LSB wasn't supported. Add support for this
layout.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r-- | arch/arm/mach-versatile/core.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 136c32e7ed8e..2866c114e682 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -630,18 +630,22 @@ static void versatile_clcd_disable(struct clcd_fb *fb) | |||
630 | */ | 630 | */ |
631 | static void versatile_clcd_enable(struct clcd_fb *fb) | 631 | static void versatile_clcd_enable(struct clcd_fb *fb) |
632 | { | 632 | { |
633 | struct fb_var_screeninfo *var = &fb->fb.var; | ||
633 | void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; | 634 | void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; |
634 | u32 val; | 635 | u32 val; |
635 | 636 | ||
636 | val = readl(sys_clcd); | 637 | val = readl(sys_clcd); |
637 | val &= ~SYS_CLCD_MODE_MASK; | 638 | val &= ~SYS_CLCD_MODE_MASK; |
638 | 639 | ||
639 | switch (fb->fb.var.green.length) { | 640 | switch (var->green.length) { |
640 | case 5: | 641 | case 5: |
641 | val |= SYS_CLCD_MODE_5551; | 642 | val |= SYS_CLCD_MODE_5551; |
642 | break; | 643 | break; |
643 | case 6: | 644 | case 6: |
644 | val |= SYS_CLCD_MODE_565_RLSB; | 645 | if (var->red.offset == 0) |
646 | val |= SYS_CLCD_MODE_565_RLSB; | ||
647 | else | ||
648 | val |= SYS_CLCD_MODE_565_BLSB; | ||
645 | break; | 649 | break; |
646 | case 8: | 650 | case 8: |
647 | val |= SYS_CLCD_MODE_888; | 651 | val |= SYS_CLCD_MODE_888; |
@@ -709,10 +713,19 @@ static void versatile_clcd_remove(struct clcd_fb *fb) | |||
709 | fb->fb.screen_base, fb->fb.fix.smem_start); | 713 | fb->fb.screen_base, fb->fb.fix.smem_start); |
710 | } | 714 | } |
711 | 715 | ||
716 | static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs) | ||
717 | { | ||
718 | clcdfb_decode(fb, regs); | ||
719 | |||
720 | /* Always clear BGR for RGB565: we do the routing externally */ | ||
721 | if (fb->fb.var.green.length == 6) | ||
722 | regs->cntl &= ~CNTL_BGR; | ||
723 | } | ||
724 | |||
712 | static struct clcd_board clcd_plat_data = { | 725 | static struct clcd_board clcd_plat_data = { |
713 | .name = "Versatile", | 726 | .name = "Versatile", |
714 | .check = clcdfb_check, | 727 | .check = clcdfb_check, |
715 | .decode = clcdfb_decode, | 728 | .decode = versatile_clcd_decode, |
716 | .disable = versatile_clcd_disable, | 729 | .disable = versatile_clcd_disable, |
717 | .enable = versatile_clcd_enable, | 730 | .enable = versatile_clcd_enable, |
718 | .setup = versatile_clcd_setup, | 731 | .setup = versatile_clcd_setup, |