|
| 1 | +/* |
| 2 | + * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | + */ |
| 4 | + |
| 5 | +/* |
| 6 | + * The code contained herein is licensed under the GNU Lesser General |
| 7 | + * Public License. You may obtain a copy of the GNU Lesser General |
| 8 | + * Public License Version 2.1 or later at the following locations: |
| 9 | + * |
| 10 | + * http://www.opensource.org/licenses/lgpl-license.html |
| 11 | + * http://www.gnu.org/copyleft/lgpl.html |
| 12 | + */ |
| 13 | + |
| 14 | +/* |
| 15 | + * @file arch-mxc/ mxcfb.h |
| 16 | + * |
| 17 | + * @brief Global header file for the MXC Frame buffer |
| 18 | + * |
| 19 | + * @ingroup Framebuffer |
| 20 | + */ |
| 21 | +#ifndef __ASM_ARCH_MXCFB_H__ |
| 22 | +#define __ASM_ARCH_MXCFB_H__ |
| 23 | + |
| 24 | +#include <linux/fb.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 | + |
| 33 | +struct mxcfb_gbl_alpha { |
| 34 | + int enable; |
| 35 | + int alpha; |
| 36 | +}; |
| 37 | + |
| 38 | +struct mxcfb_loc_alpha { |
| 39 | + int enable; |
| 40 | + int alpha_in_pixel; |
| 41 | + unsigned long alpha_phy_addr0; |
| 42 | + unsigned long alpha_phy_addr1; |
| 43 | +}; |
| 44 | + |
| 45 | +struct mxcfb_color_key { |
| 46 | + int enable; |
| 47 | + __u32 color_key; |
| 48 | +}; |
| 49 | + |
| 50 | +struct mxcfb_pos { |
| 51 | + __u16 x; |
| 52 | + __u16 y; |
| 53 | +}; |
| 54 | + |
| 55 | +struct mxcfb_gamma { |
| 56 | + int enable; |
| 57 | + int constk[16]; |
| 58 | + int slopek[16]; |
| 59 | +}; |
| 60 | + |
| 61 | +struct mxcfb_rect { |
| 62 | + __u32 top; |
| 63 | + __u32 left; |
| 64 | + __u32 width; |
| 65 | + __u32 height; |
| 66 | +}; |
| 67 | + |
| 68 | +#define GRAYSCALE_8BIT 0x1 |
| 69 | +#define GRAYSCALE_8BIT_INVERTED 0x2 |
| 70 | + |
| 71 | +#define AUTO_UPDATE_MODE_REGION_MODE 0 |
| 72 | +#define AUTO_UPDATE_MODE_AUTOMATIC_MODE 1 |
| 73 | + |
| 74 | +#define UPDATE_SCHEME_SNAPSHOT 0 |
| 75 | +#define UPDATE_SCHEME_QUEUE 1 |
| 76 | +#define UPDATE_SCHEME_QUEUE_AND_MERGE 2 |
| 77 | + |
| 78 | +#define UPDATE_MODE_PARTIAL 0x0 |
| 79 | +#define UPDATE_MODE_FULL 0x1 |
| 80 | + |
| 81 | +#define WAVEFORM_MODE_AUTO 257 |
| 82 | + |
| 83 | +#define TEMP_USE_AMBIENT 0x1000 |
| 84 | +#define TEMP_USE_AUTO 0x1001 |
| 85 | + |
| 86 | +#define EPDC_FLAG_ENABLE_INVERSION 0x01 |
| 87 | +#define EPDC_FLAG_FORCE_MONOCHROME 0x02 |
| 88 | +#define EPDC_FLAG_USE_ALT_BUFFER 0x100 |
| 89 | + |
| 90 | +#define EPDC_FLAG_SP1_1 0x10000 |
| 91 | +#define EPDC_FLAG_SP1_2 0x20000 |
| 92 | + |
| 93 | +#define FB_POWERDOWN_DISABLE -1 |
| 94 | + |
| 95 | +/* 2011/03/30 FY11 : Defined max marker value for user process. */ |
| 96 | +/* (The value larger than this is for driver.)*/ |
| 97 | +#define UPDATE_MARKER_MAX 0x80000000 |
| 98 | + |
| 99 | +struct mxcfb_alt_buffer_data { |
| 100 | + void *virt_addr; |
| 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 | + |
| 107 | +struct 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 | + uint flags; |
| 114 | + struct mxcfb_alt_buffer_data alt_buffer_data; |
| 115 | +}; |
| 116 | + |
| 117 | +/* |
| 118 | + * Structure used to define waveform modes for driver |
| 119 | + * Needed for driver to perform auto-waveform selection |
| 120 | + */ |
| 121 | +struct mxcfb_waveform_modes { |
| 122 | + int mode_init; |
| 123 | + int mode_du; |
| 124 | + int mode_gc4; |
| 125 | + int mode_gc8; |
| 126 | + int mode_gc16; |
| 127 | + int mode_gc32; |
| 128 | + int mode_a2; /* 2011/03/05 FY11 : Supported A2 mode limitations. */ |
| 129 | +}; |
| 130 | + |
| 131 | + |
| 132 | +/* 2011/2/24 FY11 : Added waveform version struct. */ |
| 133 | +#define WF_VER_LEN 10 |
| 134 | +struct mxcfb_waveform_version { |
| 135 | + __u8 version[WF_VER_LEN]; |
| 136 | +}; |
| 137 | + |
| 138 | + |
| 139 | +/* 2011/03/08 FY11 : Supported to write waveform. */ |
| 140 | +struct mxcfb_waveform_data |
| 141 | +{ |
| 142 | + __u32 uiSize; |
| 143 | + __u8 *pcData; |
| 144 | +}; |
| 145 | + |
| 146 | + |
| 147 | +#define MXCFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) |
| 148 | +#define MXCFB_SET_GBL_ALPHA _IOW('F', 0x21, struct mxcfb_gbl_alpha) |
| 149 | +#define MXCFB_SET_CLR_KEY _IOW('F', 0x22, struct mxcfb_color_key) |
| 150 | +#define MXCFB_SET_OVERLAY_POS _IOWR('F', 0x24, struct mxcfb_pos) |
| 151 | +#define MXCFB_GET_FB_IPU_CHAN _IOR('F', 0x25, u_int32_t) |
| 152 | +#define MXCFB_SET_LOC_ALPHA _IOWR('F', 0x26, struct mxcfb_loc_alpha) |
| 153 | +#define MXCFB_SET_LOC_ALP_BUF _IOW('F', 0x27, unsigned long) |
| 154 | +#define MXCFB_SET_GAMMA _IOW('F', 0x28, struct mxcfb_gamma) |
| 155 | +#define MXCFB_GET_FB_IPU_DI _IOR('F', 0x29, u_int32_t) |
| 156 | +#define MXCFB_GET_DIFMT _IOR('F', 0x2A, u_int32_t) |
| 157 | +#define MXCFB_GET_FB_BLANK _IOR('F', 0x2B, u_int32_t) |
| 158 | +#define MXCFB_SET_DIFMT _IOW('F', 0x2C, u_int32_t) |
| 159 | + |
| 160 | +/* IOCTLs for E-ink panel updates */ |
| 161 | +#define MXCFB_SET_WAVEFORM_MODES _IOW('F', 0x2B, struct mxcfb_waveform_modes) |
| 162 | +#define MXCFB_SET_TEMPERATURE _IOW('F', 0x2C, int32_t) |
| 163 | +#define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32) |
| 164 | +#define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data) |
| 165 | +#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOW('F', 0x2F, __u32) |
| 166 | +#define MXCFB_SET_PWRDOWN_DELAY _IOW('F', 0x30, int32_t) |
| 167 | +#define MXCFB_GET_PWRDOWN_DELAY _IOR('F', 0x31, int32_t) |
| 168 | +#define MXCFB_SET_UPDATE_SCHEME _IOW('F', 0x32, __u32) |
| 169 | +#define MXCFB_GET_PMIC_TEMPERATURE _IOR('F', 0x33, int32_t) |
| 170 | +#define MXCFB_SET_BORDER_MODE _IOR('F', 0x34, int32_t) |
| 171 | +#define MXCFB_SET_EPD_PWR0_CTRL _IOR('F', 0x35, int32_t) |
| 172 | +#define MXCFB_SET_EPD_PWR2_CTRL _IOR('F', 0x36, int32_t) |
| 173 | + |
| 174 | +/* 2011/1/19 FY11 : Added commands to read/write VCOM. */ |
| 175 | +#define MXCFB_SET_VCOM _IOW('F', 0x37, __u32) |
| 176 | +#define MXCFB_GET_VCOM _IOR('F', 0x38, __u32) |
| 177 | + |
| 178 | +/* 2011/2/24 FY11 : Added commands to read waveform version. */ |
| 179 | +#define MXCFB_GET_WF_VERSION _IOR('F', 0x39, struct mxcfb_waveform_version) |
| 180 | +/* 2011/03/08 FY11 : Supported to write waveform. */ |
| 181 | +#define MXCFB_WRITE_WF _IOW('F', 0x3A, struct mxcfb_waveform_data) |
| 182 | +/* 2011/03/30 FY11 : Supported to write standby screen image. */ |
| 183 | +#define MXCFB_WRITE_SSCREEN _IOW('F', 0x3B, __u8*) |
| 184 | +/* 2011/04/12 FY11 : Supported to write panel init flag. */ |
| 185 | +#define MXCFB_SET_PANELINIT _IOW('F', 0x3C, __u8) |
| 186 | + |
| 187 | +/* 2012/02/03 : Add pending function. */ |
| 188 | +#define MXCFB_SET_PENDING _IOW('F', 0x3E, __u8) |
| 189 | + |
| 190 | +#ifdef __KERNEL__ |
| 191 | + |
| 192 | +extern struct fb_videomode mxcfb_modedb[]; |
| 193 | +extern int mxcfb_modedb_sz; |
| 194 | + |
| 195 | +enum { |
| 196 | + MXCFB_REFRESH_OFF, |
| 197 | + MXCFB_REFRESH_AUTO, |
| 198 | + MXCFB_REFRESH_PARTIAL, |
| 199 | +}; |
| 200 | + |
| 201 | +int mxcfb_set_refresh_mode(struct fb_info *fbi, int mode, |
| 202 | + struct mxcfb_rect *update_region); |
| 203 | + |
| 204 | +int mxc_elcdif_frame_addr_setup(dma_addr_t phys); |
| 205 | + |
| 206 | +#endif /* __KERNEL__ */ |
| 207 | +#endif |
0 commit comments