summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-08-23 14:19:28 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 12:28:31 -0700
commitc2f925d1a5fadbfd91d4ab50228b3a06a801c89c (patch)
treea963d44c5de5b24320a37947d46acc8ac2ffc8f6 /drivers
parenta0fc3d569ad6f695852599e34c6f4245120ea8bf (diff)
native: Add test LCD driver
This basic driver has stubs for the required functions but has no test functionality. BUG=chromium-os:19353 TEST=build for Seaboard Change-Id: I14ffb32fb17c0e3fa942e0df4a53d2d77fdc8ca7 Reviewed-on: http://gerrit.chromium.org/gerrit/6523 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/test_lcd.c95
2 files changed, 96 insertions, 0 deletions
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 6350eba4dd..1626353133 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -43,6 +43,7 @@ COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
COBJS-$(CONFIG_VIDEO_TEGRA2) += tegra2.o
COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
COBJS-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
+COBJS-$(CONFIG_VIDEO_TEST) += test_lcd.o
COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
diff --git a/drivers/video/test_lcd.c b/drivers/video/test_lcd.c
new file mode 100644
index 0000000000..6bdc2d9886
--- /dev/null
+++ b/drivers/video/test_lcd.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <lcd.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int lcd_line_length;
+int lcd_color_fg;
+int lcd_color_bg;
+
+void *lcd_base; /* Start of framebuffer memory */
+void *lcd_console_address; /* Start of console buffer */
+
+short console_col;
+short console_row;
+
+vidinfo_t panel_info = {
+ .vl_col = 640,
+ .vl_row = 480,
+ .vl_bpix = 8,
+};
+
+char lcd_cursor_enabled; /* set initial value to false */
+
+ushort lcd_cursor_width;
+ushort lcd_cursor_height;
+
+void lcd_cursor_size(ushort width, ushort height)
+{
+ lcd_cursor_width = width;
+ lcd_cursor_height = height;
+}
+
+void lcd_toggle_cursor(void)
+{
+}
+
+void lcd_cursor_on(void)
+{
+ lcd_cursor_enabled = 1;
+ lcd_toggle_cursor();
+}
+void lcd_cursor_off(void)
+{
+ lcd_cursor_enabled = 0;
+ lcd_toggle_cursor();
+}
+
+char lcd_is_cursor_enabled(void)
+{
+ return lcd_cursor_enabled;
+}
+
+/*
+ * Main init function called by lcd driver.
+ * Inits and then prints test pattern if required.
+ */
+
+void lcd_ctrl_init(void *lcdbase)
+{
+}
+
+ulong calc_fbsize(void)
+{
+ return (panel_info.vl_col * panel_info.vl_row *
+ NBITS(panel_info.vl_bpix)) / 8;
+}
+
+void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
+{
+}
+
+void lcd_enable(void)
+{
+}