aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2013-08-05 03:41:46 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:01:04 -0400
commit7cf40c09dd83a769823e1339a83148fe8efdcb25 (patch)
treeb8e49d62fcfc12fee5d2b070b7e71dd667dff056
parentd538d61126e5f3345788f1a524c3ee8b517787dd (diff)
ENGR00273854 mxcfb: header file split up
This patch splits mxcfb header file up to include/linux/ directory and include/uapi/linux/ directory so that the userspace may include the mxcfb header file. This patch also fixes some annotations and macros about the header file's naming. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
-rw-r--r--include/linux/mxcfb.h153
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/mxcfb.h174
3 files changed, 179 insertions, 149 deletions
diff --git a/include/linux/mxcfb.h b/include/linux/mxcfb.h
index d96d1b773a3c..67db5ee3fd11 100644
--- a/include/linux/mxcfb.h
+++ b/include/linux/mxcfb.h
@@ -12,160 +12,16 @@
12 */ 12 */
13 13
14/* 14/*
15 * @file arch-mxc/ mxcfb.h 15 * @file linux/mxcfb.h
16 * 16 *
17 * @brief Global header file for the MXC Frame buffer 17 * @brief Global header file for the MXC Frame buffer
18 * 18 *
19 * @ingroup Framebuffer 19 * @ingroup Framebuffer
20 */ 20 */
21#ifndef __ASM_ARCH_MXCFB_H__ 21#ifndef __LINUX_MXCFB_H__
22#define __ASM_ARCH_MXCFB_H__ 22#define __LINUX_MXCFB_H__
23 23
24#include <linux/fb.h> 24#include <uapi/linux/mxcfb.h>
25
26#define FB_SYNC_OE_LOW_ACT 0x80000000
27#define FB_SYNC_CLK_LAT_FALL 0x40000000
28#define FB_SYNC_DATA_INVERT 0x20000000
29#define FB_SYNC_CLK_IDLE_EN 0x10000000
30#define FB_SYNC_SHARP_MODE 0x08000000
31#define FB_SYNC_SWAP_RGB 0x04000000
32#define FB_ACCEL_TRIPLE_FLAG 0x00000000
33#define FB_ACCEL_DOUBLE_FLAG 0x00000001
34
35struct mxcfb_gbl_alpha {
36 int enable;
37 int alpha;
38};
39
40struct mxcfb_loc_alpha {
41 int enable;
42 int alpha_in_pixel;
43 unsigned long alpha_phy_addr0;
44 unsigned long alpha_phy_addr1;
45};
46
47struct mxcfb_color_key {
48 int enable;
49 __u32 color_key;
50};
51
52struct mxcfb_pos {
53 __u16 x;
54 __u16 y;
55};
56
57struct mxcfb_gamma {
58 int enable;
59 int constk[16];
60 int slopek[16];
61};
62
63struct mxcfb_rect {
64 __u32 top;
65 __u32 left;
66 __u32 width;
67 __u32 height;
68};
69
70#define GRAYSCALE_8BIT 0x1
71#define GRAYSCALE_8BIT_INVERTED 0x2
72#define GRAYSCALE_4BIT 0x3
73#define GRAYSCALE_4BIT_INVERTED 0x4
74
75#define AUTO_UPDATE_MODE_REGION_MODE 0
76#define AUTO_UPDATE_MODE_AUTOMATIC_MODE 1
77
78#define UPDATE_SCHEME_SNAPSHOT 0
79#define UPDATE_SCHEME_QUEUE 1
80#define UPDATE_SCHEME_QUEUE_AND_MERGE 2
81
82#define UPDATE_MODE_PARTIAL 0x0
83#define UPDATE_MODE_FULL 0x1
84
85#define WAVEFORM_MODE_AUTO 257
86
87#define TEMP_USE_AMBIENT 0x1000
88
89#define EPDC_FLAG_ENABLE_INVERSION 0x01
90#define EPDC_FLAG_FORCE_MONOCHROME 0x02
91#define EPDC_FLAG_USE_CMAP 0x04
92#define EPDC_FLAG_USE_ALT_BUFFER 0x100
93#define EPDC_FLAG_TEST_COLLISION 0x200
94#define EPDC_FLAG_GROUP_UPDATE 0x400
95#define EPDC_FLAG_USE_DITHERING_Y1 0x2000
96#define EPDC_FLAG_USE_DITHERING_Y4 0x4000
97
98#define FB_POWERDOWN_DISABLE -1
99
100struct mxcfb_alt_buffer_data {
101 __u32 phys_addr;
102 __u32 width; /* width of entire buffer */
103 __u32 height; /* height of entire buffer */
104 struct mxcfb_rect alt_update_region; /* region within buffer to update */
105};
106
107struct mxcfb_update_data {
108 struct mxcfb_rect update_region;
109 __u32 waveform_mode;
110 __u32 update_mode;
111 __u32 update_marker;
112 int temp;
113 unsigned int flags;
114 struct mxcfb_alt_buffer_data alt_buffer_data;
115};
116
117struct mxcfb_update_marker_data {
118 __u32 update_marker;
119 __u32 collision_test;
120};
121
122/*
123 * Structure used to define waveform modes for driver
124 * Needed for driver to perform auto-waveform selection
125 */
126struct mxcfb_waveform_modes {
127 int mode_init;
128 int mode_du;
129 int mode_gc4;
130 int mode_gc8;
131 int mode_gc16;
132 int mode_gc32;
133};
134
135/*
136 * Structure used to define a 5*3 matrix of parameters for
137 * setting IPU DP CSC module related to this framebuffer.
138 */
139struct mxcfb_csc_matrix {
140 int param[5][3];
141};
142
143#define MXCFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t)
144#define MXCFB_SET_GBL_ALPHA _IOW('F', 0x21, struct mxcfb_gbl_alpha)
145#define MXCFB_SET_CLR_KEY _IOW('F', 0x22, struct mxcfb_color_key)
146#define MXCFB_SET_OVERLAY_POS _IOWR('F', 0x24, struct mxcfb_pos)
147#define MXCFB_GET_FB_IPU_CHAN _IOR('F', 0x25, u_int32_t)
148#define MXCFB_SET_LOC_ALPHA _IOWR('F', 0x26, struct mxcfb_loc_alpha)
149#define MXCFB_SET_LOC_ALP_BUF _IOW('F', 0x27, unsigned long)
150#define MXCFB_SET_GAMMA _IOW('F', 0x28, struct mxcfb_gamma)
151#define MXCFB_GET_FB_IPU_DI _IOR('F', 0x29, u_int32_t)
152#define MXCFB_GET_DIFMT _IOR('F', 0x2A, u_int32_t)
153#define MXCFB_GET_FB_BLANK _IOR('F', 0x2B, u_int32_t)
154#define MXCFB_SET_DIFMT _IOW('F', 0x2C, u_int32_t)
155#define MXCFB_CSC_UPDATE _IOW('F', 0x2D, struct mxcfb_csc_matrix)
156
157/* IOCTLs for E-ink panel updates */
158#define MXCFB_SET_WAVEFORM_MODES _IOW('F', 0x2B, struct mxcfb_waveform_modes)
159#define MXCFB_SET_TEMPERATURE _IOW('F', 0x2C, int32_t)
160#define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32)
161#define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data)
162#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x2F, struct mxcfb_update_marker_data)
163#define MXCFB_SET_PWRDOWN_DELAY _IOW('F', 0x30, int32_t)
164#define MXCFB_GET_PWRDOWN_DELAY _IOR('F', 0x31, int32_t)
165#define MXCFB_SET_UPDATE_SCHEME _IOW('F', 0x32, __u32)
166#define MXCFB_GET_WORK_BUFFER _IOWR('F', 0x34, unsigned long)
167
168#ifdef __KERNEL__
169 25
170extern struct fb_videomode mxcfb_modedb[]; 26extern struct fb_videomode mxcfb_modedb[];
171extern int mxcfb_modedb_sz; 27extern int mxcfb_modedb_sz;
@@ -187,5 +43,4 @@ int mxc_elcdif_frame_addr_setup(dma_addr_t phys);
187void mxcfb_elcdif_register_mode(const struct fb_videomode *modedb, 43void mxcfb_elcdif_register_mode(const struct fb_videomode *modedb,
188 int num_modes, int dev_mode); 44 int num_modes, int dev_mode);
189 45
190#endif /* __KERNEL__ */
191#endif 46#endif
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 501638c74af1..a19cdb19899d 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -250,6 +250,7 @@ header-y += mroute6.h
250header-y += msdos_fs.h 250header-y += msdos_fs.h
251header-y += msg.h 251header-y += msg.h
252header-y += mtio.h 252header-y += mtio.h
253header-y += mxcfb.h
253header-y += n_r3964.h 254header-y += n_r3964.h
254header-y += nbd.h 255header-y += nbd.h
255header-y += ncp.h 256header-y += ncp.h
diff --git a/include/uapi/linux/mxcfb.h b/include/uapi/linux/mxcfb.h
new file mode 100644
index 000000000000..672696184897
--- /dev/null
+++ b/include/uapi/linux/mxcfb.h
@@ -0,0 +1,174 @@
1/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
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.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/*
22 * @file uapi/linux/mxcfb.h
23 *
24 * @brief Global header file for the MXC frame buffer
25 *
26 * @ingroup Framebuffer
27 */
28#ifndef __ASM_ARCH_MXCFB_H__
29#define __ASM_ARCH_MXCFB_H__
30
31#include <linux/fb.h>
32
33#define FB_SYNC_OE_LOW_ACT 0x80000000
34#define FB_SYNC_CLK_LAT_FALL 0x40000000
35#define FB_SYNC_DATA_INVERT 0x20000000
36#define FB_SYNC_CLK_IDLE_EN 0x10000000
37#define FB_SYNC_SHARP_MODE 0x08000000
38#define FB_SYNC_SWAP_RGB 0x04000000
39#define FB_ACCEL_TRIPLE_FLAG 0x00000000
40#define FB_ACCEL_DOUBLE_FLAG 0x00000001
41
42struct mxcfb_gbl_alpha {
43 int enable;
44 int alpha;
45};
46
47struct mxcfb_loc_alpha {
48 int enable;
49 int alpha_in_pixel;
50 unsigned long alpha_phy_addr0;
51 unsigned long alpha_phy_addr1;
52};
53
54struct mxcfb_color_key {
55 int enable;
56 __u32 color_key;
57};
58
59struct mxcfb_pos {
60 __u16 x;
61 __u16 y;
62};
63
64struct mxcfb_gamma {
65 int enable;
66 int constk[16];
67 int slopek[16];
68};
69
70struct mxcfb_rect {
71 __u32 top;
72 __u32 left;
73 __u32 width;
74 __u32 height;
75};
76
77#define GRAYSCALE_8BIT 0x1
78#define GRAYSCALE_8BIT_INVERTED 0x2
79#define GRAYSCALE_4BIT 0x3
80#define GRAYSCALE_4BIT_INVERTED 0x4
81
82#define AUTO_UPDATE_MODE_REGION_MODE 0
83#define AUTO_UPDATE_MODE_AUTOMATIC_MODE 1
84
85#define UPDATE_SCHEME_SNAPSHOT 0
86#define UPDATE_SCHEME_QUEUE 1
87#define UPDATE_SCHEME_QUEUE_AND_MERGE 2
88
89#define UPDATE_MODE_PARTIAL 0x0
90#define UPDATE_MODE_FULL 0x1
91
92#define WAVEFORM_MODE_AUTO 257
93
94#define TEMP_USE_AMBIENT 0x1000
95
96#define EPDC_FLAG_ENABLE_INVERSION 0x01
97#define EPDC_FLAG_FORCE_MONOCHROME 0x02
98#define EPDC_FLAG_USE_CMAP 0x04
99#define EPDC_FLAG_USE_ALT_BUFFER 0x100
100#define EPDC_FLAG_TEST_COLLISION 0x200
101#define EPDC_FLAG_GROUP_UPDATE 0x400
102#define EPDC_FLAG_USE_DITHERING_Y1 0x2000
103#define EPDC_FLAG_USE_DITHERING_Y4 0x4000
104
105#define FB_POWERDOWN_DISABLE -1
106
107struct mxcfb_alt_buffer_data {
108 __u32 phys_addr;
109 __u32 width; /* width of entire buffer */
110 __u32 height; /* height of entire buffer */
111 struct mxcfb_rect alt_update_region; /* region within buffer to update */
112};
113
114struct mxcfb_update_data {
115 struct mxcfb_rect update_region;
116 __u32 waveform_mode;
117 __u32 update_mode;
118 __u32 update_marker;
119 int temp;
120 unsigned int flags;
121 struct mxcfb_alt_buffer_data alt_buffer_data;
122};
123
124struct mxcfb_update_marker_data {
125 __u32 update_marker;
126 __u32 collision_test;
127};
128
129/*
130 * Structure used to define waveform modes for driver
131 * Needed for driver to perform auto-waveform selection
132 */
133struct mxcfb_waveform_modes {
134 int mode_init;
135 int mode_du;
136 int mode_gc4;
137 int mode_gc8;
138 int mode_gc16;
139 int mode_gc32;
140};
141
142/*
143 * Structure used to define a 5*3 matrix of parameters for
144 * setting IPU DP CSC module related to this framebuffer.
145 */
146struct mxcfb_csc_matrix {
147 int param[5][3];
148};
149
150#define MXCFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t)
151#define MXCFB_SET_GBL_ALPHA _IOW('F', 0x21, struct mxcfb_gbl_alpha)
152#define MXCFB_SET_CLR_KEY _IOW('F', 0x22, struct mxcfb_color_key)
153#define MXCFB_SET_OVERLAY_POS _IOWR('F', 0x24, struct mxcfb_pos)
154#define MXCFB_GET_FB_IPU_CHAN _IOR('F', 0x25, u_int32_t)
155#define MXCFB_SET_LOC_ALPHA _IOWR('F', 0x26, struct mxcfb_loc_alpha)
156#define MXCFB_SET_LOC_ALP_BUF _IOW('F', 0x27, unsigned long)
157#define MXCFB_SET_GAMMA _IOW('F', 0x28, struct mxcfb_gamma)
158#define MXCFB_GET_FB_IPU_DI _IOR('F', 0x29, u_int32_t)
159#define MXCFB_GET_DIFMT _IOR('F', 0x2A, u_int32_t)
160#define MXCFB_GET_FB_BLANK _IOR('F', 0x2B, u_int32_t)
161#define MXCFB_SET_DIFMT _IOW('F', 0x2C, u_int32_t)
162#define MXCFB_CSC_UPDATE _IOW('F', 0x2D, struct mxcfb_csc_matrix)
163
164/* IOCTLs for E-ink panel updates */
165#define MXCFB_SET_WAVEFORM_MODES _IOW('F', 0x2B, struct mxcfb_waveform_modes)
166#define MXCFB_SET_TEMPERATURE _IOW('F', 0x2C, int32_t)
167#define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32)
168#define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data)
169#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x2F, struct mxcfb_update_marker_data)
170#define MXCFB_SET_PWRDOWN_DELAY _IOW('F', 0x30, int32_t)
171#define MXCFB_GET_PWRDOWN_DELAY _IOR('F', 0x31, int32_t)
172#define MXCFB_SET_UPDATE_SCHEME _IOW('F', 0x32, __u32)
173#define MXCFB_GET_WORK_BUFFER _IOWR('F', 0x34, unsigned long)
174#endif