Skip to content

Commit c2d17ff

Browse files
author
Sean Cross
committed
lcd: get rid of lcd_setup()
Combine init and setup into one function, and call it lcd_init(). Signed-off-by: Sean Cross <[email protected]>
1 parent 58d7c3b commit c2d17ff

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

include/lcd.h

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ static inline pixel_t rgb(unsigned r, unsigned g, unsigned b)
1414
}
1515

1616
int lcd_init(void);
17-
int lcd_start(void);
1817
int lcd_run(void);
1918
int lcd_stop(void);
2019

lcd.c

+9-24
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ static int lcd_setup(void)
131131
return 0;
132132
}
133133

134-
int lcd_init(void)
134+
static void lcd_panel_setup(void)
135135
{
136-
lcd_setup();
137-
138136
writew(LCD_RESET_CLEAR, LCD_RESET_REG);
139137
_usleep(20000);
140138
writew(LCD_RESET_SET, LCD_RESET_REG);
@@ -194,8 +192,6 @@ int lcd_init(void)
194192

195193
/* Memory Write -- prep for the first pixel to be written */
196194
lcd_cmd(0x2c);
197-
198-
return 0;
199195
}
200196

201197
/* Fill pre-frame command buffer. These commands are sent out before
@@ -205,22 +201,6 @@ static void lcd_fill_cmd_buffer(void)
205201
{
206202
int ncommands = 0;
207203

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-
224204
/* Memory write */
225205
lcd_cmd_slot(0x2c, ncommands++);
226206

@@ -231,7 +211,7 @@ static void lcd_fill_cmd_buffer(void)
231211
LCD_AUTOCOPY_CTRL_REG);
232212
}
233213

234-
int lcd_start(void)
214+
static int lcd_dma_setup(void)
235215
{
236216
/* Set up AUTOCOPY (i.e. freerunning mode) */
237217
writel(LCD_FORMAT | (0x1f << LCD_AUTOCOPY_CTRL_PERIOD_SHIFT),
@@ -252,14 +232,19 @@ int lcd_start(void)
252232
writel(readl(LCD_AUTOCOPY_CTRL_REG) | LCD_AUTOCOPY_CTRL_EN0,
253233
LCD_AUTOCOPY_CTRL_REG);
254234

255-
lcd_fill_cmd_buffer();
256-
257235
/* Enable AUTOCOPY_CTRL command transfer */
258236
writel(readl(LCD_AUTOCOPY_CTRL_REG)
259237
| LCD_AUTOCOPY_CTRL_ENC
260238
| LCD_AUTOCOPY_CTRL_SEND_RESIDUE,
261239
LCD_AUTOCOPY_CTRL_REG);
240+
return 0;
241+
}
262242

243+
int lcd_init(void)
244+
{
245+
lcd_setup();
246+
lcd_panel_setup();
247+
lcd_dma_setup();
263248
return 0;
264249
}
265250

0 commit comments

Comments
 (0)