18 #include <linux/kernel.h>
19 #include <linux/module.h>
32 static const unsigned char data_frame_if[] = {
39 static const unsigned char data_panel[] = {
42 0x04, 0x00, 0x00, 0x04, 0x11, 0x00, 0x00,
45 static const unsigned char data_timing[] = {
46 0x00, 0x00, 0x13, 0x08, 0x08,
49 static const unsigned char data_timing_src[] = {
50 0x11, 0x01, 0x00, 0x01,
53 static const unsigned char data_gamma[] = {
54 0x01, 0x02, 0x08, 0x23, 0x03, 0x0c, 0x00, 0x06, 0x00, 0x00,
55 0x01, 0x00, 0x0c, 0x23, 0x03, 0x08, 0x02, 0x06, 0x00, 0x00,
58 static const unsigned char data_power[] = {
59 0x07, 0xc5, 0xdc, 0x02, 0x33, 0x0a,
62 static unsigned long read_reg(
void *sohandle,
70 int i,
unsigned long v)
78 static void write_data(
void *sohandle,
80 unsigned char const *
data,
int no_data)
84 for (i = 0; i < no_data; i++)
88 static unsigned long read_device_code(
void *sohandle,
91 unsigned long device_code;
109 device_code = ((
read_reg(sohandle, so) & 0xff) << 24);
110 device_code |= ((
read_reg(sohandle, so) & 0xff) << 16);
111 device_code |= ((
read_reg(sohandle, so) & 0xff) << 8);
112 device_code |= (
read_reg(sohandle, so) & 0xff);
117 static void write_memory_start(
void *sohandle,
123 static void clear_memory(
void *sohandle,
129 write_memory_start(sohandle, so);
132 for (i = 0; i < (240 * 400); i++)
136 static void display_on(
void *sohandle,
149 write_data(sohandle, so, data_frame_if,
ARRAY_SIZE(data_frame_if));
157 write_data(sohandle, so, data_panel,
ARRAY_SIZE(data_panel));
161 write_data(sohandle, so, data_timing,
ARRAY_SIZE(data_timing));
165 write_data(sohandle, so, data_timing,
ARRAY_SIZE(data_timing));
169 write_data(sohandle, so, data_timing,
ARRAY_SIZE(data_timing));
173 write_data(sohandle, so, data_timing_src,
ARRAY_SIZE(data_timing_src));
177 write_data(sohandle, so, data_gamma,
ARRAY_SIZE(data_gamma));
181 write_data(sohandle, so, data_gamma,
ARRAY_SIZE(data_gamma));
185 write_data(sohandle, so, data_gamma,
ARRAY_SIZE(data_gamma));
189 write_data(sohandle, so, data_power,
ARRAY_SIZE(data_power));
245 clear_memory(sohandle, so);
251 write_memory_start(sohandle, so);
266 if (read_device_code(sohandle, so) != 0x01221517)
269 pr_info(
"KFR2R09 WQVGA LCD Module detected.\n");
271 display_on(sohandle, so);
277 write_memory_start(sohandle, so);
280 #define CTRL_CKSW 0x10
281 #define CTRL_C10 0x20
282 #define CTRL_CPSW 0x80
283 #define MAIN_MLED4 0x40
284 #define MAIN_MSW 0x80
286 static int kfr2r09_lcd_backlight(
int on)
290 unsigned char buf[2];
330 kfr2r09_lcd_backlight(1);
335 kfr2r09_lcd_backlight(0);