blob: 3ab442426177c760444603c5c911d532c73be799 [file] [log] [blame]
#include "lcd.h"
#include "st7735.c"
#include "gc9106.c"
#include "logo.c"
static void panel_init(void *sequence)
{
struct lcd_cmd *array = (struct lcd_cmd *)sequence;
if (!array) {
printf("Warning: null init sequence.\n");
return;
}
while (array->type != CMD_TYPE_END) {
switch (array->type) {
case CMD_TYPE_START:
break;
case CMD_TYPE_CMD:
lcd_write_cmd(array->data);
break;
case CMD_TYPE_DATA:
lcd_write_data(array->data);
break;
case CMD_TYPE_DELAY:
mdelay(array->data);
break;
}
array++;
}
pr_info("Panel: init done.\n");
}
int spi_lcd_init(void)
{
int ret;
int panel;
void *seq = NULL;
if (panel == PANEL_ST7735)
seq = st7735_init_sequence;
else if (panel == PANEL_GC9102)
/* use same seq as st7735 */
seq = st7735_init_sequence;
else if (panel == PANEL_GC9106)
seq = gc9106_init_sequence;
panel_init(seq);
return panel;
}