]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cobalt_lcdfb: LCD panel framebuffer support for SEAD-3 platform.
authorSteven J. Hill <sjhill@mips.com>
Wed, 18 Apr 2012 14:13:51 +0000 (09:13 -0500)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 29 Apr 2012 19:34:05 +0000 (19:34 +0000)
Add support for LCD panel on MIPS SEAD-3 development platform.

Signed-off-by: Douglas Leung <douglas@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/Kconfig
drivers/video/cobalt_lcdfb.c

index a290be51a1f4a2f412aa80976c85a396eb60db30..edc2a22d289e394c4895145b8e503697912c1ca5 100644 (file)
@@ -2210,7 +2210,7 @@ config FB_XILINX
 
 config FB_COBALT
        tristate "Cobalt server LCD frame buffer support"
-       depends on FB && MIPS_COBALT
+       depends on FB && (MIPS_COBALT || MIPS_SEAD3)
 
 config FB_SH7760
        bool "SH7760/SH7763/SH7720/SH7721 LCDC support"
index f56699d8122a381047bdcb345d44e1cabbb4414f..eae46f6457e2a59788c1fbd46995cab8ea6739c4 100644 (file)
@@ -1,7 +1,8 @@
 /*
- *  Cobalt server LCD frame buffer driver.
+ *  Cobalt/SEAD3 LCD frame buffer driver.
  *
  *  Copyright (C) 2008  Yoichi Yuasa <yuasa@linux-mips.org>
+ *  Copyright (C) 2012  MIPS Technologies, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -62,6 +63,7 @@
 #define LCD_CUR_POS(x)         ((x) & LCD_CUR_POS_MASK)
 #define LCD_TEXT_POS(x)                ((x) | LCD_TEXT_MODE)
 
+#ifdef CONFIG_MIPS_COBALT
 static inline void lcd_write_control(struct fb_info *info, u8 control)
 {
        writel((u32)control << 24, info->screen_base);
@@ -81,6 +83,47 @@ static inline u8 lcd_read_data(struct fb_info *info)
 {
        return readl(info->screen_base + LCD_DATA_REG_OFFSET) >> 24;
 }
+#else
+
+#define LCD_CTL                        0x00
+#define LCD_DATA               0x08
+#define CPLD_STATUS            0x10
+#define CPLD_DATA              0x18
+
+static inline void cpld_wait(struct fb_info *info)
+{
+       do {
+       } while (readl(info->screen_base + CPLD_STATUS) & 1);
+}
+
+static inline void lcd_write_control(struct fb_info *info, u8 control)
+{
+       cpld_wait(info);
+       writel(control, info->screen_base + LCD_CTL);
+}
+
+static inline u8 lcd_read_control(struct fb_info *info)
+{
+       cpld_wait(info);
+       readl(info->screen_base + LCD_CTL);
+       cpld_wait(info);
+       return readl(info->screen_base + CPLD_DATA) & 0xff;
+}
+
+static inline void lcd_write_data(struct fb_info *info, u8 data)
+{
+       cpld_wait(info);
+       writel(data, info->screen_base + LCD_DATA);
+}
+
+static inline u8 lcd_read_data(struct fb_info *info)
+{
+       cpld_wait(info);
+       readl(info->screen_base + LCD_DATA);
+       cpld_wait(info);
+       return readl(info->screen_base + CPLD_DATA) & 0xff;
+}
+#endif
 
 static int lcd_busy_wait(struct fb_info *info)
 {