@@ -131,10 +131,8 @@ static int lcd_setup(void)
131
131
return 0 ;
132
132
}
133
133
134
- int lcd_init (void )
134
+ static void lcd_panel_setup (void )
135
135
{
136
- lcd_setup ();
137
-
138
136
writew (LCD_RESET_CLEAR , LCD_RESET_REG );
139
137
_usleep (20000 );
140
138
writew (LCD_RESET_SET , LCD_RESET_REG );
@@ -194,8 +192,6 @@ int lcd_init(void)
194
192
195
193
/* Memory Write -- prep for the first pixel to be written */
196
194
lcd_cmd (0x2c );
197
-
198
- return 0 ;
199
195
}
200
196
201
197
/* Fill pre-frame command buffer. These commands are sent out before
@@ -205,22 +201,6 @@ static void lcd_fill_cmd_buffer(void)
205
201
{
206
202
int ncommands = 0 ;
207
203
208
- #if 0
209
- /* Column set */
210
- lcd_cmd_slot (0x2a , ncommands ++ );
211
- lcd_dat_slot (0x00 , ncommands ++ );
212
- lcd_dat_slot (0x00 , ncommands ++ );
213
- lcd_dat_slot (0x00 , ncommands ++ );
214
- lcd_dat_slot (0xEF , ncommands ++ );
215
-
216
- /* Page address set */
217
- lcd_cmd_slot (0x2b , ncommands ++ );
218
- lcd_dat_slot (0x00 , ncommands ++ );
219
- lcd_dat_slot (0x00 , ncommands ++ );
220
- lcd_dat_slot (0x01 , ncommands ++ );
221
- lcd_dat_slot (0x3F , ncommands ++ );
222
- #endif
223
-
224
204
/* Memory write */
225
205
lcd_cmd_slot (0x2c , ncommands ++ );
226
206
@@ -231,7 +211,7 @@ static void lcd_fill_cmd_buffer(void)
231
211
LCD_AUTOCOPY_CTRL_REG );
232
212
}
233
213
234
- int lcd_start (void )
214
+ static int lcd_dma_setup (void )
235
215
{
236
216
/* Set up AUTOCOPY (i.e. freerunning mode) */
237
217
writel (LCD_FORMAT | (0x1f << LCD_AUTOCOPY_CTRL_PERIOD_SHIFT ),
@@ -252,14 +232,19 @@ int lcd_start(void)
252
232
writel (readl (LCD_AUTOCOPY_CTRL_REG ) | LCD_AUTOCOPY_CTRL_EN0 ,
253
233
LCD_AUTOCOPY_CTRL_REG );
254
234
255
- lcd_fill_cmd_buffer ();
256
-
257
235
/* Enable AUTOCOPY_CTRL command transfer */
258
236
writel (readl (LCD_AUTOCOPY_CTRL_REG )
259
237
| LCD_AUTOCOPY_CTRL_ENC
260
238
| LCD_AUTOCOPY_CTRL_SEND_RESIDUE ,
261
239
LCD_AUTOCOPY_CTRL_REG );
240
+ return 0 ;
241
+ }
262
242
243
+ int lcd_init (void )
244
+ {
245
+ lcd_setup ();
246
+ lcd_panel_setup ();
247
+ lcd_dma_setup ();
263
248
return 0 ;
264
249
}
265
250
0 commit comments