1 /* drivers/video/sc8800g/sc8800g_lcd.h
3 * Spreadtrum LCD abstraction
5 * Copyright (C) 2010 Spreadtrum.com
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef _SC8800G_LCD_H_
18 #define _SC8800G_LCD_H_
20 #include <linux/types.h>
23 #define LCD_MODE_RGB 0
24 #define LCD_MODE_MCU 1
27 #define LCD_BUS_8080 0
28 #define LCD_BUS_6800 1
32 #define LCD_DIRECT_NORMAL 0
33 #define LCD_DIRECT_ROT_90 1
34 #define LCD_DIRECT_ROT_180 2
35 #define LCD_DIRECT_ROT_270 3
36 #define LCD_DIRECT_MIR_H 4
37 #define LCD_DIRECT_MIR_V 5
38 #define LCD_DIRECT_MIR_HV 6
43 struct lcd_operations {
44 int32_t (*lcd_init)(struct lcd_spec *self);
45 int32_t (*lcd_close)(struct lcd_spec *self);
46 int32_t (*lcd_reset)(struct lcd_spec *self);
47 int32_t (*lcd_enter_sleep)(struct lcd_spec *self, uint8_t is_sleep);
48 int32_t (*lcd_set_contrast)(struct lcd_spec *self, uint16_t contrast);
49 int32_t (*lcd_set_brightness)(struct lcd_spec *self,
51 int32_t (*lcd_set_window)(struct lcd_spec *self,
52 uint16_t left, uint16_t top,
53 uint16_t right, uint16_t bottom);
54 int32_t (*lcd_invalidate)(struct lcd_spec *self);
55 int32_t (*lcd_invalidate_rect)(struct lcd_spec *self,
56 uint16_t left, uint16_t top,
57 uint16_t right, uint16_t bottom);
58 int32_t (*lcd_rotate_invalidate_rect)(struct lcd_spec *self,
59 uint16_t left, uint16_t top,
60 uint16_t right, uint16_t bottom,
62 int32_t (*lcd_set_direction)(struct lcd_spec *self, uint16_t direction);
63 uint32_t (*lcd_readid)(struct lcd_spec *self);
66 /* RGB LCD specific properties */
77 int32_t (*send_cmd)(uint32_t cmd);
78 int32_t (*send_cmd_data)(uint32_t cmd, uint32_t data);
82 /* under construction... */
83 struct timing_rgb timing;
87 /* MCU LCD specific properties */
98 int32_t (*send_cmd)(uint32_t cmd);
99 int32_t (*send_cmd_data)(uint32_t cmd, uint32_t data);
100 int32_t (*send_data)(uint32_t data);
101 uint32_t (*read_data)(void);
107 struct timing_mcu *timing;
111 /* LCD abstraction */
118 struct info_rgb *rgb;
119 struct info_mcu *mcu;
121 struct lcd_operations *ops;
124 extern struct lcd_spec lcd_panel_hx8357;
125 extern struct lcd_spec lcd_panel_ili9328;
126 extern struct lcd_spec lcd_panel_r61581;
127 extern struct lcd_spec lcd_panel_rm68040;