summaryrefslogtreecommitdiff
path: root/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/olympus/mrobe-100/lcd-mr100.c')
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-mr100.c131
1 files changed, 65 insertions, 66 deletions
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
index 501a0942e5..bf751f47a9 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
@@ -21,48 +21,48 @@
21#include "lcd.h" 21#include "lcd.h"
22#include "kernel.h" 22#include "kernel.h"
23#include "system.h" 23#include "system.h"
24 24
25/* send LCD data */ 25/* send LCD data */
26static void lcd_send_data(unsigned data) 26static void lcd_send_data(unsigned data)
27{ 27{
28 while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */ 28 while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */
29 LCD1_DATA = data; 29 LCD1_DATA = data;
30} 30}
31 31
32/* send LCD command */ 32/* send LCD command */
33static void lcd_send_command(unsigned cmd) 33static void lcd_send_command(unsigned cmd)
34{ 34{
35 while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */ 35 while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */
36 LCD1_CMD = cmd; 36 LCD1_CMD = cmd;
37} 37}
38 38
39/* LCD init */ 39/* LCD init */
40void lcd_init_device(void) 40void lcd_init_device(void)
41{ 41{
42 int i; 42 int i;
43 43
44 DEV_INIT1 &= ~0xfc000000; 44 DEV_INIT1 &= ~0xfc000000;
45 45
46 i = DEV_INIT1; 46 i = DEV_INIT1;
47 DEV_INIT1 = i; 47 DEV_INIT1 = i;
48 48
49 DEV_INIT2 &= ~0x400; 49 DEV_INIT2 &= ~0x400;
50 udelay(10000); 50 udelay(10000);
51 51
52 LCD1_CONTROL &= ~0x4; 52 LCD1_CONTROL &= ~0x4;
53 udelay(15); 53 udelay(15);
54 54
55 LCD1_CONTROL |= 0x4; 55 LCD1_CONTROL |= 0x4;
56 udelay(10); 56 udelay(10);
57 57
58 LCD1_CONTROL = 0x690; 58 LCD1_CONTROL = 0x690;
59 LCD1_CONTROL = 0x694; 59 LCD1_CONTROL = 0x694;
60 60
61 /* OF just reads these */ 61 /* OF just reads these */
62 i = LCD1_CONTROL; 62 i = LCD1_CONTROL;
63 i = inl(0x70003004); 63 i = inl(0x70003004);
64 i = LCD1_CMD; 64 i = LCD1_CMD;
65 i = inl(0x7000300c); 65 i = inl(0x7000300c);
66 66
67#if 0 67#if 0
68 /* this is skipped in the OF */ 68 /* this is skipped in the OF */
@@ -70,30 +70,30 @@ void lcd_init_device(void)
70 LCD1_CONTROL &= ~0x800; 70 LCD1_CONTROL &= ~0x800;
71 LCD1_CONTROL &= ~0x400; 71 LCD1_CONTROL &= ~0x400;
72#endif 72#endif
73 73
74 LCD1_CONTROL |= 0x1; 74 LCD1_CONTROL |= 0x1;
75 udelay(15000); 75 udelay(15000);
76 76
77 lcd_send_command(0xe2); 77 lcd_send_command(0xe2);
78 lcd_send_command(0x2f); 78 lcd_send_command(0x2f);
79 lcd_send_command(0x26); 79 lcd_send_command(0x26);
80 lcd_send_command(0xcc); 80 lcd_send_command(0xcc);
81 lcd_send_command(0xe8); 81 lcd_send_command(0xe8);
82 lcd_send_command(0x81); 82 lcd_send_command(0x81);
83 lcd_send_command(0); 83 lcd_send_command(0);
84 lcd_send_command(0x40); 84 lcd_send_command(0x40);
85 lcd_send_command(0xa6); 85 lcd_send_command(0xa6);
86 lcd_send_command(0x88); 86 lcd_send_command(0x88);
87 lcd_send_command(0xb0); 87 lcd_send_command(0xb0);
88 lcd_send_command(0x10); 88 lcd_send_command(0x10);
89 lcd_send_command(0); 89 lcd_send_command(0);
90} 90}
91 91
92/*** hardware configuration ***/ 92/*** hardware configuration ***/
93int lcd_default_contrast(void) 93int lcd_default_contrast(void)
94{ 94{
95 return DEFAULT_CONTRAST_SETTING; 95 return DEFAULT_CONTRAST_SETTING;
96} 96}
97 97
98void lcd_set_contrast(int val) 98void lcd_set_contrast(int val)
99{ 99{
@@ -117,8 +117,8 @@ void lcd_set_flip(bool yesno)
117/*** update functions ***/ 117/*** update functions ***/
118 118
119/* Performance function that works with an external buffer 119/* Performance function that works with an external buffer
120 note that by and bheight are in 4-pixel units! */ 120 note that by and bheight are in 8-pixel units! */
121void lcd_blit(const fb_data* data, int x, int by, int width, 121void lcd_blit(const unsigned char* data, int x, int by, int width,
122 int bheight, int stride) 122 int bheight, int stride)
123{ 123{
124 /* TODO: Implement lcd_blit() */ 124 /* TODO: Implement lcd_blit() */
@@ -130,19 +130,18 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
130 (void)stride; 130 (void)stride;
131} 131}
132 132
133/* Performance function to blit a YUV bitmap directly to the LCD */ 133/* Performance function that works with an external buffer
134void lcd_yuv_blit(unsigned char * const src[3], 134 note that by and bheight are in 4-pixel units! */
135 int src_x, int src_y, int stride, 135void lcd_grey_phase_blit(const struct grey_data *data, int x, int by,
136 int x, int y, int width, int height) 136 int width, int bheight, int stride)
137{ 137{
138 (void)src; 138 /* TODO: Implement lcd_grey_phase_blit() */
139 (void)src_x; 139 (void)data;
140 (void)src_y;
141 (void)stride;
142 (void)x; 140 (void)x;
143 (void)y; 141 (void)by;
144 (void)width; 142 (void)width;
145 (void)height; 143 (void)bheight;
144 (void)stride;
146} 145}
147 146
148/* Update the display. 147/* Update the display.
@@ -151,9 +150,9 @@ void lcd_update(void)
151{ 150{
152 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); 151 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
153} 152}
154 153
155/* Update a fraction of the display. */ 154/* Update a fraction of the display. */
156void lcd_update_rect(int x0, int y0, int width, int height) 155void lcd_update_rect(int x0, int y0, int width, int height)
157{ 156{
158 unsigned char *addr; 157 unsigned char *addr;
159 unsigned int cmd0, cmd1, cmd2; 158 unsigned int cmd0, cmd1, cmd2;
@@ -189,4 +188,4 @@ void lcd_update_rect(int x0, int y0, int width, int height)
189 } 188 }
190 189
191 lcd_send_command(0xaf); 190 lcd_send_command(0xaf);
192} 191}