]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/uapi/linux/mxcfb.h
KARO: cleanup after merge of Freescale 3.10.17 stuff
[karo-tx-linux.git] / include / uapi / linux / mxcfb.h
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
42 struct mxcfb_gbl_alpha {
43         int enable;
44         int alpha;
45 };
46
47 struct 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
54 struct mxcfb_color_key {
55         int enable;
56         __u32 color_key;
57 };
58
59 struct mxcfb_pos {
60         __u16 x;
61         __u16 y;
62 };
63
64 struct mxcfb_gamma {
65         int enable;
66         int constk[16];
67         int slopek[16];
68 };
69
70 struct 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
107 struct 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
114 struct 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
124 struct 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  */
133 struct 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  */
146 struct 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