Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2018, 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 |
| 5 | * are 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 copyright |
| 9 | * notice, this list of conditions and the following disclaimer in |
| 10 | * the documentation and/or other materials provided with the |
| 11 | * 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 19 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 20 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 22 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 23 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 24 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 26 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 | * SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #ifndef _PANEL_HX8399C_HD_PLUS_VIDEO_H_ |
| 31 | |
| 32 | #define _PANEL_HX8399C_HD_PLUS_VIDEO_H_ |
| 33 | /*---------------------------------------------------------------------------*/ |
| 34 | /* HEADER files */ |
| 35 | /*---------------------------------------------------------------------------*/ |
| 36 | #include "panel.h" |
| 37 | |
| 38 | /*---------------------------------------------------------------------------*/ |
| 39 | /* Panel configuration */ |
| 40 | /*---------------------------------------------------------------------------*/ |
| 41 | static struct panel_config hx8399c_hd_plus_video_panel_data = { |
| 42 | "qcom,mdss_dsi_hx8399c_hd_video", "dsi:0:", "qcom,mdss-dsi-panel", |
| 43 | 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, NULL |
| 44 | }; |
| 45 | |
| 46 | /*---------------------------------------------------------------------------*/ |
| 47 | /* Panel resolution */ |
| 48 | /*---------------------------------------------------------------------------*/ |
| 49 | static struct panel_resolution hx8399c_hd_plus_video_panel_res = { |
| 50 | 720, 1440, 24, 24, 16, 0, 36, 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 51 | }; |
| 52 | |
| 53 | /*---------------------------------------------------------------------------*/ |
| 54 | /* Panel color information */ |
| 55 | /*---------------------------------------------------------------------------*/ |
| 56 | static struct color_info hx8399c_hd_plus_video_color = { |
| 57 | 24, 0, 0xff, 0, 0, 0 |
| 58 | }; |
| 59 | |
| 60 | /*---------------------------------------------------------------------------*/ |
| 61 | /* Panel on/off command information */ |
| 62 | /*---------------------------------------------------------------------------*/ |
| 63 | static char hx8399c_hd_plus_video_on_cmd0[] = { |
| 64 | 0x04, 0x00, 0x39, 0xC0, |
| 65 | 0xB9, 0xFF, 0x83, 0x99, |
| 66 | }; |
| 67 | |
| 68 | static char hx8399c_hd_plus_video_on_cmd1[] = { |
| 69 | 0x02, 0x00, 0x39, 0xC0, |
| 70 | 0xD2, 0x88, 0xFF, 0xFF, |
| 71 | }; |
| 72 | |
| 73 | static char hx8399c_hd_plus_video_on_cmd2[] = { |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 74 | 0x0C, 0x00, 0x39, 0xC0, |
| 75 | 0xB1, 0x02, 0x04, 0x72, |
| 76 | 0x92, 0x01, 0x32, 0xAA, |
| 77 | 0x11, 0x11, 0x52, 0x57, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | static char hx8399c_hd_plus_video_on_cmd3[] = { |
| 81 | 0x10, 0x00, 0x39, 0xC0, |
| 82 | 0xB2, 0x00, 0x80, 0x80, |
| 83 | 0xCC, 0x05, 0x07, 0x5A, |
| 84 | 0x11, 0x10, 0x10, 0x00, |
| 85 | 0x1E, 0x70, 0x03, 0xD4, |
| 86 | }; |
| 87 | |
| 88 | static char hx8399c_hd_plus_video_on_cmd4[] = { |
| 89 | 0x2D, 0x00, 0x39, 0xC0, |
| 90 | 0xB4, 0x00, 0xFF, 0x59, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 91 | 0x59, 0x01, 0xAB, 0x00, |
| 92 | 0x00, 0x09, 0x00, 0x03, |
| 93 | 0x05, 0x00, 0x28, 0x03, |
| 94 | 0x0B, 0x0D, 0x21, 0x03, |
| 95 | 0x02, 0x00, 0x0C, 0xA3, |
| 96 | 0x80, 0x59, 0x59, 0x02, |
| 97 | 0xAB, 0x00, 0x00, 0x09, |
| 98 | 0x00, 0x03, 0x05, 0x00, |
| 99 | 0x28, 0x03, 0x0B, 0x0D, |
| 100 | 0x02, 0x00, 0x0C, 0xA3, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 101 | 0x01, 0xFF, 0xFF, 0xFF, |
| 102 | }; |
| 103 | |
| 104 | static char hx8399c_hd_plus_video_on_cmd5[] = { |
| 105 | 0x22, 0x00, 0x39, 0xC0, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 106 | 0xD3, 0x00, 0x0C, 0x03, |
| 107 | 0x03, 0x00, 0x00, 0x10, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 108 | 0x10, 0x00, 0x00, 0x03, |
| 109 | 0x00, 0x03, 0x00, 0x08, |
| 110 | 0x78, 0x08, 0x78, 0x00, |
| 111 | 0x00, 0x00, 0x00, 0x00, |
| 112 | 0x24, 0x02, 0x05, 0x05, |
| 113 | 0x03, 0x00, 0x00, 0x00, |
| 114 | 0x05, 0x40, 0xFF, 0xFF, |
| 115 | }; |
| 116 | |
| 117 | static char hx8399c_hd_plus_video_on_cmd6[] = { |
| 118 | 0x21, 0x00, 0x39, 0xC0, |
| 119 | 0xD5, 0x20, 0x20, 0x19, |
| 120 | 0x19, 0x18, 0x18, 0x02, |
| 121 | 0x03, 0x00, 0x01, 0x24, |
| 122 | 0x24, 0x18, 0x18, 0x18, |
| 123 | 0x18, 0x24, 0x24, 0x00, |
| 124 | 0x00, 0x00, 0x00, 0x00, |
| 125 | 0x00, 0x00, 0x00, 0x2F, |
| 126 | 0x2F, 0x30, 0x30, 0x31, |
| 127 | 0x31, 0xFF, 0xFF, 0xFF, |
| 128 | }; |
| 129 | |
| 130 | static char hx8399c_hd_plus_video_on_cmd7[] = { |
| 131 | 0x21, 0x00, 0x39, 0xC0, |
| 132 | 0xD6, 0x24, 0x24, 0x18, |
| 133 | 0x18, 0x19, 0x19, 0x01, |
| 134 | 0x00, 0x03, 0x02, 0x24, |
| 135 | 0x24, 0x18, 0x18, 0x18, |
| 136 | 0x18, 0x20, 0x20, 0x40, |
| 137 | 0x40, 0x40, 0x40, 0x40, |
| 138 | 0x40, 0x40, 0x40, 0x2F, |
| 139 | 0x2F, 0x30, 0x30, 0x31, |
| 140 | 0x31, 0xFF, 0xFF, 0xFF, |
| 141 | }; |
| 142 | |
| 143 | static char hx8399c_hd_plus_video_on_cmd8[] = { |
| 144 | 0x02, 0x00, 0x39, 0xC0, |
| 145 | 0xBD, 0x00, 0xFF, 0xFF, |
| 146 | }; |
| 147 | |
| 148 | static char hx8399c_hd_plus_video_on_cmd9[] = { |
| 149 | 0x11, 0x00, 0x39, 0xC0, |
| 150 | 0xD8, 0xAA, 0xAA, 0xAA, |
| 151 | 0xAA, 0xAA, 0xAA, 0xAA, |
| 152 | 0xAA, 0xAA, 0xBA, 0xAA, |
| 153 | 0xAA, 0xAA, 0xBA, 0xAA, |
| 154 | 0xAA, 0xFF, 0xFF, 0xFF, |
| 155 | }; |
| 156 | |
| 157 | static char hx8399c_hd_plus_video_on_cmd10[] = { |
| 158 | 0x02, 0x00, 0x39, 0xC0, |
| 159 | 0xBD, 0x01, 0xFF, 0xFF, |
| 160 | }; |
| 161 | |
| 162 | static char hx8399c_hd_plus_video_on_cmd11[] = { |
| 163 | 0x11, 0x00, 0x39, 0xC0, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 164 | 0xD8, 0x00, 0x00, 0x00, |
| 165 | 0x00, 0x00, 0x00, 0x00, |
| 166 | 0x00, 0x82, 0xEA, 0xAA, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 167 | 0xAA, 0x82, 0xEA, 0xAA, |
| 168 | 0xAA, 0xFF, 0xFF, 0xFF, |
| 169 | }; |
| 170 | |
| 171 | static char hx8399c_hd_plus_video_on_cmd12[] = { |
| 172 | 0x02, 0x00, 0x39, 0xC0, |
| 173 | 0xBD, 0x02, 0xFF, 0xFF, |
| 174 | }; |
| 175 | |
| 176 | static char hx8399c_hd_plus_video_on_cmd13[] = { |
| 177 | 0x09, 0x00, 0x39, 0xC0, |
| 178 | 0xD8, 0xFF, 0xFF, 0xC0, |
| 179 | 0x3F, 0xFF, 0xFF, 0xC0, |
| 180 | 0x3F, 0xFF, 0xFF, 0xFF, |
| 181 | }; |
| 182 | |
| 183 | static char hx8399c_hd_plus_video_on_cmd14[] = { |
| 184 | 0x02, 0x00, 0x39, 0xC0, |
| 185 | 0xBD, 0x00, 0xFF, 0xFF, |
| 186 | }; |
| 187 | |
| 188 | static char hx8399c_hd_plus_video_on_cmd15[] = { |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 189 | 0x37, 0x00, 0x39, 0xC0, |
| 190 | 0xE0, 0x01, 0x21, 0x31, |
| 191 | 0x2D, 0x66, 0x6F, 0x7B, |
| 192 | 0x75, 0x7A, 0x81, 0x86, |
| 193 | 0x89, 0x8C, 0x90, 0x95, |
| 194 | 0x97, 0x9A, 0xA1, 0xA2, |
| 195 | 0xAA, 0x9E, 0xAD, 0xB0, |
| 196 | 0x5B, 0x57, 0x63, 0x7A, |
| 197 | 0x01, 0x21, 0x31, 0x2D, |
| 198 | 0x66, 0x6F, 0x7B, 0x75, |
| 199 | 0x7A, 0x81, 0x86, 0x89, |
| 200 | 0x9C, 0x90, 0x95, 0x97, |
| 201 | 0x9A, 0xA1, 0xA2, 0xAA, |
| 202 | 0x9E, 0xAD, 0xB0, 0x5B, |
| 203 | 0x57, 0x63, 0x7A, 0xFF, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 204 | }; |
| 205 | |
| 206 | static char hx8399c_hd_plus_video_on_cmd16[] = { |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 207 | 0x03, 0x00, 0x39, 0xC0, |
| 208 | 0xB6, 0x7E, 0x7E, 0xFF, |
| 209 | }; |
| 210 | |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 211 | static char hx8399c_hd_plus_video_on_cmd17[] = { |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 212 | 0x02, 0x00, 0x39, 0xC0, |
| 213 | 0xCC, 0x08, 0xFF, 0xFF, |
| 214 | }; |
| 215 | |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 216 | static char hx8399c_hd_plus_video_on_cmd18[] = { |
| 217 | 0x02, 0x00, 0x39, 0xC0, |
| 218 | 0x35, 0x00, 0xFF, 0xFF, |
| 219 | }; |
| 220 | |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 221 | static char hx8399c_hd_plus_video_on_cmd19[] = { |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 222 | 0x02, 0x00, 0x39, 0xC0, |
| 223 | 0xdd, 0x03, 0xFF, 0xFF, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 224 | }; |
| 225 | |
| 226 | static char hx8399c_hd_plus_video_on_cmd20[] = { |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 227 | 0x11, 0x00, 0x05, 0x80, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 228 | }; |
| 229 | |
| 230 | static char hx8399c_hd_plus_video_on_cmd21[] = { |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 231 | 0x29, 0x00, 0x05, 0x80, |
| 232 | }; |
| 233 | |
| 234 | static struct mipi_dsi_cmd hx8399c_hd_plus_video_on_command[] = { |
| 235 | {0x08, hx8399c_hd_plus_video_on_cmd0, 0x00}, |
| 236 | {0x08, hx8399c_hd_plus_video_on_cmd1, 0x00}, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 237 | {0x10, hx8399c_hd_plus_video_on_cmd2, 0x00}, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 238 | {0x14, hx8399c_hd_plus_video_on_cmd3, 0x00}, |
| 239 | {0x34, hx8399c_hd_plus_video_on_cmd4, 0x00}, |
| 240 | {0x28, hx8399c_hd_plus_video_on_cmd5, 0x05}, |
| 241 | {0x28, hx8399c_hd_plus_video_on_cmd6, 0x05}, |
| 242 | {0x28, hx8399c_hd_plus_video_on_cmd7, 0x05}, |
| 243 | {0x08, hx8399c_hd_plus_video_on_cmd8, 0x00}, |
| 244 | {0x18, hx8399c_hd_plus_video_on_cmd9, 0x00}, |
| 245 | {0x08, hx8399c_hd_plus_video_on_cmd10, 0x00}, |
| 246 | {0x18, hx8399c_hd_plus_video_on_cmd11, 0x00}, |
| 247 | {0x08, hx8399c_hd_plus_video_on_cmd12, 0x00}, |
| 248 | {0x10, hx8399c_hd_plus_video_on_cmd13, 0x00}, |
| 249 | {0x08, hx8399c_hd_plus_video_on_cmd14, 0x00}, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 250 | {0x3C, hx8399c_hd_plus_video_on_cmd15, 0x05}, |
| 251 | {0x08, hx8399c_hd_plus_video_on_cmd16, 0x00}, |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 252 | {0x08, hx8399c_hd_plus_video_on_cmd17, 0x00}, |
| 253 | {0x08, hx8399c_hd_plus_video_on_cmd18, 0x00}, |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 254 | {0x08, hx8399c_hd_plus_video_on_cmd19, 0x00}, |
| 255 | {0x04, hx8399c_hd_plus_video_on_cmd20, 0x78}, |
| 256 | {0x04, hx8399c_hd_plus_video_on_cmd21, 0x14} |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 257 | }; |
| 258 | |
Wenjun Zhang | 23dfc17 | 2018-05-31 04:22:48 -0400 | [diff] [blame^] | 259 | #define HX8399C_HD_PLUS_VIDEO_ON_COMMAND 22 |
Padmanabhan Komanduru | 8224cb0 | 2018-04-30 16:50:42 +0530 | [diff] [blame] | 260 | |
| 261 | |
| 262 | static char hx8399c_hd_plus_videooff_cmd0[] = { |
| 263 | 0x28, 0x00, 0x05, 0x80 |
| 264 | }; |
| 265 | |
| 266 | static char hx8399c_hd_plus_videooff_cmd1[] = { |
| 267 | 0x10, 0x00, 0x05, 0x80 |
| 268 | }; |
| 269 | |
| 270 | static struct mipi_dsi_cmd hx8399c_hd_plus_video_off_command[] = { |
| 271 | {0x4, hx8399c_hd_plus_videooff_cmd0, 0x14}, |
| 272 | {0x4, hx8399c_hd_plus_videooff_cmd1, 0x78} |
| 273 | }; |
| 274 | |
| 275 | #define HX8399C_HD_PLUS_VIDEO_OFF_COMMAND 2 |
| 276 | |
| 277 | |
| 278 | static struct command_state hx8399c_hd_plus_video_state = { |
| 279 | 0, 1 |
| 280 | }; |
| 281 | |
| 282 | /*---------------------------------------------------------------------------*/ |
| 283 | /* Command mode panel information */ |
| 284 | /*---------------------------------------------------------------------------*/ |
| 285 | static struct commandpanel_info hx8399c_hd_plus_video_command_panel = { |
| 286 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 287 | }; |
| 288 | |
| 289 | /*---------------------------------------------------------------------------*/ |
| 290 | /* Video mode panel information */ |
| 291 | /*---------------------------------------------------------------------------*/ |
| 292 | static struct videopanel_info hx8399c_hd_plus_video_video_panel = { |
| 293 | 0, 0, 0, 0, 1, 1, 1, 0, 0x9 |
| 294 | }; |
| 295 | |
| 296 | /*---------------------------------------------------------------------------*/ |
| 297 | /* Lane configuration */ |
| 298 | /*---------------------------------------------------------------------------*/ |
| 299 | static struct lane_configuration hx8399c_hd_plus_video_lane_config = { |
| 300 | 4, 0, 1, 1, 1, 1, 0 |
| 301 | }; |
| 302 | |
| 303 | /*---------------------------------------------------------------------------*/ |
| 304 | /* Panel timing */ |
| 305 | /*---------------------------------------------------------------------------*/ |
| 306 | static const uint32_t hx8399c_hd_plus_video_timings[] = { |
| 307 | 0x7E, 0x48, 0x3C, 0x00, 0x64, 0x59, 0x3B, 0x4A, 0x2E, 0x03, 0x04, 0x00 |
| 308 | }; |
| 309 | |
| 310 | static const uint32_t hx8399c_hd_plus_video_12nm_timings[] = { |
| 311 | 0x08, 0x06, 0x0A, 0x02, 0x00, 0x04, 0x02, 0x08 |
| 312 | }; |
| 313 | |
| 314 | static const uint32_t hx8399c_hd_plus_14nm_video_timings[] = { |
| 315 | 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0, |
| 316 | 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0, |
| 317 | 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0, |
| 318 | 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0, |
| 319 | 0x24, 0x1c, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0, |
| 320 | }; |
| 321 | static struct panel_timing hx8399c_hd_plus_video_timing_info = { |
| 322 | 0, 4, 0x0e, 0x31 |
| 323 | }; |
| 324 | |
| 325 | static struct labibb_desc hx8399c_hd_plus_video_labibb = { |
| 326 | 0, 1, 5700000, 5700000, 5700000, 5700000, 3, 3, 1, 0 |
| 327 | }; |
| 328 | |
| 329 | /*---------------------------------------------------------------------------*/ |
| 330 | /* Panel reset sequence */ |
| 331 | /*---------------------------------------------------------------------------*/ |
| 332 | static struct panel_reset_sequence hx8399c_hd_plus_video_panel_reset_seq = { |
| 333 | {1, 0, 1, }, {10, 10, 10, }, 2 |
| 334 | }; |
| 335 | |
| 336 | /*---------------------------------------------------------------------------*/ |
| 337 | /* Backlight setting */ |
| 338 | /*---------------------------------------------------------------------------*/ |
| 339 | static struct backlight hx8399c_hd_plus_video_backlight = { |
| 340 | 0, 1, 4095, 100, 1, "PMIC_8941" |
| 341 | }; |
| 342 | |
| 343 | #define HX8399C_HD_PLUS_VIDEO_SIGNATURE 0xFFFF |
| 344 | |
| 345 | #endif /*_PANEL_HX8399C_HD_PLUS_VIDEO_H_*/ |