Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | #ifndef __DISP_HAL_H__ |
2 | #define __DISP_HAL_H__ | |
3 | #include "lcm_drv.h" | |
4 | #include "fbconfig_kdebug.h" | |
5 | // Forward declarations | |
6 | struct resource; | |
7 | struct mutex; | |
8 | struct device; | |
9 | ||
10 | typedef enum | |
11 | { | |
12 | DISP_STATUS_OK = 0, | |
13 | ||
14 | DISP_STATUS_NOT_IMPLEMENTED, | |
15 | DISP_STATUS_ALREADY_SET, | |
16 | DISP_STATUS_ERROR, | |
17 | } DISP_STATUS; | |
18 | ||
19 | ||
20 | typedef enum { | |
21 | DISP_STATE_IDLE = 0, | |
22 | DISP_STATE_BUSY, | |
23 | } DISP_STATE; | |
24 | ||
25 | ||
26 | #define MAKE_PANEL_COLOR_FORMAT(R, G, B) ((R << 16) | (G << 8) | B) | |
27 | #define PANEL_COLOR_FORMAT_TO_BPP(x) ((x&0xff) + ((x>>8)&0xff) + ((x>>16)&0xff)) | |
28 | ||
29 | typedef enum { | |
30 | PANEL_COLOR_FORMAT_RGB332 = MAKE_PANEL_COLOR_FORMAT(3, 3, 2), | |
31 | PANEL_COLOR_FORMAT_RGB444 = MAKE_PANEL_COLOR_FORMAT(4, 4, 4), | |
32 | PANEL_COLOR_FORMAT_RGB565 = MAKE_PANEL_COLOR_FORMAT(5, 6, 5), | |
33 | PANEL_COLOR_FORMAT_RGB666 = MAKE_PANEL_COLOR_FORMAT(6, 6, 6), | |
34 | PANEL_COLOR_FORMAT_RGB888 = MAKE_PANEL_COLOR_FORMAT(8, 8, 8), | |
35 | } PANEL_COLOR_FORMAT; | |
36 | ||
37 | typedef struct | |
38 | { | |
39 | DISP_STATUS (*init)(UINT32 fbVA, UINT32 fbPA, BOOL isLcmInited); | |
40 | DISP_STATUS (*enable_power)(BOOL enable); | |
41 | DISP_STATUS (*update_screen)(BOOL isMuextLocked); | |
42 | ||
43 | UINT32 (*get_working_buffer_size)(void); | |
44 | UINT32 (*get_working_buffer_bpp)(void); | |
45 | PANEL_COLOR_FORMAT (*get_panel_color_format)(void); | |
46 | void (*init_te_control)(void); | |
47 | UINT32 (*get_dithering_bpp)(void); | |
48 | ||
49 | DISP_STATUS (*capture_framebuffer)(unsigned int pvbuf, unsigned int bpp); | |
50 | ||
51 | void (*esd_reset)(void); | |
52 | BOOL (*esd_check)(void); | |
53 | } DISP_IF_DRIVER; | |
54 | ||
55 | typedef void (*DISPHAL_EVENT_HANDLER)(void *params); | |
56 | ||
57 | int disphal_process_dbg_opt(const char *opt); | |
58 | const DISP_IF_DRIVER* disphal_get_if_driver(void); | |
59 | int disphal_init_ctrl_if(void); | |
60 | int disphal_panel_enable(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, BOOL enable); | |
61 | int disphal_wait_not_busy(void); | |
62 | int disphal_update_screen(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, UINT32 x, UINT32 y, UINT32 width, UINT32 height); | |
63 | int disphal_set_backlight(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, UINT32 level); | |
64 | int disphal_set_backlight_mode(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, UINT32 mode); | |
65 | int disphal_set_pwm(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, UINT32 divider); | |
66 | int disphal_get_pwm(const LCM_DRIVER *lcm_drv, struct mutex* pLcmCmdMutex, UINT32 divider, unsigned int *freq); | |
67 | DISP_STATUS disphal_fm_desense_query(void); | |
68 | DISP_STATUS disphal_fm_desense(unsigned long freq); | |
69 | DISP_STATUS disphal_reset_update(void); | |
70 | DISP_STATUS disphal_get_default_updatespeed(unsigned int *speed); | |
71 | DISP_STATUS disphal_get_current_updatespeed(unsigned int *speed); | |
72 | DISP_STATUS disphal_change_updatespeed(unsigned int speed); | |
73 | int disphal_prepare_suspend(void); | |
74 | const LCM_DRIVER *disphal_get_lcm_driver(const char *lcm_name, unsigned int *lcm_index); | |
75 | int disphal_register_event(char* event_name, DISPHAL_EVENT_HANDLER event_handler); | |
76 | int disphal_enable_te(BOOL enable); | |
77 | int disphal_pm_restore_noirq(struct device *device); | |
78 | int disphal_enable_mmu(BOOL enable); | |
79 | int disphal_allocate_fb(struct resource* res, unsigned int* pa, unsigned int* va, unsigned int* dma_pa); | |
80 | int disphal_map_overlay_out_buffer(unsigned int va, unsigned int size, unsigned int* dma_pa); | |
81 | int disphal_unmap_overlay_out_buffer(unsigned int va, unsigned int size, unsigned int dma_pa); | |
82 | int disphal_sync_overlay_out_buffer(unsigned int va, unsigned int size); | |
83 | int disphal_dma_map_kernel(unsigned int dma_pa, unsigned int size, unsigned int* kva, unsigned int* mapsize); | |
84 | int disphal_dma_unmap_kernel(unsigned int dma_pa, unsigned int size, unsigned int kva); | |
85 | int disphal_init_overlay_to_memory(void); | |
86 | int disphal_deinit_overlay_to_memory(void); | |
87 | int disphal_get_fb_alignment(void); | |
88 | unsigned int disphal_bls_query(void); | |
89 | void disphal_bls_enable(bool enable); | |
90 | unsigned int disphal_check_lcm(UINT32 color); | |
91 | void fbconfig_disp_set_te_enable(char enable); | |
92 | void fbconfig_disp_set_continuous_clock(int enable); | |
93 | #endif |