summaryrefslogtreecommitdiff
path: root/common/cmd_lcd.c
blob: bf4d55a1c1956dae42bbc34601f2e753eef4eeb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * (C) Copyright 2005
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#include <common.h>
#include <command.h>
#include <led-display.h>

#undef DEBUG_LCD

#ifdef CONFIG_USE_LCD
extern void Lcd_read_bootlogo(void);
extern void Backlight_Turnon(void);
extern void Display_Turnon(void);
extern void Display_Turnoff(void);
extern void Display_Start(void);
extern void s5p_lcd_draw_bootlogo(void);
extern void LCD_setprogress(int percentage);
extern void LCD_clear_content(void);
#endif

int do_lcd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	char cmd;

	if (argc < 2)
		return (0);

	cmd=argv[1][0];

	switch(cmd-'0')
	{
		case 0:
			printf("turnon\n");
			Display_Turnon();
			mdelay(200);
			Display_Start();
			Backlight_Turnon();
			break;
		case 1:
			printf("turnoff\n");
			Display_Turnoff();
			break;
		case 2:
			printf("clear with black color\n");
			LCD_clear_content();
			break;
		case 3:
			printf("showprog with 100%\n");
			LCD_setprogress(100);
			break;
		case 4:
			printf("turnon_clear_black\n");
			Display_Turnon();
			LCD_clear_content();
			Backlight_Turnon();
			break;
		default:
			switch(cmd-'a')
			{
				default:
					printf("unknown command\n");
					return (0);
			}
	}

	return (0);
}

/***************************************************/

U_BOOT_CMD(
	lcd,	CONFIG_SYS_MAXARGS,	2,	do_lcd,
	"control lcd for MIPI",
	"<command number> [argument]\n"
	"    - turnon : 0\n"
	"    - turnoff : 1\n"
	"    - clear : 2, clear with 0x00000000 color\n"
	"    - showprog : 3, arguments is percentage, decimal\n"
	"    - clear_turnon : 4, turnon and clear with black color\n"
);