Ray Zhang | 1416725 | 2016-04-06 11:32:24 +0800 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions are |
| 5 | * met: |
| 6 | * * Redistributions of source code must retain the above copyright |
| 7 | * notice, this list of conditions and the following disclaimer. |
| 8 | * * Redistributions in binary form must reproduce the above |
| 9 | * copyright notice, this list of conditions and the following |
| 10 | * disclaimer in the documentation and/or other materials provided |
| 11 | * with the distribution. |
| 12 | * * Neither the name of The Linux Foundation nor the names of its |
| 13 | * contributors may be used to endorse or promote products derived |
| 14 | * from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | * |
| 28 | */ |
| 29 | |
| 30 | #ifndef _PANEL_LEAD_FL10802_FWVGA_VIDEO_H_ |
| 31 | #define _PANEL_LEAD_FL10802_FWVGA_VIDEO_H_ |
| 32 | /*---------------------------------------------------------------------------*/ |
| 33 | /* HEADER files */ |
| 34 | /*---------------------------------------------------------------------------*/ |
| 35 | #include "panel.h" |
| 36 | |
| 37 | /*---------------------------------------------------------------------------*/ |
| 38 | /* Panel configuration */ |
| 39 | /*---------------------------------------------------------------------------*/ |
| 40 | static struct panel_config lead_fl10802_fwvga_video_panel_data = { |
| 41 | "qcom,mdss_dsi_lead_fl10802_fwvga_video", "dsi:0:", "qcom,mdss-dsi-panel", |
| 42 | 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 1, 7000, 0, 0, 0, 0, 0, 0, NULL |
| 43 | }; |
| 44 | |
| 45 | /*---------------------------------------------------------------------------*/ |
| 46 | /* Panel resolution */ |
| 47 | /*---------------------------------------------------------------------------*/ |
| 48 | static struct panel_resolution lead_fl10802_fwvga_video_panel_res = { |
| 49 | 480, 854, 94, 84, 60, 0, 18, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 50 | }; |
| 51 | |
| 52 | /*---------------------------------------------------------------------------*/ |
| 53 | /* Panel color information */ |
| 54 | /*---------------------------------------------------------------------------*/ |
| 55 | static struct color_info lead_fl10802_fwvga_video_color = { |
| 56 | 24, 0, 0xff, 0, 0, 0 |
| 57 | }; |
| 58 | |
| 59 | /*---------------------------------------------------------------------------*/ |
| 60 | /* Panel on/off command information */ |
| 61 | /*---------------------------------------------------------------------------*/ |
| 62 | static char lead_fl10802_fwvga_video_on_cmd0[] = { |
| 63 | 0x04, 0x00, 0x29, 0xc0, |
| 64 | 0xb9, 0xf1, 0x08, 0x01, |
| 65 | }; |
| 66 | |
| 67 | static char lead_fl10802_fwvga_video_on_cmd1[] = { |
| 68 | 0x08, 0x00, 0x29, 0xc0, |
| 69 | 0xb1, 0x22, 0x1a, 0x1a, |
| 70 | 0x87, 0x30, 0x01, 0xab, |
| 71 | }; |
| 72 | |
| 73 | static char lead_fl10802_fwvga_video_on_cmd2[] = { |
| 74 | 0x02, 0x00, 0x29, 0xc0, |
| 75 | 0xb2, 0x22, 0xff, 0xff, |
| 76 | }; |
| 77 | |
| 78 | static char lead_fl10802_fwvga_video_on_cmd3[] = { |
| 79 | 0x09, 0x00, 0x29, 0xc0, |
| 80 | 0xb3, 0x01, 0x00, 0x06, |
| 81 | 0x06, 0x18, 0x13, 0x39, |
| 82 | 0x35, 0xff, 0xff, 0xff, |
| 83 | }; |
| 84 | |
| 85 | static char lead_fl10802_fwvga_video_on_cmd4[] = { |
| 86 | 0x12, 0x00, 0x29, 0xc0, |
| 87 | 0xba, 0x31, 0x00, 0x44, |
| 88 | 0x25, 0x91, 0x0a, 0x00, |
| 89 | 0x00, 0xc1, 0x00, 0x00, |
| 90 | 0x00, 0x0d, 0x02, 0x4f, |
| 91 | 0xb9, 0xee, 0xff, 0xff, |
| 92 | }; |
| 93 | |
| 94 | static char lead_fl10802_fwvga_video_on_cmd5[] = { |
| 95 | 0x06, 0x00, 0x29, 0xc0, |
| 96 | 0xe3, 0x09, 0x09, 0x03, |
| 97 | 0x03, 0x00, 0xff, 0xff, |
| 98 | }; |
| 99 | |
| 100 | static char lead_fl10802_fwvga_video_on_cmd6[] = { |
| 101 | 0x02, 0x00, 0x29, 0xc0, |
| 102 | 0xb4, 0x00, 0xff, 0xff, |
| 103 | }; |
| 104 | |
| 105 | static char lead_fl10802_fwvga_video_on_cmd7[] = { |
| 106 | 0x03, 0x00, 0x29, 0xc0, |
| 107 | 0xb5, 0x07, 0x07, 0xff, |
| 108 | }; |
| 109 | |
| 110 | static char lead_fl10802_fwvga_video_on_cmd8[] = { |
| 111 | 0x03, 0x00, 0x29, 0xc0, |
| 112 | 0xb6, 0x32, 0x32, 0xff, |
| 113 | }; |
| 114 | |
| 115 | static char lead_fl10802_fwvga_video_on_cmd9[] = { |
| 116 | 0x03, 0x00, 0x29, 0xc0, |
| 117 | 0xb8, 0x64, 0x22, 0xff, |
| 118 | }; |
| 119 | |
| 120 | static char lead_fl10802_fwvga_video_on_cmd10[] = { |
| 121 | 0x02, 0x00, 0x29, 0xc0, |
| 122 | 0xc7, 0xa0, 0xff, 0xff, |
| 123 | }; |
| 124 | |
| 125 | static char lead_fl10802_fwvga_video_on_cmd11[] = { |
| 126 | 0x03, 0x00, 0x29, 0xc0, |
| 127 | 0xc8, 0x10, 0x00, 0xff, |
| 128 | }; |
| 129 | |
| 130 | static char lead_fl10802_fwvga_video_on_cmd12[] = { |
| 131 | 0x02, 0x00, 0x29, 0xc0, |
| 132 | 0xcc, 0x00, 0xff, 0xff, |
| 133 | }; |
| 134 | |
| 135 | static char lead_fl10802_fwvga_video_on_cmd13[] = { |
| 136 | 0x02, 0x00, 0x29, 0xc0, |
| 137 | 0xbc, 0x47, 0xff, 0xff, |
| 138 | }; |
| 139 | |
| 140 | static char lead_fl10802_fwvga_video_on_cmd14[] = { |
| 141 | 0x34, 0x00, 0x29, 0xc0, |
| 142 | 0xe9, 0x00, 0x00, 0x09, |
| 143 | 0x03, 0x65, 0x0a, 0x8a, |
| 144 | 0x10, 0x01, 0x00, 0x37, |
| 145 | 0x0d, 0x0a, 0x8a, 0x37, |
| 146 | 0x00, 0x00, 0x18, 0x00, |
| 147 | 0x00, 0x00, 0x25, 0x09, |
| 148 | 0x80, 0x40, 0x00, 0x42, |
| 149 | 0x60, 0x00, 0x00, 0x00, |
| 150 | 0x09, 0x81, 0x50, 0x01, |
| 151 | 0x53, 0x70, 0x00, 0x00, |
| 152 | 0x00, 0x00, 0x00, 0x00, |
| 153 | 0x00, 0x00, 0x00, 0x00, |
| 154 | 0x00, 0x00, 0x00, 0x00, |
| 155 | }; |
| 156 | |
| 157 | static char lead_fl10802_fwvga_video_on_cmd15[] = { |
| 158 | 0x13, 0x00, 0x29, 0xc0, |
| 159 | 0xea, 0x94, 0x00, 0x00, |
| 160 | 0x00, 0x08, 0x95, 0x10, |
| 161 | 0x07, 0x35, 0x10, 0x00, |
| 162 | 0x00, 0x00, 0x08, 0x94, |
| 163 | 0x00, 0x06, 0x24, 0xff, |
| 164 | }; |
| 165 | |
| 166 | static char lead_fl10802_fwvga_video_on_cmd16[] = { |
| 167 | 0x23, 0x00, 0x29, 0xc0, |
| 168 | 0xe0, 0x00, 0x00, 0x11, |
| 169 | 0x0f, 0x10, 0x2a, 0x26, |
| 170 | 0x34, 0x0c, 0x0f, 0x10, |
| 171 | 0x14, 0x17, 0x14, 0x16, |
| 172 | 0x13, 0x17, 0x00, 0x00, |
| 173 | 0x11, 0x0f, 0x10, 0x2a, |
| 174 | 0x26, 0x34, 0x0c, 0x0f, |
| 175 | 0x10, 0x14, 0x17, 0x14, |
| 176 | 0x16, 0x13, 0x17, 0xff, |
| 177 | }; |
| 178 | |
| 179 | static char lead_fl10802_fwvga_video_on_cmd17[]= { |
| 180 | 0x02, 0x00, 0x39, 0xc0, |
| 181 | 0x51, 0x00, 0xff, 0xff, |
| 182 | }; |
| 183 | |
| 184 | static char lead_fl10802_fwvga_video_on_cmd18[]= { |
| 185 | 0x02, 0x00, 0x39, 0xc0, |
| 186 | 0x53, 0x24, 0xff, 0xff, |
| 187 | }; |
| 188 | |
| 189 | static char lead_fl10802_fwvga_video_on_cmd19[] = { |
| 190 | 0x11, 0x00, 0x05, 0x80 |
| 191 | }; |
| 192 | |
| 193 | static char lead_fl10802_fwvga_video_on_cmd20[] = { |
| 194 | 0x29, 0x00, 0x05, 0x80 |
| 195 | }; |
| 196 | |
| 197 | static char lead_fl10802_fwvga_video_on_cmd21[] = { |
| 198 | 0x02, 0x00, 0x39, 0xc0, |
| 199 | 0x51, 0x80, 0xff, 0xff, |
| 200 | }; |
| 201 | |
| 202 | static struct mipi_dsi_cmd lead_fl10802_fwvga_video_on_command[] = { |
| 203 | {sizeof(lead_fl10802_fwvga_video_on_cmd0), lead_fl10802_fwvga_video_on_cmd0, 0x00}, |
| 204 | {sizeof(lead_fl10802_fwvga_video_on_cmd1), lead_fl10802_fwvga_video_on_cmd1, 0x00}, |
| 205 | {sizeof(lead_fl10802_fwvga_video_on_cmd2), lead_fl10802_fwvga_video_on_cmd2, 0x00}, |
| 206 | {sizeof(lead_fl10802_fwvga_video_on_cmd3), lead_fl10802_fwvga_video_on_cmd3, 0x00}, |
| 207 | {sizeof(lead_fl10802_fwvga_video_on_cmd4), lead_fl10802_fwvga_video_on_cmd4, 0x00}, |
| 208 | {sizeof(lead_fl10802_fwvga_video_on_cmd5), lead_fl10802_fwvga_video_on_cmd5, 0x00}, |
| 209 | {sizeof(lead_fl10802_fwvga_video_on_cmd6), lead_fl10802_fwvga_video_on_cmd6, 0x00}, |
| 210 | {sizeof(lead_fl10802_fwvga_video_on_cmd7), lead_fl10802_fwvga_video_on_cmd7, 0x00}, |
| 211 | {sizeof(lead_fl10802_fwvga_video_on_cmd8), lead_fl10802_fwvga_video_on_cmd8, 0x00}, |
| 212 | {sizeof(lead_fl10802_fwvga_video_on_cmd9), lead_fl10802_fwvga_video_on_cmd9, 0x00}, |
| 213 | {sizeof(lead_fl10802_fwvga_video_on_cmd10), lead_fl10802_fwvga_video_on_cmd10, 0x00}, |
| 214 | {sizeof(lead_fl10802_fwvga_video_on_cmd11), lead_fl10802_fwvga_video_on_cmd11, 0x00}, |
| 215 | {sizeof(lead_fl10802_fwvga_video_on_cmd12), lead_fl10802_fwvga_video_on_cmd12, 0x05}, |
| 216 | {sizeof(lead_fl10802_fwvga_video_on_cmd13), lead_fl10802_fwvga_video_on_cmd13, 0x00}, |
| 217 | {sizeof(lead_fl10802_fwvga_video_on_cmd14), lead_fl10802_fwvga_video_on_cmd14, 0x00}, |
| 218 | {sizeof(lead_fl10802_fwvga_video_on_cmd15), lead_fl10802_fwvga_video_on_cmd15, 0x00}, |
| 219 | {sizeof(lead_fl10802_fwvga_video_on_cmd16), lead_fl10802_fwvga_video_on_cmd16, 0x05}, |
| 220 | {sizeof(lead_fl10802_fwvga_video_on_cmd17), lead_fl10802_fwvga_video_on_cmd17, 0x00}, |
| 221 | {sizeof(lead_fl10802_fwvga_video_on_cmd18), lead_fl10802_fwvga_video_on_cmd18, 0x00}, |
| 222 | {sizeof(lead_fl10802_fwvga_video_on_cmd19), lead_fl10802_fwvga_video_on_cmd19, 0x78}, |
| 223 | {sizeof(lead_fl10802_fwvga_video_on_cmd20), lead_fl10802_fwvga_video_on_cmd20, 0x78}, |
| 224 | {sizeof(lead_fl10802_fwvga_video_on_cmd21), lead_fl10802_fwvga_video_on_cmd21, 0x00}, |
| 225 | }; |
| 226 | |
| 227 | #define LEAD_FL10802_FWVGA_VIDEO_ON_COMMAND 22 |
| 228 | |
| 229 | static char lead_fl10802_fwvga_video_off_cmd0[] = { |
| 230 | 0x28, 0x00, 0x05, 0x80 |
| 231 | }; |
| 232 | |
| 233 | static char lead_fl10802_fwvga_video_off_cmd1[] = { |
| 234 | 0x10, 0x00, 0x05, 0x80 |
| 235 | }; |
| 236 | |
| 237 | static struct mipi_dsi_cmd lead_fl10802_fwvga_video_off_command[] = { |
| 238 | {0x4, lead_fl10802_fwvga_video_off_cmd0, 0x32}, |
| 239 | {0x4, lead_fl10802_fwvga_video_off_cmd1, 0x78} |
| 240 | }; |
| 241 | |
| 242 | #define LEAD_FL10802_FWVGA_VIDEO_OFF_COMMAND 2 |
| 243 | |
| 244 | static struct command_state lead_fl10802_fwvga_video_state = { |
| 245 | 0, 1 |
| 246 | }; |
| 247 | |
| 248 | /*---------------------------------------------------------------------------*/ |
| 249 | /* Command mode panel information */ |
| 250 | /*---------------------------------------------------------------------------*/ |
| 251 | static struct commandpanel_info lead_fl10802_fwvga_video_command_panel = { |
| 252 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 253 | }; |
| 254 | |
| 255 | /*---------------------------------------------------------------------------*/ |
| 256 | /* Video mode panel information */ |
| 257 | /*---------------------------------------------------------------------------*/ |
| 258 | static struct videopanel_info lead_fl10802_fwvga_video_video_panel = { |
| 259 | 1, 0, 0, 0, 1, 1, 2, 0, 0x9 |
| 260 | }; |
| 261 | |
| 262 | /*---------------------------------------------------------------------------*/ |
| 263 | /* Lane configuration */ |
| 264 | /*---------------------------------------------------------------------------*/ |
| 265 | static struct lane_configuration lead_fl10802_fwvga_video_lane_config = { |
| 266 | 2, 0, 1, 1, 0, 0, 0 |
| 267 | }; |
| 268 | |
| 269 | /*---------------------------------------------------------------------------*/ |
| 270 | /* Panel timing */ |
| 271 | /*---------------------------------------------------------------------------*/ |
| 272 | static const uint32_t lead_fl10802_fwvga_video_timings[] = { |
| 273 | 0x87, 0x1c, 0x12, 0x00, 0x42, 0x44, 0x18, 0x20, 0x17, 0x03, 0x04, 0x00 |
| 274 | }; |
| 275 | |
| 276 | static struct panel_timing lead_fl10802_fwvga_video_timing_info = { |
| 277 | 0, 4, 0x04, 0x1b |
| 278 | }; |
| 279 | |
| 280 | /*---------------------------------------------------------------------------*/ |
| 281 | /* Panel reset sequence */ |
| 282 | /*---------------------------------------------------------------------------*/ |
| 283 | static struct panel_reset_sequence lead_fl10802_fwvga_video_reset_seq = { |
| 284 | {1, 0, 1, }, {20, 10, 20, }, 2 |
| 285 | }; |
| 286 | |
| 287 | /*---------------------------------------------------------------------------*/ |
| 288 | /* Backlight setting */ |
| 289 | /*---------------------------------------------------------------------------*/ |
| 290 | static struct backlight lead_fl10802_fwvga_video_backlight = { |
| 291 | BL_DCS, 1, 255, 100, 2, "PMIC_8941" |
| 292 | }; |
| 293 | |
| 294 | #define LEAD_FL10802_FWVGA_VIDEO_SIGNATURE 0xFFFF |
| 295 | |
| 296 | #endif /*_PANEL_LEAD_FL10802_FWVGA_VIDEO_H_*/ |