video: sprd: remove build warnings
[profile/mobile/platform/kernel/u-boot-tm1.git] / drivers / video / sprdfb / sprdfb.h
1 /*
2  * Copyright (C) 2012 Spreadtrum Communications Inc.
3  *
4  */
5
6 #ifndef _SPRDFB_H_
7 #define _SPRDFB_H_
8
9 #define printk printf
10 //#define  FB_DEBUG
11 #ifdef FB_DEBUG
12 #define FB_PRINT printk
13 #else
14 #define FB_PRINT(...)
15 #endif
16
17 #define mdelay(t)       ({unsigned long msec=(t); while (msec--) { udelay(1000);}})
18
19 enum{
20         SPRDFB_PANEL_IF_DBI = 0,
21         SPRDFB_PANEL_IF_DPI,
22         SPRDFB_PANEL_IF_EDPI,
23         SPRDFB_PANEL_IF_LIMIT
24 };
25
26
27 enum{
28         MCU_LCD_REGISTER_TIMING = 0,
29         MCU_LCD_GRAM_TIMING,
30         MCU_LCD_TIMING_KIND_MAX
31 };
32
33 enum{
34         RGB_LCD_H_TIMING = 0,
35         RGB_LCD_V_TIMING,
36         RGB_LCD_TIMING_KIND_MAX
37 };
38
39 struct sprdfb_device;
40 struct panel_spec;
41
42
43 struct panel_if_ctrl{
44         const char *if_name;
45
46         int32_t (*panel_if_check)(struct panel_spec *self);
47         void (*panel_if_mount)(struct sprdfb_device *dev);
48         void (*panel_if_init)(struct sprdfb_device *dev);
49         void (*panel_if_ready)(struct sprdfb_device *dev);
50         void (*panel_if_uninit)(struct sprdfb_device *dev);
51         void (*panel_if_before_refresh)(struct sprdfb_device *dev);
52         void (*panel_if_after_refresh)(struct sprdfb_device *dev);
53         void (*panel_if_before_panel_reset)(struct sprdfb_device *dev);
54         void (*panel_if_suspend)(struct sprdfb_device *dev);
55         void (*panel_if_resume)(struct sprdfb_device *dev);
56 };
57
58
59 struct sprdfb_device {
60         uint32_t smem_start;
61
62         union{
63                 uint32_t        mcu_timing[MCU_LCD_TIMING_KIND_MAX];
64                 uint32_t        rgb_timing[RGB_LCD_TIMING_KIND_MAX];
65         }panel_timing;
66
67         uint16_t                panel_if_type; /*panel IF*/
68
69 #ifdef CONFIG_FB_LOW_RES_SIMU
70         uint16_t display_width;
71         uint16_t display_height;
72 #endif
73
74         struct panel_spec       *panel;
75         struct panel_if_ctrl *if_ctrl;
76         struct display_ctrl     *ctrl;
77         uint32_t dpi_clock;
78 };
79
80 struct display_ctrl {
81         const char      *name;
82
83         int32_t (*early_init)     (struct sprdfb_device *dev);
84         int32_t (*init)           (struct sprdfb_device *dev);
85         int32_t (*uninit)                 (struct sprdfb_device *dev);
86
87         int32_t         (*refresh)        (struct sprdfb_device *dev);
88         void            (*update_clk)     (struct sprdfb_device *dev);
89 };
90
91 #if defined(CONFIG_FPGA)
92          int sprdchip_lvds_init(void);
93
94 #else
95 #define sprdchip_lvds_init NULL
96 #endif
97
98 #endif