summaryrefslogtreecommitdiff
path: root/include/lcd.h
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-02-23 10:14:34 +0800
committerYe Li <ye.li@nxp.com>2018-04-27 02:21:17 -0700
commit21bf1c38b7d75c31875fb02a972c458f25d9c33a (patch)
treeab8d4f00dafba6f1ce2f930184c3bfd50a196eb9 /include/lcd.h
parent42a6fcbaf9f3a959462f857b31700383d20f7a56 (diff)
MLK-12425-2 video: epdc: introduce epdc support
Support EPDC. E-Ink feature is supported by i.MX6DL/SL/SLL/ULL and i.MX7D. This driver supports user defined logo file, if there is no logo file, it will draw a black border around a white screen. If need to enable EPDC, a waveform file is required to let all work. Since we need LCD_MONOCHROME mode for EPDC, we introduce LCD_MONOCHROME support. Please refer to Linux Reference Manual for how to flash WAVEFORM file. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Robby Cai <R63905@freescale.com> Signed-off-by: Nitin Garg <nitin.garg@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71)
Diffstat (limited to 'include/lcd.h')
-rw-r--r--include/lcd.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/include/lcd.h b/include/lcd.h
index 797d0b0de12..dd04b87a150 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -31,6 +31,7 @@ extern struct vidinfo panel_info;
void lcd_ctrl_init(void *lcdbase);
void lcd_enable(void);
void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue);
+void lcd_initcolregs (void);
/**
* Set whether we need to flush the dcache when changing the LCD image. This
@@ -47,6 +48,64 @@ void lcd_set_flush_dcache(int flush);
#include <atmel_lcd.h>
#elif defined(CONFIG_EXYNOS_FB)
#include <exynos_lcd.h>
+#elif defined(CONFIG_MXC_EPDC)
+
+struct waveform_modes {
+ int mode_init;
+ int mode_du;
+ int mode_gc4;
+ int mode_gc8;
+ int mode_gc16;
+ int mode_gc32;
+};
+
+struct epdc_timing_params {
+ int vscan_holdoff;
+ int sdoed_width;
+ int sdoed_delay;
+ int sdoez_width;
+ int sdoez_delay;
+ int gdclk_hp_offs;
+ int gdsp_offs;
+ int gdoe_offs;
+ int gdclk_offs;
+ int num_ce;
+};
+
+struct epdc_data_struct {
+ /* EPDC buffer pointers */
+ u_long working_buf_addr;
+ u_long waveform_buf_addr;
+
+ /* Waveform mode definitions */
+ struct waveform_modes wv_modes;
+ struct epdc_timing_params epdc_timings;
+};
+
+typedef struct vidinfo {
+ u_long vl_refresh; /* Refresh Rate Hz */
+ u_long vl_row; /* resolution in x */
+ u_long vl_col; /* resolution in y */
+ u_long vl_rot;
+ u_long vl_pixclock; /* pixel clock in picoseconds */
+ u_long vl_left_margin; /* Horizontal back porch */
+ u_long vl_right_margin; /* Horizontal front porch */
+ u_long vl_upper_margin; /* Vertical back porch */
+ u_long vl_lower_margin; /* Vertical front porch */
+ u_long vl_hsync; /* Horizontal sync pulse length */
+ u_long vl_vsync; /* Vertical sync pulse length */
+ u_long vl_sync; /* Polarity on data enable */
+ u_long vl_mode; /* Video Mode */
+ u_long vl_flag;
+ u_char vl_bpix;
+ ushort *cmap;
+ struct epdc_data_struct epdc_data;
+} vidinfo_t;
+
+static __maybe_unused ushort *configuration_get_cmap(void)
+{
+ return panel_info.cmap;
+}
#else
typedef struct vidinfo {
ushort vl_col; /* Number of columns (i.e. 160) */
@@ -163,6 +222,16 @@ void lcd_sync(void);
#define LCD_BPP LCD_COLOR8
#endif
+#if LCD_BPP == LCD_MONOCHROME
+# define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \
+ (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7)
+#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
+ (LCD_BPP == LCD_COLOR32)
+# define COLOR_MASK(c) (c)
+#else
+#error Unsupported LCD BPP.
+#endif
+
#ifndef LCD_DF
#define LCD_DF 1
#endif
@@ -171,7 +240,14 @@ void lcd_sync(void);
#define NBITS(bit_code) (1 << (bit_code))
#define NCOLORS(bit_code) (1 << NBITS(bit_code))
-#if LCD_BPP == LCD_COLOR8
+#if LCD_BPP == LCD_MONOCHROME
+/*
+ * Simple black/white definitions
+ */
+# define CONSOLE_COLOR_BLACK 0
+# define CONSOLE_COLOR_WHITE 1 /* Must remain last / highest */
+
+#elif LCD_BPP == LCD_COLOR8
# define CONSOLE_COLOR_BLACK 0
# define CONSOLE_COLOR_RED 1
# define CONSOLE_COLOR_GREEN 2