1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
16 #include <linux/module.h>
17 #include <linux/kernel.h>
18 #include <linux/sched.h>
19 #include <linux/time.h>
20 #include <linux/init.h>
21 #include <linux/interrupt.h>
22 #include "linux/proc_fs.h"
24 #include <mach/hardware.h>
26 #include <mach/board.h>
28 #include <asm/system.h>
29 #include <asm/mach-types.h>
30 #include <mach/memory.h>
31 #include <linux/semaphore.h>
32 #include <linux/spinlock.h>
33 #include <linux/workqueue.h>
34 #include <linux/hrtimer.h>
38 #ifdef CONFIG_HAS_EARLYSUSPEND
39 #include <linux/earlysuspend.h>
42 #include "msm_fb_panel.h"
45 #define MSM_FB_DEFAULT_PAGE_SIZE 2
46 #define MFD_KEY 0x11161126
47 #define MSM_FB_MAX_DEV_LIST 32
49 struct disp_info_type_suspend
{
51 boolean sw_refreshing_enable
;
52 boolean panel_power_on
;
55 struct msm_fb_data_type
{
62 struct msm_panel_info panel_info
;
69 boolean sw_currently_refreshing
;
70 boolean sw_refreshing_enable
;
75 struct timer_list refresh_timer
;
76 struct completion refresher_comp
;
79 struct completion pan_comp
;
82 boolean use_mdp_vsync
;
84 __u32 total_lcd_lines
;
85 __u32 total_porch_lines
;
86 __u32 lcd_ref_usec_time
;
87 __u32 refresh_timer_duration
;
89 struct hrtimer dma_hrtimer
;
91 boolean panel_power_on
;
92 struct work_struct dma_update_worker
;
95 struct timer_list vsync_resync_timer
;
96 boolean vsync_handler_pending
;
97 struct work_struct vsync_resync_worker
;
99 ktime_t last_vsync_timetick
;
101 __u32
*vsync_width_boundary
;
103 unsigned int pmem_id
;
104 struct disp_info_type_suspend suspend
;
108 struct mdp_dma_data
*dma
;
109 void (*dma_fnc
) (struct msm_fb_data_type
*mfd
);
110 int (*cursor_update
) (struct fb_info
*info
,
111 struct fb_cursor
*cursor
);
112 int (*lut_update
) (struct fb_info
*info
,
113 struct fb_cmap
*cmap
);
114 int (*do_histogram
) (struct fb_info
*info
,
115 struct mdp_histogram
*hist
);
117 void *cursor_buf_phys
;
121 void *data_port_phys
;
125 struct platform_device
*pdev
;
131 #ifdef MSM_FB_ENABLE_DBGFS
132 struct dentry
*sub_dir
;
135 #ifdef CONFIG_HAS_EARLYSUSPEND
136 struct early_suspend early_suspend
;
137 struct early_suspend mddi_early_suspend
;
138 struct early_suspend mddi_ext_early_suspend
;
140 u32 mdp_fb_page_protection
;
141 int allow_set_offset
;
144 struct dentry
*msm_fb_get_debugfs_root(void);
145 void msm_fb_debugfs_file_create(struct dentry
*root
, const char *name
,
147 void msm_fb_set_backlight(struct msm_fb_data_type
*mfd
, __u32 bkl_lvl
,
150 void msm_fb_add_device(struct platform_device
*pdev
);
152 int msm_fb_detect_client(const char *name
);
154 #ifdef CONFIG_FB_BACKLIGHT
155 void msm_fb_config_backlight(struct msm_fb_data_type
*mfd
);
158 #endif /* MSM_FB_H */