1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (c) 2018 MediaTek Inc. 4 * Author: Jitao Shi <jitao.shi@mediatek.com> 5 */ 6 7 #include <linux/delay.h> 8 #include <linux/gpio/consumer.h> 9 #include <linux/module.h> 10 #include <linux/of.h> 11 #include <linux/of_device.h> 12 #include <linux/regulator/consumer.h> 13 14 #include <drm/drm_connector.h> 15 #include <drm/drm_crtc.h> 16 #include <drm/drm_mipi_dsi.h> 17 #include <drm/drm_panel.h> 18 19 #include <video/mipi_display.h> 20 21 struct panel_desc { 22 const struct drm_display_mode *modes; 23 unsigned int bpc; 24 25 /** 26 * @width_mm: width of the panel's active display area 27 * @height_mm: height of the panel's active display area 28 */ 29 struct { 30 unsigned int width_mm; 31 unsigned int height_mm; 32 } size; 33 34 unsigned long mode_flags; 35 enum mipi_dsi_pixel_format format; 36 const struct panel_init_cmd *init_cmds; 37 unsigned int lanes; 38 bool discharge_on_disable; 39 bool lp11_before_reset; 40 }; 41 42 struct boe_panel { 43 struct drm_panel base; 44 struct mipi_dsi_device *dsi; 45 46 const struct panel_desc *desc; 47 48 enum drm_panel_orientation orientation; 49 struct regulator *pp3300; 50 struct regulator *pp1800; 51 struct regulator *avee; 52 struct regulator *avdd; 53 struct gpio_desc *enable_gpio; 54 55 bool prepared; 56 }; 57 58 enum dsi_cmd_type { 59 INIT_DCS_CMD, 60 DELAY_CMD, 61 }; 62 63 struct panel_init_cmd { 64 enum dsi_cmd_type type; 65 size_t len; 66 const char *data; 67 }; 68 69 #define _INIT_DCS_CMD(...) { \ 70 .type = INIT_DCS_CMD, \ 71 .len = sizeof((char[]){__VA_ARGS__}), \ 72 .data = (char[]){__VA_ARGS__} } 73 74 #define _INIT_DELAY_CMD(...) { \ 75 .type = DELAY_CMD,\ 76 .len = sizeof((char[]){__VA_ARGS__}), \ 77 .data = (char[]){__VA_ARGS__} } 78 79 static const struct panel_init_cmd boe_tv110c9m_init_cmd[] = { 80 _INIT_DCS_CMD(0xFF, 0x20), 81 _INIT_DCS_CMD(0xFB, 0x01), 82 _INIT_DCS_CMD(0x05, 0xD9), 83 _INIT_DCS_CMD(0x07, 0x78), 84 _INIT_DCS_CMD(0x08, 0x5A), 85 _INIT_DCS_CMD(0x0D, 0x63), 86 _INIT_DCS_CMD(0x0E, 0x91), 87 _INIT_DCS_CMD(0x0F, 0x73), 88 _INIT_DCS_CMD(0x95, 0xE6), 89 _INIT_DCS_CMD(0x96, 0xF0), 90 _INIT_DCS_CMD(0x30, 0x00), 91 _INIT_DCS_CMD(0x6D, 0x66), 92 _INIT_DCS_CMD(0x75, 0xA2), 93 _INIT_DCS_CMD(0x77, 0x3B), 94 95 _INIT_DCS_CMD(0xB0, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4D, 0x00, 0x6D, 0x00, 0x89, 0x00, 0xA1, 0x00, 0xB6, 0x00, 0xC9), 96 _INIT_DCS_CMD(0xB1, 0x00, 0xDA, 0x01, 0x13, 0x01, 0x3C, 0x01, 0x7E, 0x01, 0xAB, 0x01, 0xF7, 0x02, 0x2F, 0x02, 0x31), 97 _INIT_DCS_CMD(0xB2, 0x02, 0x67, 0x02, 0xA6, 0x02, 0xD1, 0x03, 0x08, 0x03, 0x2E, 0x03, 0x5B, 0x03, 0x6B, 0x03, 0x7B), 98 _INIT_DCS_CMD(0xB3, 0x03, 0x8E, 0x03, 0xA2, 0x03, 0xB7, 0x03, 0xE7, 0x03, 0xFD, 0x03, 0xFF), 99 100 _INIT_DCS_CMD(0xB4, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4D, 0x00, 0x6D, 0x00, 0x89, 0x00, 0xA1, 0x00, 0xB6, 0x00, 0xC9), 101 _INIT_DCS_CMD(0xB5, 0x00, 0xDA, 0x01, 0x13, 0x01, 0x3C, 0x01, 0x7E, 0x01, 0xAB, 0x01, 0xF7, 0x02, 0x2F, 0x02, 0x31), 102 _INIT_DCS_CMD(0xB6, 0x02, 0x67, 0x02, 0xA6, 0x02, 0xD1, 0x03, 0x08, 0x03, 0x2E, 0x03, 0x5B, 0x03, 0x6B, 0x03, 0x7B), 103 _INIT_DCS_CMD(0xB7, 0x03, 0x8E, 0x03, 0xA2, 0x03, 0xB7, 0x03, 0xE7, 0x03, 0xFD, 0x03, 0xFF), 104 _INIT_DCS_CMD(0xB8, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4D, 0x00, 0x6D, 0x00, 0x89, 0x00, 0xA1, 0x00, 0xB6, 0x00, 0xC9), 105 _INIT_DCS_CMD(0xB9, 0x00, 0xDA, 0x01, 0x13, 0x01, 0x3C, 0x01, 0x7E, 0x01, 0xAB, 0x01, 0xF7, 0x02, 0x2F, 0x02, 0x31), 106 _INIT_DCS_CMD(0xBA, 0x02, 0x67, 0x02, 0xA6, 0x02, 0xD1, 0x03, 0x08, 0x03, 0x2E, 0x03, 0x5B, 0x03, 0x6B, 0x03, 0x7B), 107 _INIT_DCS_CMD(0xBB, 0x03, 0x8E, 0x03, 0xA2, 0x03, 0xB7, 0x03, 0xE7, 0x03, 0xFD, 0x03, 0xFF), 108 109 _INIT_DCS_CMD(0xFF, 0x21), 110 _INIT_DCS_CMD(0xFB, 0x01), 111 112 _INIT_DCS_CMD(0xB0, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x45, 0x00, 0x65, 0x00, 0x81, 0x00, 0x99, 0x00, 0xAE, 0x00, 0xC1), 113 _INIT_DCS_CMD(0xB1, 0x00, 0xD2, 0x01, 0x0B, 0x01, 0x34, 0x01, 0x76, 0x01, 0xA3, 0x01, 0xEF, 0x02, 0x27, 0x02, 0x29), 114 _INIT_DCS_CMD(0xB2, 0x02, 0x5F, 0x02, 0x9E, 0x02, 0xC9, 0x03, 0x00, 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73), 115 116 _INIT_DCS_CMD(0xB3, 0x03, 0x86, 0x03, 0x9A, 0x03, 0xAF, 0x03, 0xDF, 0x03, 0xF5, 0x03, 0xE0), 117 _INIT_DCS_CMD(0xB4, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x45, 0x00, 0x65, 0x00, 0x81, 0x00, 0x99, 0x00, 0xAE, 0x00, 0xC1), 118 _INIT_DCS_CMD(0xB5, 0x00, 0xD2, 0x01, 0x0B, 0x01, 0x34, 0x01, 0x76, 0x01, 0xA3, 0x01, 0xEF, 0x02, 0x27, 0x02, 0x29), 119 _INIT_DCS_CMD(0xB6, 0x02, 0x5F, 0x02, 0x9E, 0x02, 0xC9, 0x03, 0x00, 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73), 120 _INIT_DCS_CMD(0xB7, 0x03, 0x86, 0x03, 0x9A, 0x03, 0xAF, 0x03, 0xDF, 0x03, 0xF5, 0x03, 0xE0), 121 122 _INIT_DCS_CMD(0xB8, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x45, 0x00, 0x65, 0x00, 0x81, 0x00, 0x99, 0x00, 0xAE, 0x00, 0xC1), 123 _INIT_DCS_CMD(0xB9, 0x00, 0xD2, 0x01, 0x0B, 0x01, 0x34, 0x01, 0x76, 0x01, 0xA3, 0x01, 0xEF, 0x02, 0x27, 0x02, 0x29), 124 _INIT_DCS_CMD(0xBA, 0x02, 0x5F, 0x02, 0x9E, 0x02, 0xC9, 0x03, 0x00, 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73), 125 126 _INIT_DCS_CMD(0xBB, 0x03, 0x86, 0x03, 0x9A, 0x03, 0xAF, 0x03, 0xDF, 0x03, 0xF5, 0x03, 0xE0), 127 _INIT_DCS_CMD(0xFF, 0x24), 128 _INIT_DCS_CMD(0xFB, 0x01), 129 130 _INIT_DCS_CMD(0x00, 0x00), 131 _INIT_DCS_CMD(0x01, 0x00), 132 133 _INIT_DCS_CMD(0x02, 0x1C), 134 _INIT_DCS_CMD(0x03, 0x1C), 135 136 _INIT_DCS_CMD(0x04, 0x1D), 137 _INIT_DCS_CMD(0x05, 0x1D), 138 139 _INIT_DCS_CMD(0x06, 0x04), 140 _INIT_DCS_CMD(0x07, 0x04), 141 142 _INIT_DCS_CMD(0x08, 0x0F), 143 _INIT_DCS_CMD(0x09, 0x0F), 144 145 _INIT_DCS_CMD(0x0A, 0x0E), 146 _INIT_DCS_CMD(0x0B, 0x0E), 147 148 _INIT_DCS_CMD(0x0C, 0x0D), 149 _INIT_DCS_CMD(0x0D, 0x0D), 150 151 _INIT_DCS_CMD(0x0E, 0x0C), 152 _INIT_DCS_CMD(0x0F, 0x0C), 153 154 _INIT_DCS_CMD(0x10, 0x08), 155 _INIT_DCS_CMD(0x11, 0x08), 156 157 _INIT_DCS_CMD(0x12, 0x00), 158 _INIT_DCS_CMD(0x13, 0x00), 159 _INIT_DCS_CMD(0x14, 0x00), 160 _INIT_DCS_CMD(0x15, 0x00), 161 162 _INIT_DCS_CMD(0x16, 0x00), 163 _INIT_DCS_CMD(0x17, 0x00), 164 165 _INIT_DCS_CMD(0x18, 0x1C), 166 _INIT_DCS_CMD(0x19, 0x1C), 167 168 _INIT_DCS_CMD(0x1A, 0x1D), 169 _INIT_DCS_CMD(0x1B, 0x1D), 170 171 _INIT_DCS_CMD(0x1C, 0x04), 172 _INIT_DCS_CMD(0x1D, 0x04), 173 174 _INIT_DCS_CMD(0x1E, 0x0F), 175 _INIT_DCS_CMD(0x1F, 0x0F), 176 177 _INIT_DCS_CMD(0x20, 0x0E), 178 _INIT_DCS_CMD(0x21, 0x0E), 179 180 _INIT_DCS_CMD(0x22, 0x0D), 181 _INIT_DCS_CMD(0x23, 0x0D), 182 183 _INIT_DCS_CMD(0x24, 0x0C), 184 _INIT_DCS_CMD(0x25, 0x0C), 185 186 _INIT_DCS_CMD(0x26, 0x08), 187 _INIT_DCS_CMD(0x27, 0x08), 188 189 _INIT_DCS_CMD(0x28, 0x00), 190 _INIT_DCS_CMD(0x29, 0x00), 191 _INIT_DCS_CMD(0x2A, 0x00), 192 _INIT_DCS_CMD(0x2B, 0x00), 193 194 _INIT_DCS_CMD(0x2D, 0x20), 195 _INIT_DCS_CMD(0x2F, 0x0A), 196 _INIT_DCS_CMD(0x30, 0x44), 197 _INIT_DCS_CMD(0x33, 0x0C), 198 _INIT_DCS_CMD(0x34, 0x32), 199 200 _INIT_DCS_CMD(0x37, 0x44), 201 _INIT_DCS_CMD(0x38, 0x40), 202 _INIT_DCS_CMD(0x39, 0x00), 203 _INIT_DCS_CMD(0x3A, 0x5D), 204 _INIT_DCS_CMD(0x3B, 0x60), 205 _INIT_DCS_CMD(0x3D, 0x42), 206 _INIT_DCS_CMD(0x3F, 0x06), 207 _INIT_DCS_CMD(0x43, 0x06), 208 _INIT_DCS_CMD(0x47, 0x66), 209 _INIT_DCS_CMD(0x4A, 0x5D), 210 _INIT_DCS_CMD(0x4B, 0x60), 211 _INIT_DCS_CMD(0x4C, 0x91), 212 _INIT_DCS_CMD(0x4D, 0x21), 213 _INIT_DCS_CMD(0x4E, 0x43), 214 _INIT_DCS_CMD(0x51, 0x12), 215 _INIT_DCS_CMD(0x52, 0x34), 216 _INIT_DCS_CMD(0x55, 0x82, 0x02), 217 _INIT_DCS_CMD(0x56, 0x04), 218 _INIT_DCS_CMD(0x58, 0x21), 219 _INIT_DCS_CMD(0x59, 0x30), 220 _INIT_DCS_CMD(0x5A, 0x60), 221 _INIT_DCS_CMD(0x5B, 0x50), 222 _INIT_DCS_CMD(0x5E, 0x00, 0x06), 223 _INIT_DCS_CMD(0x5F, 0x00), 224 _INIT_DCS_CMD(0x65, 0x82), 225 _INIT_DCS_CMD(0x7E, 0x20), 226 _INIT_DCS_CMD(0x7F, 0x3C), 227 _INIT_DCS_CMD(0x82, 0x04), 228 _INIT_DCS_CMD(0x97, 0xC0), 229 230 _INIT_DCS_CMD(0xB6, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x00, 0x00), 231 _INIT_DCS_CMD(0x91, 0x44), 232 _INIT_DCS_CMD(0x92, 0xA9), 233 _INIT_DCS_CMD(0x93, 0x1A), 234 _INIT_DCS_CMD(0x94, 0x96), 235 _INIT_DCS_CMD(0xD7, 0x55), 236 _INIT_DCS_CMD(0xDA, 0x0A), 237 _INIT_DCS_CMD(0xDE, 0x08), 238 _INIT_DCS_CMD(0xDB, 0x05), 239 _INIT_DCS_CMD(0xDC, 0xA9), 240 _INIT_DCS_CMD(0xDD, 0x22), 241 242 _INIT_DCS_CMD(0xDF, 0x05), 243 _INIT_DCS_CMD(0xE0, 0xA9), 244 _INIT_DCS_CMD(0xE1, 0x05), 245 _INIT_DCS_CMD(0xE2, 0xA9), 246 _INIT_DCS_CMD(0xE3, 0x05), 247 _INIT_DCS_CMD(0xE4, 0xA9), 248 _INIT_DCS_CMD(0xE5, 0x05), 249 _INIT_DCS_CMD(0xE6, 0xA9), 250 _INIT_DCS_CMD(0x5C, 0x00), 251 _INIT_DCS_CMD(0x5D, 0x00), 252 _INIT_DCS_CMD(0x8D, 0x00), 253 _INIT_DCS_CMD(0x8E, 0x00), 254 _INIT_DCS_CMD(0xB5, 0x90), 255 _INIT_DCS_CMD(0xFF, 0x25), 256 _INIT_DCS_CMD(0xFB, 0x01), 257 _INIT_DCS_CMD(0x05, 0x00), 258 _INIT_DCS_CMD(0x19, 0x07), 259 _INIT_DCS_CMD(0x1F, 0x60), 260 _INIT_DCS_CMD(0x20, 0x50), 261 _INIT_DCS_CMD(0x26, 0x60), 262 _INIT_DCS_CMD(0x27, 0x50), 263 _INIT_DCS_CMD(0x33, 0x60), 264 _INIT_DCS_CMD(0x34, 0x50), 265 _INIT_DCS_CMD(0x3F, 0xE0), 266 _INIT_DCS_CMD(0x40, 0x00), 267 _INIT_DCS_CMD(0x44, 0x00), 268 _INIT_DCS_CMD(0x45, 0x40), 269 _INIT_DCS_CMD(0x48, 0x60), 270 _INIT_DCS_CMD(0x49, 0x50), 271 _INIT_DCS_CMD(0x5B, 0x00), 272 _INIT_DCS_CMD(0x5C, 0x00), 273 _INIT_DCS_CMD(0x5D, 0x00), 274 _INIT_DCS_CMD(0x5E, 0xD0), 275 _INIT_DCS_CMD(0x61, 0x60), 276 _INIT_DCS_CMD(0x62, 0x50), 277 _INIT_DCS_CMD(0xF1, 0x10), 278 _INIT_DCS_CMD(0xFF, 0x2A), 279 _INIT_DCS_CMD(0xFB, 0x01), 280 281 _INIT_DCS_CMD(0x64, 0x16), 282 _INIT_DCS_CMD(0x67, 0x16), 283 _INIT_DCS_CMD(0x6A, 0x16), 284 285 _INIT_DCS_CMD(0x70, 0x30), 286 287 _INIT_DCS_CMD(0xA2, 0xF3), 288 _INIT_DCS_CMD(0xA3, 0xFF), 289 _INIT_DCS_CMD(0xA4, 0xFF), 290 _INIT_DCS_CMD(0xA5, 0xFF), 291 292 _INIT_DCS_CMD(0xD6, 0x08), 293 294 _INIT_DCS_CMD(0xFF, 0x26), 295 _INIT_DCS_CMD(0xFB, 0x01), 296 _INIT_DCS_CMD(0x00, 0xA1), 297 298 _INIT_DCS_CMD(0x02, 0x31), 299 _INIT_DCS_CMD(0x04, 0x28), 300 _INIT_DCS_CMD(0x06, 0x30), 301 _INIT_DCS_CMD(0x0C, 0x16), 302 _INIT_DCS_CMD(0x0D, 0x0D), 303 _INIT_DCS_CMD(0x0F, 0x00), 304 _INIT_DCS_CMD(0x11, 0x00), 305 _INIT_DCS_CMD(0x12, 0x50), 306 _INIT_DCS_CMD(0x13, 0x56), 307 _INIT_DCS_CMD(0x14, 0x57), 308 _INIT_DCS_CMD(0x15, 0x00), 309 _INIT_DCS_CMD(0x16, 0x10), 310 _INIT_DCS_CMD(0x17, 0xA0), 311 _INIT_DCS_CMD(0x18, 0x86), 312 _INIT_DCS_CMD(0x19, 0x0D), 313 _INIT_DCS_CMD(0x1A, 0x7F), 314 _INIT_DCS_CMD(0x1B, 0x0C), 315 _INIT_DCS_CMD(0x1C, 0xBF), 316 _INIT_DCS_CMD(0x22, 0x00), 317 _INIT_DCS_CMD(0x23, 0x00), 318 _INIT_DCS_CMD(0x2A, 0x0D), 319 _INIT_DCS_CMD(0x2B, 0x7F), 320 321 _INIT_DCS_CMD(0x1D, 0x00), 322 _INIT_DCS_CMD(0x1E, 0x65), 323 _INIT_DCS_CMD(0x1F, 0x65), 324 _INIT_DCS_CMD(0x24, 0x00), 325 _INIT_DCS_CMD(0x25, 0x65), 326 _INIT_DCS_CMD(0x2F, 0x05), 327 _INIT_DCS_CMD(0x30, 0x65), 328 _INIT_DCS_CMD(0x31, 0x05), 329 _INIT_DCS_CMD(0x32, 0x7D), 330 _INIT_DCS_CMD(0x39, 0x00), 331 _INIT_DCS_CMD(0x3A, 0x65), 332 _INIT_DCS_CMD(0x20, 0x01), 333 _INIT_DCS_CMD(0x33, 0x11), 334 _INIT_DCS_CMD(0x34, 0x78), 335 _INIT_DCS_CMD(0x35, 0x16), 336 _INIT_DCS_CMD(0xC8, 0x04), 337 _INIT_DCS_CMD(0xC9, 0x9E), 338 _INIT_DCS_CMD(0xCA, 0x4E), 339 _INIT_DCS_CMD(0xCB, 0x00), 340 341 _INIT_DCS_CMD(0xA9, 0x49), 342 _INIT_DCS_CMD(0xAA, 0x4B), 343 _INIT_DCS_CMD(0xAB, 0x48), 344 _INIT_DCS_CMD(0xAC, 0x43), 345 _INIT_DCS_CMD(0xAD, 0x40), 346 _INIT_DCS_CMD(0xAE, 0x50), 347 _INIT_DCS_CMD(0xAF, 0x44), 348 _INIT_DCS_CMD(0xB0, 0x54), 349 _INIT_DCS_CMD(0xB1, 0x4E), 350 _INIT_DCS_CMD(0xB2, 0x4D), 351 _INIT_DCS_CMD(0xB3, 0x4C), 352 _INIT_DCS_CMD(0xB4, 0x41), 353 _INIT_DCS_CMD(0xB5, 0x47), 354 _INIT_DCS_CMD(0xB6, 0x53), 355 _INIT_DCS_CMD(0xB7, 0x3E), 356 _INIT_DCS_CMD(0xB8, 0x51), 357 _INIT_DCS_CMD(0xB9, 0x3C), 358 _INIT_DCS_CMD(0xBA, 0x3B), 359 _INIT_DCS_CMD(0xBB, 0x46), 360 _INIT_DCS_CMD(0xBC, 0x45), 361 _INIT_DCS_CMD(0xBD, 0x55), 362 _INIT_DCS_CMD(0xBE, 0x3D), 363 _INIT_DCS_CMD(0xBF, 0x3F), 364 _INIT_DCS_CMD(0xC0, 0x52), 365 _INIT_DCS_CMD(0xC1, 0x4A), 366 _INIT_DCS_CMD(0xC2, 0x39), 367 _INIT_DCS_CMD(0xC3, 0x4F), 368 _INIT_DCS_CMD(0xC4, 0x3A), 369 _INIT_DCS_CMD(0xC5, 0x42), 370 _INIT_DCS_CMD(0xFF, 0x27), 371 _INIT_DCS_CMD(0xFB, 0x01), 372 373 _INIT_DCS_CMD(0x56, 0x06), 374 _INIT_DCS_CMD(0x58, 0x80), 375 _INIT_DCS_CMD(0x59, 0x75), 376 _INIT_DCS_CMD(0x5A, 0x00), 377 _INIT_DCS_CMD(0x5B, 0x02), 378 _INIT_DCS_CMD(0x5C, 0x00), 379 _INIT_DCS_CMD(0x5D, 0x00), 380 _INIT_DCS_CMD(0x5E, 0x20), 381 _INIT_DCS_CMD(0x5F, 0x10), 382 _INIT_DCS_CMD(0x60, 0x00), 383 _INIT_DCS_CMD(0x61, 0x2E), 384 _INIT_DCS_CMD(0x62, 0x00), 385 _INIT_DCS_CMD(0x63, 0x01), 386 _INIT_DCS_CMD(0x64, 0x43), 387 _INIT_DCS_CMD(0x65, 0x2D), 388 _INIT_DCS_CMD(0x66, 0x00), 389 _INIT_DCS_CMD(0x67, 0x01), 390 _INIT_DCS_CMD(0x68, 0x44), 391 392 _INIT_DCS_CMD(0x00, 0x00), 393 _INIT_DCS_CMD(0x78, 0x00), 394 _INIT_DCS_CMD(0xC3, 0x00), 395 396 _INIT_DCS_CMD(0xFF, 0x2A), 397 _INIT_DCS_CMD(0xFB, 0x01), 398 399 _INIT_DCS_CMD(0x22, 0x2F), 400 _INIT_DCS_CMD(0x23, 0x08), 401 402 _INIT_DCS_CMD(0x24, 0x00), 403 _INIT_DCS_CMD(0x25, 0x65), 404 _INIT_DCS_CMD(0x26, 0xF8), 405 _INIT_DCS_CMD(0x27, 0x00), 406 _INIT_DCS_CMD(0x28, 0x1A), 407 _INIT_DCS_CMD(0x29, 0x00), 408 _INIT_DCS_CMD(0x2A, 0x1A), 409 _INIT_DCS_CMD(0x2B, 0x00), 410 _INIT_DCS_CMD(0x2D, 0x1A), 411 412 _INIT_DCS_CMD(0xFF, 0x23), 413 _INIT_DCS_CMD(0xFB, 0x01), 414 415 _INIT_DCS_CMD(0x00, 0x80), 416 _INIT_DCS_CMD(0x07, 0x00), 417 418 _INIT_DCS_CMD(0xFF, 0xE0), 419 _INIT_DCS_CMD(0xFB, 0x01), 420 _INIT_DCS_CMD(0x14, 0x60), 421 _INIT_DCS_CMD(0x16, 0xC0), 422 423 _INIT_DCS_CMD(0xFF, 0xF0), 424 _INIT_DCS_CMD(0xFB, 0x01), 425 _INIT_DCS_CMD(0x3A, 0x08), 426 427 _INIT_DCS_CMD(0xFF, 0x10), 428 _INIT_DCS_CMD(0xFB, 0x01), 429 _INIT_DCS_CMD(0xB9, 0x01), 430 _INIT_DCS_CMD(0xFF, 0x20), 431 _INIT_DCS_CMD(0xFB, 0x01), 432 _INIT_DCS_CMD(0x18, 0x40), 433 434 _INIT_DCS_CMD(0xFF, 0x10), 435 _INIT_DCS_CMD(0xFB, 0x01), 436 _INIT_DCS_CMD(0xB9, 0x02), 437 _INIT_DCS_CMD(0x35, 0x00), 438 _INIT_DCS_CMD(0x51, 0x00, 0xFF), 439 _INIT_DCS_CMD(0x53, 0x24), 440 _INIT_DCS_CMD(0x55, 0x00), 441 _INIT_DCS_CMD(0xBB, 0x13), 442 _INIT_DCS_CMD(0x3B, 0x03, 0x96, 0x1A, 0x04, 0x04), 443 _INIT_DELAY_CMD(100), 444 _INIT_DCS_CMD(0x11), 445 _INIT_DELAY_CMD(200), 446 _INIT_DCS_CMD(0x29), 447 _INIT_DELAY_CMD(100), 448 {}, 449 }; 450 451 static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { 452 _INIT_DCS_CMD(0xFF, 0x20), 453 _INIT_DCS_CMD(0xFB, 0x01), 454 _INIT_DCS_CMD(0x05, 0xD1), 455 _INIT_DCS_CMD(0x06, 0xC0), 456 _INIT_DCS_CMD(0x07, 0x87), 457 _INIT_DCS_CMD(0x08, 0x4B), 458 459 _INIT_DCS_CMD(0x0D, 0x63), 460 _INIT_DCS_CMD(0x0E, 0x91), 461 _INIT_DCS_CMD(0x0F, 0x69), 462 _INIT_DCS_CMD(0x94, 0x00), 463 _INIT_DCS_CMD(0x95, 0xF5), 464 _INIT_DCS_CMD(0x96, 0xF5), 465 _INIT_DCS_CMD(0x9D, 0x00), 466 _INIT_DCS_CMD(0x9E, 0x00), 467 _INIT_DCS_CMD(0x69, 0x98), 468 _INIT_DCS_CMD(0x75, 0xA2), 469 _INIT_DCS_CMD(0x77, 0xB3), 470 471 _INIT_DCS_CMD(0x58, 0x43), 472 _INIT_DCS_CMD(0xFF, 0x24), 473 _INIT_DCS_CMD(0xFB, 0x01), 474 _INIT_DCS_CMD(0x91, 0x44), 475 _INIT_DCS_CMD(0x92, 0x4C), 476 _INIT_DCS_CMD(0x94, 0x86), 477 _INIT_DCS_CMD(0x60, 0x96), 478 _INIT_DCS_CMD(0x61, 0xD0), 479 _INIT_DCS_CMD(0x63, 0x70), 480 _INIT_DCS_CMD(0xC2, 0xCA), 481 482 _INIT_DCS_CMD(0x00, 0x03), 483 _INIT_DCS_CMD(0x01, 0x03), 484 _INIT_DCS_CMD(0x02, 0x03), 485 _INIT_DCS_CMD(0x03, 0x29), 486 _INIT_DCS_CMD(0x04, 0x22), 487 _INIT_DCS_CMD(0x05, 0x22), 488 _INIT_DCS_CMD(0x06, 0x0B), 489 _INIT_DCS_CMD(0x07, 0x1D), 490 _INIT_DCS_CMD(0x08, 0x1C), 491 _INIT_DCS_CMD(0x09, 0x05), 492 _INIT_DCS_CMD(0x0A, 0x08), 493 _INIT_DCS_CMD(0x0B, 0x09), 494 _INIT_DCS_CMD(0x0C, 0x0A), 495 _INIT_DCS_CMD(0x0D, 0x0C), 496 _INIT_DCS_CMD(0x0E, 0x0D), 497 _INIT_DCS_CMD(0x0F, 0x0E), 498 _INIT_DCS_CMD(0x10, 0x0F), 499 _INIT_DCS_CMD(0x11, 0x10), 500 _INIT_DCS_CMD(0x12, 0x11), 501 _INIT_DCS_CMD(0x13, 0x04), 502 _INIT_DCS_CMD(0x14, 0x00), 503 _INIT_DCS_CMD(0x15, 0x03), 504 _INIT_DCS_CMD(0x16, 0x03), 505 _INIT_DCS_CMD(0x17, 0x03), 506 _INIT_DCS_CMD(0x18, 0x03), 507 _INIT_DCS_CMD(0x19, 0x29), 508 _INIT_DCS_CMD(0x1A, 0x22), 509 _INIT_DCS_CMD(0x1B, 0x22), 510 _INIT_DCS_CMD(0x1C, 0x0B), 511 _INIT_DCS_CMD(0x1D, 0x1D), 512 _INIT_DCS_CMD(0x1E, 0x1C), 513 _INIT_DCS_CMD(0x1F, 0x05), 514 _INIT_DCS_CMD(0x20, 0x08), 515 _INIT_DCS_CMD(0x21, 0x09), 516 _INIT_DCS_CMD(0x22, 0x0A), 517 _INIT_DCS_CMD(0x23, 0x0C), 518 _INIT_DCS_CMD(0x24, 0x0D), 519 _INIT_DCS_CMD(0x25, 0x0E), 520 _INIT_DCS_CMD(0x26, 0x0F), 521 _INIT_DCS_CMD(0x27, 0x10), 522 _INIT_DCS_CMD(0x28, 0x11), 523 _INIT_DCS_CMD(0x29, 0x04), 524 _INIT_DCS_CMD(0x2A, 0x00), 525 _INIT_DCS_CMD(0x2B, 0x03), 526 527 _INIT_DCS_CMD(0x2F, 0x0A), 528 _INIT_DCS_CMD(0x30, 0x35), 529 _INIT_DCS_CMD(0x37, 0xA7), 530 _INIT_DCS_CMD(0x39, 0x00), 531 _INIT_DCS_CMD(0x3A, 0x46), 532 _INIT_DCS_CMD(0x3B, 0x32), 533 _INIT_DCS_CMD(0x3D, 0x12), 534 535 _INIT_DCS_CMD(0x3F, 0x33), 536 _INIT_DCS_CMD(0x40, 0x31), 537 _INIT_DCS_CMD(0x41, 0x40), 538 _INIT_DCS_CMD(0x42, 0x42), 539 _INIT_DCS_CMD(0x47, 0x77), 540 _INIT_DCS_CMD(0x48, 0x77), 541 _INIT_DCS_CMD(0x4A, 0x45), 542 _INIT_DCS_CMD(0x4B, 0x45), 543 _INIT_DCS_CMD(0x4C, 0x14), 544 545 _INIT_DCS_CMD(0x4D, 0x21), 546 _INIT_DCS_CMD(0x4E, 0x43), 547 _INIT_DCS_CMD(0x4F, 0x65), 548 _INIT_DCS_CMD(0x55, 0x06), 549 _INIT_DCS_CMD(0x56, 0x06), 550 _INIT_DCS_CMD(0x58, 0x21), 551 _INIT_DCS_CMD(0x59, 0x70), 552 _INIT_DCS_CMD(0x5A, 0x46), 553 _INIT_DCS_CMD(0x5B, 0x32), 554 _INIT_DCS_CMD(0x5C, 0x88), 555 _INIT_DCS_CMD(0x5E, 0x00, 0x00), 556 _INIT_DCS_CMD(0x5F, 0x00), 557 558 _INIT_DCS_CMD(0x7A, 0xFF), 559 _INIT_DCS_CMD(0x7B, 0xFF), 560 _INIT_DCS_CMD(0x7C, 0x00), 561 _INIT_DCS_CMD(0x7D, 0x00), 562 _INIT_DCS_CMD(0x7E, 0x20), 563 _INIT_DCS_CMD(0x7F, 0x3C), 564 _INIT_DCS_CMD(0x80, 0x00), 565 _INIT_DCS_CMD(0x81, 0x00), 566 _INIT_DCS_CMD(0x82, 0x08), 567 _INIT_DCS_CMD(0x97, 0x02), 568 _INIT_DCS_CMD(0xC5, 0x10), 569 570 _INIT_DCS_CMD(0xD7, 0x55), 571 _INIT_DCS_CMD(0xD8, 0x55), 572 _INIT_DCS_CMD(0xD9, 0x23), 573 _INIT_DCS_CMD(0xDA, 0x05), 574 _INIT_DCS_CMD(0xDB, 0x01), 575 _INIT_DCS_CMD(0xDC, 0x65), 576 _INIT_DCS_CMD(0xDD, 0x55), 577 _INIT_DCS_CMD(0xDE, 0x27), 578 _INIT_DCS_CMD(0xDF, 0x01), 579 _INIT_DCS_CMD(0xE0, 0x65), 580 _INIT_DCS_CMD(0xE1, 0x01), 581 _INIT_DCS_CMD(0xE2, 0x65), 582 _INIT_DCS_CMD(0xE3, 0x01), 583 _INIT_DCS_CMD(0xE4, 0x65), 584 _INIT_DCS_CMD(0xE5, 0x01), 585 _INIT_DCS_CMD(0xE6, 0x65), 586 _INIT_DCS_CMD(0xE7, 0x00), 587 _INIT_DCS_CMD(0xE8, 0x00), 588 _INIT_DCS_CMD(0xE9, 0x01), 589 _INIT_DCS_CMD(0xEA, 0x65), 590 _INIT_DCS_CMD(0xEB, 0x01), 591 _INIT_DCS_CMD(0xEE, 0x65), 592 _INIT_DCS_CMD(0xEF, 0x01), 593 _INIT_DCS_CMD(0xF0, 0x65), 594 _INIT_DCS_CMD(0xB6, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x00, 0x00), 595 596 _INIT_DCS_CMD(0xFF, 0x25), 597 598 _INIT_DCS_CMD(0xFB, 0x01), 599 _INIT_DCS_CMD(0x05, 0x00), 600 _INIT_DCS_CMD(0xF1, 0x10), 601 602 _INIT_DCS_CMD(0x1E, 0x00), 603 _INIT_DCS_CMD(0x1F, 0x46), 604 _INIT_DCS_CMD(0x20, 0x32), 605 606 _INIT_DCS_CMD(0x25, 0x00), 607 _INIT_DCS_CMD(0x26, 0x46), 608 _INIT_DCS_CMD(0x27, 0x32), 609 610 _INIT_DCS_CMD(0x3F, 0x80), 611 _INIT_DCS_CMD(0x40, 0x00), 612 _INIT_DCS_CMD(0x43, 0x00), 613 614 _INIT_DCS_CMD(0x44, 0x46), 615 _INIT_DCS_CMD(0x45, 0x46), 616 617 _INIT_DCS_CMD(0x48, 0x46), 618 _INIT_DCS_CMD(0x49, 0x32), 619 620 _INIT_DCS_CMD(0x5B, 0x80), 621 622 _INIT_DCS_CMD(0x5C, 0x00), 623 _INIT_DCS_CMD(0x5D, 0x46), 624 _INIT_DCS_CMD(0x5E, 0x32), 625 626 _INIT_DCS_CMD(0x5F, 0x46), 627 _INIT_DCS_CMD(0x60, 0x32), 628 629 _INIT_DCS_CMD(0x61, 0x46), 630 _INIT_DCS_CMD(0x62, 0x32), 631 _INIT_DCS_CMD(0x68, 0x0C), 632 633 _INIT_DCS_CMD(0x6C, 0x0D), 634 _INIT_DCS_CMD(0x6E, 0x0D), 635 _INIT_DCS_CMD(0x78, 0x00), 636 _INIT_DCS_CMD(0x79, 0xC5), 637 _INIT_DCS_CMD(0x7A, 0x0C), 638 _INIT_DCS_CMD(0x7B, 0xB0), 639 640 _INIT_DCS_CMD(0xFF, 0x26), 641 _INIT_DCS_CMD(0xFB, 0x01), 642 643 _INIT_DCS_CMD(0x00, 0xA1), 644 _INIT_DCS_CMD(0x02, 0x31), 645 _INIT_DCS_CMD(0x0A, 0xF4), 646 _INIT_DCS_CMD(0x04, 0x50), 647 _INIT_DCS_CMD(0x06, 0x30), 648 _INIT_DCS_CMD(0x0C, 0x16), 649 _INIT_DCS_CMD(0x0D, 0x0D), 650 _INIT_DCS_CMD(0x0F, 0x00), 651 _INIT_DCS_CMD(0x11, 0x00), 652 _INIT_DCS_CMD(0x12, 0x50), 653 _INIT_DCS_CMD(0x13, 0x40), 654 _INIT_DCS_CMD(0x14, 0x58), 655 _INIT_DCS_CMD(0x15, 0x00), 656 _INIT_DCS_CMD(0x16, 0x10), 657 _INIT_DCS_CMD(0x17, 0xA0), 658 _INIT_DCS_CMD(0x18, 0x86), 659 _INIT_DCS_CMD(0x22, 0x00), 660 _INIT_DCS_CMD(0x23, 0x00), 661 662 _INIT_DCS_CMD(0x19, 0x0E), 663 _INIT_DCS_CMD(0x1A, 0x31), 664 _INIT_DCS_CMD(0x1B, 0x0D), 665 _INIT_DCS_CMD(0x1C, 0x29), 666 _INIT_DCS_CMD(0x2A, 0x0E), 667 _INIT_DCS_CMD(0x2B, 0x31), 668 669 _INIT_DCS_CMD(0x1D, 0x00), 670 _INIT_DCS_CMD(0x1E, 0x62), 671 _INIT_DCS_CMD(0x1F, 0x62), 672 673 _INIT_DCS_CMD(0x2F, 0x06), 674 _INIT_DCS_CMD(0x30, 0x62), 675 _INIT_DCS_CMD(0x31, 0x06), 676 _INIT_DCS_CMD(0x32, 0x7F), 677 _INIT_DCS_CMD(0x33, 0x11), 678 _INIT_DCS_CMD(0x34, 0x89), 679 _INIT_DCS_CMD(0x35, 0x67), 680 681 _INIT_DCS_CMD(0x39, 0x0B), 682 _INIT_DCS_CMD(0x3A, 0x62), 683 _INIT_DCS_CMD(0x3B, 0x06), 684 685 _INIT_DCS_CMD(0xC8, 0x04), 686 _INIT_DCS_CMD(0xC9, 0x89), 687 _INIT_DCS_CMD(0xCA, 0x4E), 688 _INIT_DCS_CMD(0xCB, 0x00), 689 _INIT_DCS_CMD(0xA9, 0x3F), 690 _INIT_DCS_CMD(0xAA, 0x3E), 691 _INIT_DCS_CMD(0xAB, 0x3D), 692 _INIT_DCS_CMD(0xAC, 0x3C), 693 _INIT_DCS_CMD(0xAD, 0x3B), 694 _INIT_DCS_CMD(0xAE, 0x3A), 695 _INIT_DCS_CMD(0xAF, 0x39), 696 _INIT_DCS_CMD(0xB0, 0x38), 697 698 _INIT_DCS_CMD(0xFF, 0x27), 699 _INIT_DCS_CMD(0xFB, 0x01), 700 701 _INIT_DCS_CMD(0xD0, 0x11), 702 _INIT_DCS_CMD(0xD1, 0x54), 703 _INIT_DCS_CMD(0xDE, 0x43), 704 _INIT_DCS_CMD(0xDF, 0x02), 705 706 _INIT_DCS_CMD(0xC0, 0x18), 707 _INIT_DCS_CMD(0xC1, 0x00), 708 _INIT_DCS_CMD(0xC2, 0x00), 709 _INIT_DCS_CMD(0x00, 0x00), 710 _INIT_DCS_CMD(0xC3, 0x00), 711 _INIT_DCS_CMD(0x56, 0x06), 712 713 _INIT_DCS_CMD(0x58, 0x80), 714 _INIT_DCS_CMD(0x59, 0x78), 715 _INIT_DCS_CMD(0x5A, 0x00), 716 _INIT_DCS_CMD(0x5B, 0x18), 717 _INIT_DCS_CMD(0x5C, 0x00), 718 _INIT_DCS_CMD(0x5D, 0x01), 719 _INIT_DCS_CMD(0x5E, 0x20), 720 _INIT_DCS_CMD(0x5F, 0x10), 721 _INIT_DCS_CMD(0x60, 0x00), 722 _INIT_DCS_CMD(0x61, 0x1C), 723 _INIT_DCS_CMD(0x62, 0x00), 724 _INIT_DCS_CMD(0x63, 0x01), 725 _INIT_DCS_CMD(0x64, 0x44), 726 _INIT_DCS_CMD(0x65, 0x1B), 727 _INIT_DCS_CMD(0x66, 0x00), 728 _INIT_DCS_CMD(0x67, 0x01), 729 _INIT_DCS_CMD(0x68, 0x44), 730 731 _INIT_DCS_CMD(0x98, 0x01), 732 _INIT_DCS_CMD(0xB4, 0x03), 733 _INIT_DCS_CMD(0x9B, 0xBE), 734 735 _INIT_DCS_CMD(0xAB, 0x14), 736 _INIT_DCS_CMD(0xBC, 0x08), 737 _INIT_DCS_CMD(0xBD, 0x28), 738 739 _INIT_DCS_CMD(0xFF, 0x2A), 740 _INIT_DCS_CMD(0xFB, 0x01), 741 _INIT_DCS_CMD(0x22, 0x2F), 742 _INIT_DCS_CMD(0x23, 0x08), 743 744 _INIT_DCS_CMD(0x24, 0x00), 745 _INIT_DCS_CMD(0x25, 0x62), 746 _INIT_DCS_CMD(0x26, 0xF8), 747 _INIT_DCS_CMD(0x27, 0x00), 748 _INIT_DCS_CMD(0x28, 0x1A), 749 _INIT_DCS_CMD(0x29, 0x00), 750 _INIT_DCS_CMD(0x2A, 0x1A), 751 _INIT_DCS_CMD(0x2B, 0x00), 752 _INIT_DCS_CMD(0x2D, 0x1A), 753 754 _INIT_DCS_CMD(0x64, 0x96), 755 _INIT_DCS_CMD(0x65, 0x10), 756 _INIT_DCS_CMD(0x66, 0x00), 757 _INIT_DCS_CMD(0x67, 0x96), 758 _INIT_DCS_CMD(0x68, 0x10), 759 _INIT_DCS_CMD(0x69, 0x00), 760 _INIT_DCS_CMD(0x6A, 0x96), 761 _INIT_DCS_CMD(0x6B, 0x10), 762 _INIT_DCS_CMD(0x6C, 0x00), 763 _INIT_DCS_CMD(0x70, 0x92), 764 _INIT_DCS_CMD(0x71, 0x10), 765 _INIT_DCS_CMD(0x72, 0x00), 766 _INIT_DCS_CMD(0x79, 0x96), 767 _INIT_DCS_CMD(0x7A, 0x10), 768 _INIT_DCS_CMD(0x88, 0x96), 769 _INIT_DCS_CMD(0x89, 0x10), 770 771 _INIT_DCS_CMD(0xA2, 0x3F), 772 _INIT_DCS_CMD(0xA3, 0x30), 773 _INIT_DCS_CMD(0xA4, 0xC0), 774 _INIT_DCS_CMD(0xA5, 0x03), 775 776 _INIT_DCS_CMD(0xE8, 0x00), 777 778 _INIT_DCS_CMD(0x97, 0x3C), 779 _INIT_DCS_CMD(0x98, 0x02), 780 _INIT_DCS_CMD(0x99, 0x95), 781 _INIT_DCS_CMD(0x9A, 0x06), 782 _INIT_DCS_CMD(0x9B, 0x00), 783 _INIT_DCS_CMD(0x9C, 0x0B), 784 _INIT_DCS_CMD(0x9D, 0x0A), 785 _INIT_DCS_CMD(0x9E, 0x90), 786 787 _INIT_DCS_CMD(0xFF, 0x25), 788 _INIT_DCS_CMD(0x13, 0x02), 789 _INIT_DCS_CMD(0x14, 0xD7), 790 _INIT_DCS_CMD(0xDB, 0x02), 791 _INIT_DCS_CMD(0xDC, 0xD7), 792 _INIT_DCS_CMD(0x17, 0xCF), 793 _INIT_DCS_CMD(0x19, 0x0F), 794 _INIT_DCS_CMD(0x1B, 0x5B), 795 796 _INIT_DCS_CMD(0xFF, 0x20), 797 798 _INIT_DCS_CMD(0xB0, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x24, 0x00, 0x38, 0x00, 0x4C, 0x00, 0x5E, 0x00, 0x6F, 0x00, 0x7E), 799 _INIT_DCS_CMD(0xB1, 0x00, 0x8C, 0x00, 0xBE, 0x00, 0xE5, 0x01, 0x27, 0x01, 0x58, 0x01, 0xA8, 0x01, 0xE8, 0x01, 0xEA), 800 _INIT_DCS_CMD(0xB2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9E, 0x02, 0xDA, 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51), 801 _INIT_DCS_CMD(0xB3, 0x03, 0x62, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), 802 803 _INIT_DCS_CMD(0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x27, 0x00, 0x3D, 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84), 804 _INIT_DCS_CMD(0xB5, 0x00, 0x93, 0x00, 0xC5, 0x00, 0xEC, 0x01, 0x2C, 0x01, 0x5D, 0x01, 0xAC, 0x01, 0xEC, 0x01, 0xEE), 805 _INIT_DCS_CMD(0xB6, 0x02, 0x2B, 0x02, 0x73, 0x02, 0xA0, 0x02, 0xDB, 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51), 806 _INIT_DCS_CMD(0xB7, 0x03, 0x63, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), 807 808 _INIT_DCS_CMD(0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x2A, 0x00, 0x40, 0x00, 0x56, 0x00, 0x68, 0x00, 0x7A, 0x00, 0x89), 809 _INIT_DCS_CMD(0xB9, 0x00, 0x98, 0x00, 0xC9, 0x00, 0xF1, 0x01, 0x30, 0x01, 0x61, 0x01, 0xB0, 0x01, 0xEF, 0x01, 0xF1), 810 _INIT_DCS_CMD(0xBA, 0x02, 0x2E, 0x02, 0x76, 0x02, 0xA3, 0x02, 0xDD, 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53), 811 _INIT_DCS_CMD(0xBB, 0x03, 0x66, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), 812 813 _INIT_DCS_CMD(0xFF, 0x21), 814 _INIT_DCS_CMD(0xB0, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x24, 0x00, 0x38, 0x00, 0x4C, 0x00, 0x5E, 0x00, 0x6F, 0x00, 0x7E), 815 _INIT_DCS_CMD(0xB1, 0x00, 0x8C, 0x00, 0xBE, 0x00, 0xE5, 0x01, 0x27, 0x01, 0x58, 0x01, 0xA8, 0x01, 0xE8, 0x01, 0xEA), 816 _INIT_DCS_CMD(0xB2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9E, 0x02, 0xDA, 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51), 817 _INIT_DCS_CMD(0xB3, 0x03, 0x62, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), 818 819 _INIT_DCS_CMD(0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x27, 0x00, 0x3D, 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84), 820 _INIT_DCS_CMD(0xB5, 0x00, 0x93, 0x00, 0xC5, 0x00, 0xEC, 0x01, 0x2C, 0x01, 0x5D, 0x01, 0xAC, 0x01, 0xEC, 0x01, 0xEE), 821 _INIT_DCS_CMD(0xB6, 0x02, 0x2B, 0x02, 0x73, 0x02, 0xA0, 0x02, 0xDB, 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51), 822 _INIT_DCS_CMD(0xB7, 0x03, 0x63, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), 823 824 _INIT_DCS_CMD(0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x2A, 0x00, 0x40, 0x00, 0x56, 0x00, 0x68, 0x00, 0x7A, 0x00, 0x89), 825 _INIT_DCS_CMD(0xB9, 0x00, 0x98, 0x00, 0xC9, 0x00, 0xF1, 0x01, 0x30, 0x01, 0x61, 0x01, 0xB0, 0x01, 0xEF, 0x01, 0xF1), 826 _INIT_DCS_CMD(0xBA, 0x02, 0x2E, 0x02, 0x76, 0x02, 0xA3, 0x02, 0xDD, 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53), 827 _INIT_DCS_CMD(0xBB, 0x03, 0x66, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), 828 829 _INIT_DCS_CMD(0xFF, 0xF0), 830 _INIT_DCS_CMD(0xFB, 0x01), 831 _INIT_DCS_CMD(0x3A, 0x08), 832 833 _INIT_DCS_CMD(0xFF, 0x10), 834 _INIT_DCS_CMD(0xB9, 0x01), 835 836 _INIT_DCS_CMD(0xFF, 0x20), 837 838 _INIT_DCS_CMD(0x18, 0x40), 839 _INIT_DCS_CMD(0xFF, 0x10), 840 841 _INIT_DCS_CMD(0xB9, 0x02), 842 _INIT_DCS_CMD(0xFF, 0x10), 843 844 _INIT_DCS_CMD(0xFB, 0x01), 845 _INIT_DCS_CMD(0xB0, 0x01), 846 _INIT_DCS_CMD(0x35, 0x00), 847 _INIT_DCS_CMD(0x3B, 0x03, 0xAE, 0x1A, 0x04, 0x04), 848 _INIT_DELAY_CMD(100), 849 _INIT_DCS_CMD(0x11), 850 _INIT_DELAY_CMD(200), 851 _INIT_DCS_CMD(0x29), 852 _INIT_DELAY_CMD(100), 853 {}, 854 }; 855 856 static const struct panel_init_cmd boe_init_cmd[] = { 857 _INIT_DCS_CMD(0xB0, 0x05), 858 _INIT_DCS_CMD(0xB1, 0xE5), 859 _INIT_DCS_CMD(0xB3, 0x52), 860 _INIT_DCS_CMD(0xB0, 0x00), 861 _INIT_DCS_CMD(0xB3, 0x88), 862 _INIT_DCS_CMD(0xB0, 0x04), 863 _INIT_DCS_CMD(0xB8, 0x00), 864 _INIT_DCS_CMD(0xB0, 0x00), 865 _INIT_DCS_CMD(0xB6, 0x03), 866 _INIT_DCS_CMD(0xBA, 0x8B), 867 _INIT_DCS_CMD(0xBF, 0x1A), 868 _INIT_DCS_CMD(0xC0, 0x0F), 869 _INIT_DCS_CMD(0xC2, 0x0C), 870 _INIT_DCS_CMD(0xC3, 0x02), 871 _INIT_DCS_CMD(0xC4, 0x0C), 872 _INIT_DCS_CMD(0xC5, 0x02), 873 _INIT_DCS_CMD(0xB0, 0x01), 874 _INIT_DCS_CMD(0xE0, 0x26), 875 _INIT_DCS_CMD(0xE1, 0x26), 876 _INIT_DCS_CMD(0xDC, 0x00), 877 _INIT_DCS_CMD(0xDD, 0x00), 878 _INIT_DCS_CMD(0xCC, 0x26), 879 _INIT_DCS_CMD(0xCD, 0x26), 880 _INIT_DCS_CMD(0xC8, 0x00), 881 _INIT_DCS_CMD(0xC9, 0x00), 882 _INIT_DCS_CMD(0xD2, 0x03), 883 _INIT_DCS_CMD(0xD3, 0x03), 884 _INIT_DCS_CMD(0xE6, 0x04), 885 _INIT_DCS_CMD(0xE7, 0x04), 886 _INIT_DCS_CMD(0xC4, 0x09), 887 _INIT_DCS_CMD(0xC5, 0x09), 888 _INIT_DCS_CMD(0xD8, 0x0A), 889 _INIT_DCS_CMD(0xD9, 0x0A), 890 _INIT_DCS_CMD(0xC2, 0x0B), 891 _INIT_DCS_CMD(0xC3, 0x0B), 892 _INIT_DCS_CMD(0xD6, 0x0C), 893 _INIT_DCS_CMD(0xD7, 0x0C), 894 _INIT_DCS_CMD(0xC0, 0x05), 895 _INIT_DCS_CMD(0xC1, 0x05), 896 _INIT_DCS_CMD(0xD4, 0x06), 897 _INIT_DCS_CMD(0xD5, 0x06), 898 _INIT_DCS_CMD(0xCA, 0x07), 899 _INIT_DCS_CMD(0xCB, 0x07), 900 _INIT_DCS_CMD(0xDE, 0x08), 901 _INIT_DCS_CMD(0xDF, 0x08), 902 _INIT_DCS_CMD(0xB0, 0x02), 903 _INIT_DCS_CMD(0xC0, 0x00), 904 _INIT_DCS_CMD(0xC1, 0x0D), 905 _INIT_DCS_CMD(0xC2, 0x17), 906 _INIT_DCS_CMD(0xC3, 0x26), 907 _INIT_DCS_CMD(0xC4, 0x31), 908 _INIT_DCS_CMD(0xC5, 0x1C), 909 _INIT_DCS_CMD(0xC6, 0x2C), 910 _INIT_DCS_CMD(0xC7, 0x33), 911 _INIT_DCS_CMD(0xC8, 0x31), 912 _INIT_DCS_CMD(0xC9, 0x37), 913 _INIT_DCS_CMD(0xCA, 0x37), 914 _INIT_DCS_CMD(0xCB, 0x37), 915 _INIT_DCS_CMD(0xCC, 0x39), 916 _INIT_DCS_CMD(0xCD, 0x2E), 917 _INIT_DCS_CMD(0xCE, 0x2F), 918 _INIT_DCS_CMD(0xCF, 0x2F), 919 _INIT_DCS_CMD(0xD0, 0x07), 920 _INIT_DCS_CMD(0xD2, 0x00), 921 _INIT_DCS_CMD(0xD3, 0x0D), 922 _INIT_DCS_CMD(0xD4, 0x17), 923 _INIT_DCS_CMD(0xD5, 0x26), 924 _INIT_DCS_CMD(0xD6, 0x31), 925 _INIT_DCS_CMD(0xD7, 0x3F), 926 _INIT_DCS_CMD(0xD8, 0x3F), 927 _INIT_DCS_CMD(0xD9, 0x3F), 928 _INIT_DCS_CMD(0xDA, 0x3F), 929 _INIT_DCS_CMD(0xDB, 0x37), 930 _INIT_DCS_CMD(0xDC, 0x37), 931 _INIT_DCS_CMD(0xDD, 0x37), 932 _INIT_DCS_CMD(0xDE, 0x39), 933 _INIT_DCS_CMD(0xDF, 0x2E), 934 _INIT_DCS_CMD(0xE0, 0x2F), 935 _INIT_DCS_CMD(0xE1, 0x2F), 936 _INIT_DCS_CMD(0xE2, 0x07), 937 _INIT_DCS_CMD(0xB0, 0x03), 938 _INIT_DCS_CMD(0xC8, 0x0B), 939 _INIT_DCS_CMD(0xC9, 0x07), 940 _INIT_DCS_CMD(0xC3, 0x00), 941 _INIT_DCS_CMD(0xE7, 0x00), 942 _INIT_DCS_CMD(0xC5, 0x2A), 943 _INIT_DCS_CMD(0xDE, 0x2A), 944 _INIT_DCS_CMD(0xCA, 0x43), 945 _INIT_DCS_CMD(0xC9, 0x07), 946 _INIT_DCS_CMD(0xE4, 0xC0), 947 _INIT_DCS_CMD(0xE5, 0x0D), 948 _INIT_DCS_CMD(0xCB, 0x00), 949 _INIT_DCS_CMD(0xB0, 0x06), 950 _INIT_DCS_CMD(0xB8, 0xA5), 951 _INIT_DCS_CMD(0xC0, 0xA5), 952 _INIT_DCS_CMD(0xC7, 0x0F), 953 _INIT_DCS_CMD(0xD5, 0x32), 954 _INIT_DCS_CMD(0xB8, 0x00), 955 _INIT_DCS_CMD(0xC0, 0x00), 956 _INIT_DCS_CMD(0xBC, 0x00), 957 _INIT_DCS_CMD(0xB0, 0x07), 958 _INIT_DCS_CMD(0xB1, 0x00), 959 _INIT_DCS_CMD(0xB2, 0x02), 960 _INIT_DCS_CMD(0xB3, 0x0F), 961 _INIT_DCS_CMD(0xB4, 0x25), 962 _INIT_DCS_CMD(0xB5, 0x39), 963 _INIT_DCS_CMD(0xB6, 0x4E), 964 _INIT_DCS_CMD(0xB7, 0x72), 965 _INIT_DCS_CMD(0xB8, 0x97), 966 _INIT_DCS_CMD(0xB9, 0xDC), 967 _INIT_DCS_CMD(0xBA, 0x22), 968 _INIT_DCS_CMD(0xBB, 0xA4), 969 _INIT_DCS_CMD(0xBC, 0x2B), 970 _INIT_DCS_CMD(0xBD, 0x2F), 971 _INIT_DCS_CMD(0xBE, 0xA9), 972 _INIT_DCS_CMD(0xBF, 0x25), 973 _INIT_DCS_CMD(0xC0, 0x61), 974 _INIT_DCS_CMD(0xC1, 0x97), 975 _INIT_DCS_CMD(0xC2, 0xB2), 976 _INIT_DCS_CMD(0xC3, 0xCD), 977 _INIT_DCS_CMD(0xC4, 0xD9), 978 _INIT_DCS_CMD(0xC5, 0xE7), 979 _INIT_DCS_CMD(0xC6, 0xF4), 980 _INIT_DCS_CMD(0xC7, 0xFA), 981 _INIT_DCS_CMD(0xC8, 0xFC), 982 _INIT_DCS_CMD(0xC9, 0x00), 983 _INIT_DCS_CMD(0xCA, 0x00), 984 _INIT_DCS_CMD(0xCB, 0x16), 985 _INIT_DCS_CMD(0xCC, 0xAF), 986 _INIT_DCS_CMD(0xCD, 0xFF), 987 _INIT_DCS_CMD(0xCE, 0xFF), 988 _INIT_DCS_CMD(0xB0, 0x08), 989 _INIT_DCS_CMD(0xB1, 0x04), 990 _INIT_DCS_CMD(0xB2, 0x05), 991 _INIT_DCS_CMD(0xB3, 0x11), 992 _INIT_DCS_CMD(0xB4, 0x24), 993 _INIT_DCS_CMD(0xB5, 0x39), 994 _INIT_DCS_CMD(0xB6, 0x4F), 995 _INIT_DCS_CMD(0xB7, 0x72), 996 _INIT_DCS_CMD(0xB8, 0x98), 997 _INIT_DCS_CMD(0xB9, 0xDC), 998 _INIT_DCS_CMD(0xBA, 0x23), 999 _INIT_DCS_CMD(0xBB, 0xA6), 1000 _INIT_DCS_CMD(0xBC, 0x2C), 1001 _INIT_DCS_CMD(0xBD, 0x30), 1002 _INIT_DCS_CMD(0xBE, 0xAA), 1003 _INIT_DCS_CMD(0xBF, 0x26), 1004 _INIT_DCS_CMD(0xC0, 0x62), 1005 _INIT_DCS_CMD(0xC1, 0x9B), 1006 _INIT_DCS_CMD(0xC2, 0xB5), 1007 _INIT_DCS_CMD(0xC3, 0xCF), 1008 _INIT_DCS_CMD(0xC4, 0xDB), 1009 _INIT_DCS_CMD(0xC5, 0xE8), 1010 _INIT_DCS_CMD(0xC6, 0xF5), 1011 _INIT_DCS_CMD(0xC7, 0xFA), 1012 _INIT_DCS_CMD(0xC8, 0xFC), 1013 _INIT_DCS_CMD(0xC9, 0x00), 1014 _INIT_DCS_CMD(0xCA, 0x00), 1015 _INIT_DCS_CMD(0xCB, 0x16), 1016 _INIT_DCS_CMD(0xCC, 0xAF), 1017 _INIT_DCS_CMD(0xCD, 0xFF), 1018 _INIT_DCS_CMD(0xCE, 0xFF), 1019 _INIT_DCS_CMD(0xB0, 0x09), 1020 _INIT_DCS_CMD(0xB1, 0x04), 1021 _INIT_DCS_CMD(0xB2, 0x02), 1022 _INIT_DCS_CMD(0xB3, 0x16), 1023 _INIT_DCS_CMD(0xB4, 0x24), 1024 _INIT_DCS_CMD(0xB5, 0x3B), 1025 _INIT_DCS_CMD(0xB6, 0x4F), 1026 _INIT_DCS_CMD(0xB7, 0x73), 1027 _INIT_DCS_CMD(0xB8, 0x99), 1028 _INIT_DCS_CMD(0xB9, 0xE0), 1029 _INIT_DCS_CMD(0xBA, 0x26), 1030 _INIT_DCS_CMD(0xBB, 0xAD), 1031 _INIT_DCS_CMD(0xBC, 0x36), 1032 _INIT_DCS_CMD(0xBD, 0x3A), 1033 _INIT_DCS_CMD(0xBE, 0xAE), 1034 _INIT_DCS_CMD(0xBF, 0x2A), 1035 _INIT_DCS_CMD(0xC0, 0x66), 1036 _INIT_DCS_CMD(0xC1, 0x9E), 1037 _INIT_DCS_CMD(0xC2, 0xB8), 1038 _INIT_DCS_CMD(0xC3, 0xD1), 1039 _INIT_DCS_CMD(0xC4, 0xDD), 1040 _INIT_DCS_CMD(0xC5, 0xE9), 1041 _INIT_DCS_CMD(0xC6, 0xF6), 1042 _INIT_DCS_CMD(0xC7, 0xFA), 1043 _INIT_DCS_CMD(0xC8, 0xFC), 1044 _INIT_DCS_CMD(0xC9, 0x00), 1045 _INIT_DCS_CMD(0xCA, 0x00), 1046 _INIT_DCS_CMD(0xCB, 0x16), 1047 _INIT_DCS_CMD(0xCC, 0xAF), 1048 _INIT_DCS_CMD(0xCD, 0xFF), 1049 _INIT_DCS_CMD(0xCE, 0xFF), 1050 _INIT_DCS_CMD(0xB0, 0x0A), 1051 _INIT_DCS_CMD(0xB1, 0x00), 1052 _INIT_DCS_CMD(0xB2, 0x02), 1053 _INIT_DCS_CMD(0xB3, 0x0F), 1054 _INIT_DCS_CMD(0xB4, 0x25), 1055 _INIT_DCS_CMD(0xB5, 0x39), 1056 _INIT_DCS_CMD(0xB6, 0x4E), 1057 _INIT_DCS_CMD(0xB7, 0x72), 1058 _INIT_DCS_CMD(0xB8, 0x97), 1059 _INIT_DCS_CMD(0xB9, 0xDC), 1060 _INIT_DCS_CMD(0xBA, 0x22), 1061 _INIT_DCS_CMD(0xBB, 0xA4), 1062 _INIT_DCS_CMD(0xBC, 0x2B), 1063 _INIT_DCS_CMD(0xBD, 0x2F), 1064 _INIT_DCS_CMD(0xBE, 0xA9), 1065 _INIT_DCS_CMD(0xBF, 0x25), 1066 _INIT_DCS_CMD(0xC0, 0x61), 1067 _INIT_DCS_CMD(0xC1, 0x97), 1068 _INIT_DCS_CMD(0xC2, 0xB2), 1069 _INIT_DCS_CMD(0xC3, 0xCD), 1070 _INIT_DCS_CMD(0xC4, 0xD9), 1071 _INIT_DCS_CMD(0xC5, 0xE7), 1072 _INIT_DCS_CMD(0xC6, 0xF4), 1073 _INIT_DCS_CMD(0xC7, 0xFA), 1074 _INIT_DCS_CMD(0xC8, 0xFC), 1075 _INIT_DCS_CMD(0xC9, 0x00), 1076 _INIT_DCS_CMD(0xCA, 0x00), 1077 _INIT_DCS_CMD(0xCB, 0x16), 1078 _INIT_DCS_CMD(0xCC, 0xAF), 1079 _INIT_DCS_CMD(0xCD, 0xFF), 1080 _INIT_DCS_CMD(0xCE, 0xFF), 1081 _INIT_DCS_CMD(0xB0, 0x0B), 1082 _INIT_DCS_CMD(0xB1, 0x04), 1083 _INIT_DCS_CMD(0xB2, 0x05), 1084 _INIT_DCS_CMD(0xB3, 0x11), 1085 _INIT_DCS_CMD(0xB4, 0x24), 1086 _INIT_DCS_CMD(0xB5, 0x39), 1087 _INIT_DCS_CMD(0xB6, 0x4F), 1088 _INIT_DCS_CMD(0xB7, 0x72), 1089 _INIT_DCS_CMD(0xB8, 0x98), 1090 _INIT_DCS_CMD(0xB9, 0xDC), 1091 _INIT_DCS_CMD(0xBA, 0x23), 1092 _INIT_DCS_CMD(0xBB, 0xA6), 1093 _INIT_DCS_CMD(0xBC, 0x2C), 1094 _INIT_DCS_CMD(0xBD, 0x30), 1095 _INIT_DCS_CMD(0xBE, 0xAA), 1096 _INIT_DCS_CMD(0xBF, 0x26), 1097 _INIT_DCS_CMD(0xC0, 0x62), 1098 _INIT_DCS_CMD(0xC1, 0x9B), 1099 _INIT_DCS_CMD(0xC2, 0xB5), 1100 _INIT_DCS_CMD(0xC3, 0xCF), 1101 _INIT_DCS_CMD(0xC4, 0xDB), 1102 _INIT_DCS_CMD(0xC5, 0xE8), 1103 _INIT_DCS_CMD(0xC6, 0xF5), 1104 _INIT_DCS_CMD(0xC7, 0xFA), 1105 _INIT_DCS_CMD(0xC8, 0xFC), 1106 _INIT_DCS_CMD(0xC9, 0x00), 1107 _INIT_DCS_CMD(0xCA, 0x00), 1108 _INIT_DCS_CMD(0xCB, 0x16), 1109 _INIT_DCS_CMD(0xCC, 0xAF), 1110 _INIT_DCS_CMD(0xCD, 0xFF), 1111 _INIT_DCS_CMD(0xCE, 0xFF), 1112 _INIT_DCS_CMD(0xB0, 0x0C), 1113 _INIT_DCS_CMD(0xB1, 0x04), 1114 _INIT_DCS_CMD(0xB2, 0x02), 1115 _INIT_DCS_CMD(0xB3, 0x16), 1116 _INIT_DCS_CMD(0xB4, 0x24), 1117 _INIT_DCS_CMD(0xB5, 0x3B), 1118 _INIT_DCS_CMD(0xB6, 0x4F), 1119 _INIT_DCS_CMD(0xB7, 0x73), 1120 _INIT_DCS_CMD(0xB8, 0x99), 1121 _INIT_DCS_CMD(0xB9, 0xE0), 1122 _INIT_DCS_CMD(0xBA, 0x26), 1123 _INIT_DCS_CMD(0xBB, 0xAD), 1124 _INIT_DCS_CMD(0xBC, 0x36), 1125 _INIT_DCS_CMD(0xBD, 0x3A), 1126 _INIT_DCS_CMD(0xBE, 0xAE), 1127 _INIT_DCS_CMD(0xBF, 0x2A), 1128 _INIT_DCS_CMD(0xC0, 0x66), 1129 _INIT_DCS_CMD(0xC1, 0x9E), 1130 _INIT_DCS_CMD(0xC2, 0xB8), 1131 _INIT_DCS_CMD(0xC3, 0xD1), 1132 _INIT_DCS_CMD(0xC4, 0xDD), 1133 _INIT_DCS_CMD(0xC5, 0xE9), 1134 _INIT_DCS_CMD(0xC6, 0xF6), 1135 _INIT_DCS_CMD(0xC7, 0xFA), 1136 _INIT_DCS_CMD(0xC8, 0xFC), 1137 _INIT_DCS_CMD(0xC9, 0x00), 1138 _INIT_DCS_CMD(0xCA, 0x00), 1139 _INIT_DCS_CMD(0xCB, 0x16), 1140 _INIT_DCS_CMD(0xCC, 0xAF), 1141 _INIT_DCS_CMD(0xCD, 0xFF), 1142 _INIT_DCS_CMD(0xCE, 0xFF), 1143 _INIT_DCS_CMD(0xB0, 0x00), 1144 _INIT_DCS_CMD(0xB3, 0x08), 1145 _INIT_DCS_CMD(0xB0, 0x04), 1146 _INIT_DCS_CMD(0xB8, 0x68), 1147 _INIT_DELAY_CMD(150), 1148 {}, 1149 }; 1150 1151 static const struct panel_init_cmd auo_kd101n80_45na_init_cmd[] = { 1152 _INIT_DELAY_CMD(24), 1153 _INIT_DCS_CMD(0x11), 1154 _INIT_DELAY_CMD(120), 1155 _INIT_DCS_CMD(0x29), 1156 _INIT_DELAY_CMD(120), 1157 {}, 1158 }; 1159 1160 static const struct panel_init_cmd auo_b101uan08_3_init_cmd[] = { 1161 _INIT_DELAY_CMD(24), 1162 _INIT_DCS_CMD(0xB0, 0x01), 1163 _INIT_DCS_CMD(0xC0, 0x48), 1164 _INIT_DCS_CMD(0xC1, 0x48), 1165 _INIT_DCS_CMD(0xC2, 0x47), 1166 _INIT_DCS_CMD(0xC3, 0x47), 1167 _INIT_DCS_CMD(0xC4, 0x46), 1168 _INIT_DCS_CMD(0xC5, 0x46), 1169 _INIT_DCS_CMD(0xC6, 0x45), 1170 _INIT_DCS_CMD(0xC7, 0x45), 1171 _INIT_DCS_CMD(0xC8, 0x64), 1172 _INIT_DCS_CMD(0xC9, 0x64), 1173 _INIT_DCS_CMD(0xCA, 0x4F), 1174 _INIT_DCS_CMD(0xCB, 0x4F), 1175 _INIT_DCS_CMD(0xCC, 0x40), 1176 _INIT_DCS_CMD(0xCD, 0x40), 1177 _INIT_DCS_CMD(0xCE, 0x66), 1178 _INIT_DCS_CMD(0xCF, 0x66), 1179 _INIT_DCS_CMD(0xD0, 0x4F), 1180 _INIT_DCS_CMD(0xD1, 0x4F), 1181 _INIT_DCS_CMD(0xD2, 0x41), 1182 _INIT_DCS_CMD(0xD3, 0x41), 1183 _INIT_DCS_CMD(0xD4, 0x48), 1184 _INIT_DCS_CMD(0xD5, 0x48), 1185 _INIT_DCS_CMD(0xD6, 0x47), 1186 _INIT_DCS_CMD(0xD7, 0x47), 1187 _INIT_DCS_CMD(0xD8, 0x46), 1188 _INIT_DCS_CMD(0xD9, 0x46), 1189 _INIT_DCS_CMD(0xDA, 0x45), 1190 _INIT_DCS_CMD(0xDB, 0x45), 1191 _INIT_DCS_CMD(0xDC, 0x64), 1192 _INIT_DCS_CMD(0xDD, 0x64), 1193 _INIT_DCS_CMD(0xDE, 0x4F), 1194 _INIT_DCS_CMD(0xDF, 0x4F), 1195 _INIT_DCS_CMD(0xE0, 0x40), 1196 _INIT_DCS_CMD(0xE1, 0x40), 1197 _INIT_DCS_CMD(0xE2, 0x66), 1198 _INIT_DCS_CMD(0xE3, 0x66), 1199 _INIT_DCS_CMD(0xE4, 0x4F), 1200 _INIT_DCS_CMD(0xE5, 0x4F), 1201 _INIT_DCS_CMD(0xE6, 0x41), 1202 _INIT_DCS_CMD(0xE7, 0x41), 1203 _INIT_DELAY_CMD(150), 1204 {}, 1205 }; 1206 1207 static const struct panel_init_cmd starry_qfh032011_53g_init_cmd[] = { 1208 _INIT_DCS_CMD(0xB0, 0x01), 1209 _INIT_DCS_CMD(0xC3, 0x4F), 1210 _INIT_DCS_CMD(0xC4, 0x40), 1211 _INIT_DCS_CMD(0xC5, 0x40), 1212 _INIT_DCS_CMD(0xC6, 0x40), 1213 _INIT_DCS_CMD(0xC7, 0x40), 1214 _INIT_DCS_CMD(0xC8, 0x4D), 1215 _INIT_DCS_CMD(0xC9, 0x52), 1216 _INIT_DCS_CMD(0xCA, 0x51), 1217 _INIT_DCS_CMD(0xCD, 0x5D), 1218 _INIT_DCS_CMD(0xCE, 0x5B), 1219 _INIT_DCS_CMD(0xCF, 0x4B), 1220 _INIT_DCS_CMD(0xD0, 0x49), 1221 _INIT_DCS_CMD(0xD1, 0x47), 1222 _INIT_DCS_CMD(0xD2, 0x45), 1223 _INIT_DCS_CMD(0xD3, 0x41), 1224 _INIT_DCS_CMD(0xD7, 0x50), 1225 _INIT_DCS_CMD(0xD8, 0x40), 1226 _INIT_DCS_CMD(0xD9, 0x40), 1227 _INIT_DCS_CMD(0xDA, 0x40), 1228 _INIT_DCS_CMD(0xDB, 0x40), 1229 _INIT_DCS_CMD(0xDC, 0x4E), 1230 _INIT_DCS_CMD(0xDD, 0x52), 1231 _INIT_DCS_CMD(0xDE, 0x51), 1232 _INIT_DCS_CMD(0xE1, 0x5E), 1233 _INIT_DCS_CMD(0xE2, 0x5C), 1234 _INIT_DCS_CMD(0xE3, 0x4C), 1235 _INIT_DCS_CMD(0xE4, 0x4A), 1236 _INIT_DCS_CMD(0xE5, 0x48), 1237 _INIT_DCS_CMD(0xE6, 0x46), 1238 _INIT_DCS_CMD(0xE7, 0x42), 1239 _INIT_DCS_CMD(0xB0, 0x03), 1240 _INIT_DCS_CMD(0xBE, 0x03), 1241 _INIT_DCS_CMD(0xCC, 0x44), 1242 _INIT_DCS_CMD(0xC8, 0x07), 1243 _INIT_DCS_CMD(0xC9, 0x05), 1244 _INIT_DCS_CMD(0xCA, 0x42), 1245 _INIT_DCS_CMD(0xCD, 0x3E), 1246 _INIT_DCS_CMD(0xCF, 0x60), 1247 _INIT_DCS_CMD(0xD2, 0x04), 1248 _INIT_DCS_CMD(0xD3, 0x04), 1249 _INIT_DCS_CMD(0xD4, 0x01), 1250 _INIT_DCS_CMD(0xD5, 0x00), 1251 _INIT_DCS_CMD(0xD6, 0x03), 1252 _INIT_DCS_CMD(0xD7, 0x04), 1253 _INIT_DCS_CMD(0xD9, 0x01), 1254 _INIT_DCS_CMD(0xDB, 0x01), 1255 _INIT_DCS_CMD(0xE4, 0xF0), 1256 _INIT_DCS_CMD(0xE5, 0x0A), 1257 _INIT_DCS_CMD(0xB0, 0x00), 1258 _INIT_DCS_CMD(0xCC, 0x08), 1259 _INIT_DCS_CMD(0xC2, 0x08), 1260 _INIT_DCS_CMD(0xC4, 0x10), 1261 _INIT_DCS_CMD(0xB0, 0x02), 1262 _INIT_DCS_CMD(0xC0, 0x00), 1263 _INIT_DCS_CMD(0xC1, 0x0A), 1264 _INIT_DCS_CMD(0xC2, 0x20), 1265 _INIT_DCS_CMD(0xC3, 0x24), 1266 _INIT_DCS_CMD(0xC4, 0x23), 1267 _INIT_DCS_CMD(0xC5, 0x29), 1268 _INIT_DCS_CMD(0xC6, 0x23), 1269 _INIT_DCS_CMD(0xC7, 0x1C), 1270 _INIT_DCS_CMD(0xC8, 0x19), 1271 _INIT_DCS_CMD(0xC9, 0x17), 1272 _INIT_DCS_CMD(0xCA, 0x17), 1273 _INIT_DCS_CMD(0xCB, 0x18), 1274 _INIT_DCS_CMD(0xCC, 0x1A), 1275 _INIT_DCS_CMD(0xCD, 0x1E), 1276 _INIT_DCS_CMD(0xCE, 0x20), 1277 _INIT_DCS_CMD(0xCF, 0x23), 1278 _INIT_DCS_CMD(0xD0, 0x07), 1279 _INIT_DCS_CMD(0xD1, 0x00), 1280 _INIT_DCS_CMD(0xD2, 0x00), 1281 _INIT_DCS_CMD(0xD3, 0x0A), 1282 _INIT_DCS_CMD(0xD4, 0x13), 1283 _INIT_DCS_CMD(0xD5, 0x1C), 1284 _INIT_DCS_CMD(0xD6, 0x1A), 1285 _INIT_DCS_CMD(0xD7, 0x13), 1286 _INIT_DCS_CMD(0xD8, 0x17), 1287 _INIT_DCS_CMD(0xD9, 0x1C), 1288 _INIT_DCS_CMD(0xDA, 0x19), 1289 _INIT_DCS_CMD(0xDB, 0x17), 1290 _INIT_DCS_CMD(0xDC, 0x17), 1291 _INIT_DCS_CMD(0xDD, 0x18), 1292 _INIT_DCS_CMD(0xDE, 0x1A), 1293 _INIT_DCS_CMD(0xDF, 0x1E), 1294 _INIT_DCS_CMD(0xE0, 0x20), 1295 _INIT_DCS_CMD(0xE1, 0x23), 1296 _INIT_DCS_CMD(0xE2, 0x07), 1297 _INIT_DCS_CMD(0X11), 1298 _INIT_DELAY_CMD(120), 1299 _INIT_DCS_CMD(0X29), 1300 _INIT_DELAY_CMD(80), 1301 {}, 1302 }; 1303 1304 static const struct panel_init_cmd starry_himax83102_j02_init_cmd[] = { 1305 _INIT_DCS_CMD(0xB9, 0x83, 0x10, 0x21, 0x55, 0x00), 1306 _INIT_DCS_CMD(0xB1, 0x2C, 0xB5, 0xB5, 0x31, 0xF1, 0x31, 0xD7, 0x2F, 0x36, 0x36, 0x36, 0x36, 0x1A, 0x8B, 0x11, 1307 0x65, 0x00, 0x88, 0xFA, 0xFF, 0xFF, 0x8F, 0xFF, 0x08, 0x74, 0x33), 1308 _INIT_DCS_CMD(0xB2, 0x00, 0x47, 0xB0, 0x80, 0x00, 0x12, 0x72, 0x3C, 0xA3, 0x03, 0x03, 0x00, 0x00, 0x88, 0xF5), 1309 _INIT_DCS_CMD(0xB4, 0x76, 0x76, 0x76, 0x76, 0x76, 0x76, 0x63, 0x5C, 0x63, 0x5C, 0x01, 0x9E), 1310 _INIT_DCS_CMD(0xE9, 0xCD), 1311 _INIT_DCS_CMD(0xBA, 0x84), 1312 _INIT_DCS_CMD(0xE9, 0x3F), 1313 _INIT_DCS_CMD(0xBC, 0x1B, 0x04), 1314 _INIT_DCS_CMD(0xBE, 0x20), 1315 _INIT_DCS_CMD(0xBF, 0xFC, 0xC4), 1316 _INIT_DCS_CMD(0xC0, 0x36, 0x36, 0x22, 0x11, 0x22, 0xA0, 0x61, 0x08, 0xF5, 0x03), 1317 _INIT_DCS_CMD(0xE9, 0xCC), 1318 _INIT_DCS_CMD(0xC7, 0x80), 1319 _INIT_DCS_CMD(0xE9, 0x3F), 1320 _INIT_DCS_CMD(0xE9, 0xC6), 1321 _INIT_DCS_CMD(0xC8, 0x97), 1322 _INIT_DCS_CMD(0xE9, 0x3F), 1323 _INIT_DCS_CMD(0xC9, 0x00, 0x1E, 0x13, 0x88, 0x01), 1324 _INIT_DCS_CMD(0xCB, 0x08, 0x13, 0x07, 0x00, 0x0F, 0x33), 1325 _INIT_DCS_CMD(0xCC, 0x02), 1326 _INIT_DCS_CMD(0xE9, 0xC4), 1327 _INIT_DCS_CMD(0xD0, 0x03), 1328 _INIT_DCS_CMD(0xE9, 0x3F), 1329 _INIT_DCS_CMD(0xD1, 0x37, 0x06, 0x00, 0x02, 0x04, 0x0C, 0xFF), 1330 _INIT_DCS_CMD(0xD2, 0x1F, 0x11, 0x1F), 1331 _INIT_DCS_CMD(0xD3, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x37, 0x47, 0x34, 0x3B, 0x12, 0x12, 0x03, 1332 0x03, 0x32, 0x10, 0x10, 0x00, 0x10, 0x32, 0x10, 0x08, 0x00, 0x08, 0x32, 0x17, 0x94, 0x07, 0x94, 0x00, 0x00), 1333 _INIT_DCS_CMD(0xD5, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x40, 0x40, 0x1A, 0x1A, 1334 0x1B, 0x1B, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x20, 0x21, 0x28, 0x29, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18), 1335 _INIT_DCS_CMD(0xD6, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x40, 0x40, 0x19, 0x19, 0x1A, 0x1A, 1336 0x1B, 0x1B, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x29, 0x28, 0x21, 0x20, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18), 1337 _INIT_DCS_CMD(0xD8, 0xAA, 0xBA, 0xEA, 0xAA, 0xAA, 0xA0, 0xAA, 0xBA, 0xEA, 0xAA, 0xAA, 0xA0, 0xAA, 0xBA, 0xEA, 0xAA, 1338 0xAA, 0xA0, 0xAA, 0xBA, 0xEA, 0xAA, 0xAA, 0xA0, 0xAA, 0xBA, 0xEA, 0xAA, 0xAA, 0xA0, 0xAA, 0xBA, 0xEA, 0xAA, 0xAA, 0xA0), 1339 _INIT_DCS_CMD(0xE0, 0x00, 0x09, 0x14, 0x1E, 0x26, 0x48, 0x61, 0x67, 0x6C, 0x67, 0x7D, 0x7F, 0x80, 0x8B, 0x87, 0x8F, 0x98, 0xAB, 1340 0xAB, 0x55, 0x5C, 0x68, 0x73, 0x00, 0x09, 0x14, 0x1E, 0x26, 0x48, 0x61, 0x67, 0x6C, 0x67, 0x7D, 0x7F, 0x80, 0x8B, 0x87, 0x8F, 0x98, 0xAB, 0xAB, 0x55, 0x5C, 0x68, 0x73), 1341 _INIT_DCS_CMD(0xE7, 0x0E, 0x10, 0x10, 0x21, 0x2B, 0x9A, 0x02, 0x54, 0x9A, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x12, 0x05, 0x02, 0x02, 0x10), 1342 _INIT_DCS_CMD(0xBD, 0x01), 1343 _INIT_DCS_CMD(0xB1, 0x01, 0xBF, 0x11), 1344 _INIT_DCS_CMD(0xCB, 0x86), 1345 _INIT_DCS_CMD(0xD2, 0x3C, 0xFA), 1346 _INIT_DCS_CMD(0xE9, 0xC5), 1347 _INIT_DCS_CMD(0xD3, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0C, 0x01), 1348 _INIT_DCS_CMD(0xE9, 0x3F), 1349 _INIT_DCS_CMD(0xE7, 0x02, 0x00, 0x28, 0x01, 0x7E, 0x0F, 0x7E, 0x10, 0xA0, 0x00, 0x00, 0x20, 0x40, 0x50, 0x40), 1350 _INIT_DCS_CMD(0xBD, 0x02), 1351 _INIT_DCS_CMD(0xD8, 0xFF, 0xFF, 0xBF, 0xFE, 0xAA, 0xA0, 0xFF, 0xFF, 0xBF, 0xFE, 0xAA, 0xA0), 1352 _INIT_DCS_CMD(0xE7, 0xFE, 0x04, 0xFE, 0x04, 0xFE, 0x04, 0x03, 0x03, 0x03, 0x26, 0x00, 0x26, 0x81, 0x02, 0x40, 0x00, 0x20, 0x9E, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00), 1353 _INIT_DCS_CMD(0xBD, 0x03), 1354 _INIT_DCS_CMD(0xE9, 0xC6), 1355 _INIT_DCS_CMD(0xB4, 0x03, 0xFF, 0xF8), 1356 _INIT_DCS_CMD(0xE9, 0x3F), 1357 _INIT_DCS_CMD(0xD8, 0x00, 0x2A, 0xAA, 0xA8, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA8, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA8, 1358 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA8, 0x00, 0x00), 1359 _INIT_DCS_CMD(0xBD, 0x00), 1360 _INIT_DCS_CMD(0xE9, 0xC4), 1361 _INIT_DCS_CMD(0xBA, 0x96), 1362 _INIT_DCS_CMD(0xE9, 0x3F), 1363 _INIT_DCS_CMD(0xBD, 0x01), 1364 _INIT_DCS_CMD(0xE9, 0xC5), 1365 _INIT_DCS_CMD(0xBA, 0x4F), 1366 _INIT_DCS_CMD(0xE9, 0x3F), 1367 _INIT_DCS_CMD(0xBD, 0x00), 1368 _INIT_DCS_CMD(0x11), 1369 _INIT_DELAY_CMD(120), 1370 _INIT_DCS_CMD(0x29), 1371 {}, 1372 }; 1373 1374 static const struct panel_init_cmd starry_ili9882t_init_cmd[] = { 1375 _INIT_DELAY_CMD(5), 1376 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x01), 1377 _INIT_DCS_CMD(0x00, 0x42), 1378 _INIT_DCS_CMD(0x01, 0x11), 1379 _INIT_DCS_CMD(0x02, 0x00), 1380 _INIT_DCS_CMD(0x03, 0x00), 1381 1382 _INIT_DCS_CMD(0x04, 0x01), 1383 _INIT_DCS_CMD(0x05, 0x11), 1384 _INIT_DCS_CMD(0x06, 0x00), 1385 _INIT_DCS_CMD(0x07, 0x00), 1386 1387 _INIT_DCS_CMD(0x08, 0x80), 1388 _INIT_DCS_CMD(0x09, 0x81), 1389 _INIT_DCS_CMD(0x0A, 0x71), 1390 _INIT_DCS_CMD(0x0B, 0x00), 1391 1392 _INIT_DCS_CMD(0x0C, 0x00), 1393 _INIT_DCS_CMD(0x0E, 0x1A), 1394 1395 _INIT_DCS_CMD(0x24, 0x00), 1396 _INIT_DCS_CMD(0x25, 0x00), 1397 _INIT_DCS_CMD(0x26, 0x00), 1398 _INIT_DCS_CMD(0x27, 0x00), 1399 1400 _INIT_DCS_CMD(0x2C, 0xD4), 1401 _INIT_DCS_CMD(0xB9, 0x40), 1402 1403 _INIT_DCS_CMD(0xB0, 0x11), 1404 1405 _INIT_DCS_CMD(0xE6, 0x32), 1406 _INIT_DCS_CMD(0xD1, 0x30), 1407 1408 _INIT_DCS_CMD(0xD6, 0x55), 1409 1410 _INIT_DCS_CMD(0xD0, 0x01), 1411 _INIT_DCS_CMD(0xE3, 0x93), 1412 _INIT_DCS_CMD(0xE4, 0x00), 1413 _INIT_DCS_CMD(0xE5, 0x80), 1414 1415 _INIT_DCS_CMD(0x31, 0x07), 1416 _INIT_DCS_CMD(0x32, 0x07), 1417 _INIT_DCS_CMD(0x33, 0x07), 1418 _INIT_DCS_CMD(0x34, 0x07), 1419 _INIT_DCS_CMD(0x35, 0x07), 1420 _INIT_DCS_CMD(0x36, 0x01), 1421 _INIT_DCS_CMD(0x37, 0x00), 1422 _INIT_DCS_CMD(0x38, 0x28), 1423 _INIT_DCS_CMD(0x39, 0x29), 1424 _INIT_DCS_CMD(0x3A, 0x11), 1425 _INIT_DCS_CMD(0x3B, 0x13), 1426 _INIT_DCS_CMD(0x3C, 0x15), 1427 _INIT_DCS_CMD(0x3D, 0x17), 1428 _INIT_DCS_CMD(0x3E, 0x09), 1429 _INIT_DCS_CMD(0x3F, 0x0D), 1430 _INIT_DCS_CMD(0x40, 0x02), 1431 _INIT_DCS_CMD(0x41, 0x02), 1432 _INIT_DCS_CMD(0x42, 0x02), 1433 _INIT_DCS_CMD(0x43, 0x02), 1434 _INIT_DCS_CMD(0x44, 0x02), 1435 _INIT_DCS_CMD(0x45, 0x02), 1436 _INIT_DCS_CMD(0x46, 0x02), 1437 1438 _INIT_DCS_CMD(0x47, 0x07), 1439 _INIT_DCS_CMD(0x48, 0x07), 1440 _INIT_DCS_CMD(0x49, 0x07), 1441 _INIT_DCS_CMD(0x4A, 0x07), 1442 _INIT_DCS_CMD(0x4B, 0x07), 1443 _INIT_DCS_CMD(0x4C, 0x01), 1444 _INIT_DCS_CMD(0x4D, 0x00), 1445 _INIT_DCS_CMD(0x4E, 0x28), 1446 _INIT_DCS_CMD(0x4F, 0x29), 1447 _INIT_DCS_CMD(0x50, 0x10), 1448 _INIT_DCS_CMD(0x51, 0x12), 1449 _INIT_DCS_CMD(0x52, 0x14), 1450 _INIT_DCS_CMD(0x53, 0x16), 1451 _INIT_DCS_CMD(0x54, 0x08), 1452 _INIT_DCS_CMD(0x55, 0x0C), 1453 _INIT_DCS_CMD(0x56, 0x02), 1454 _INIT_DCS_CMD(0x57, 0x02), 1455 _INIT_DCS_CMD(0x58, 0x02), 1456 _INIT_DCS_CMD(0x59, 0x02), 1457 _INIT_DCS_CMD(0x5A, 0x02), 1458 _INIT_DCS_CMD(0x5B, 0x02), 1459 _INIT_DCS_CMD(0x5C, 0x02), 1460 1461 _INIT_DCS_CMD(0x61, 0x07), 1462 _INIT_DCS_CMD(0x62, 0x07), 1463 _INIT_DCS_CMD(0x63, 0x07), 1464 _INIT_DCS_CMD(0x64, 0x07), 1465 _INIT_DCS_CMD(0x65, 0x07), 1466 _INIT_DCS_CMD(0x66, 0x01), 1467 _INIT_DCS_CMD(0x67, 0x00), 1468 _INIT_DCS_CMD(0x68, 0x28), 1469 _INIT_DCS_CMD(0x69, 0x29), 1470 _INIT_DCS_CMD(0x6A, 0x16), 1471 _INIT_DCS_CMD(0x6B, 0x14), 1472 _INIT_DCS_CMD(0x6C, 0x12), 1473 _INIT_DCS_CMD(0x6D, 0x10), 1474 _INIT_DCS_CMD(0x6E, 0x0C), 1475 _INIT_DCS_CMD(0x6F, 0x08), 1476 _INIT_DCS_CMD(0x70, 0x02), 1477 _INIT_DCS_CMD(0x71, 0x02), 1478 _INIT_DCS_CMD(0x72, 0x02), 1479 _INIT_DCS_CMD(0x73, 0x02), 1480 _INIT_DCS_CMD(0x74, 0x02), 1481 _INIT_DCS_CMD(0x75, 0x02), 1482 _INIT_DCS_CMD(0x76, 0x02), 1483 1484 _INIT_DCS_CMD(0x77, 0x07), 1485 _INIT_DCS_CMD(0x78, 0x07), 1486 _INIT_DCS_CMD(0x79, 0x07), 1487 _INIT_DCS_CMD(0x7A, 0x07), 1488 _INIT_DCS_CMD(0x7B, 0x07), 1489 _INIT_DCS_CMD(0x7C, 0x01), 1490 _INIT_DCS_CMD(0x7D, 0x00), 1491 _INIT_DCS_CMD(0x7E, 0x28), 1492 _INIT_DCS_CMD(0x7F, 0x29), 1493 _INIT_DCS_CMD(0x80, 0x17), 1494 _INIT_DCS_CMD(0x81, 0x15), 1495 _INIT_DCS_CMD(0x82, 0x13), 1496 _INIT_DCS_CMD(0x83, 0x11), 1497 _INIT_DCS_CMD(0x84, 0x0D), 1498 _INIT_DCS_CMD(0x85, 0x09), 1499 _INIT_DCS_CMD(0x86, 0x02), 1500 _INIT_DCS_CMD(0x87, 0x07), 1501 _INIT_DCS_CMD(0x88, 0x07), 1502 _INIT_DCS_CMD(0x89, 0x07), 1503 _INIT_DCS_CMD(0x8A, 0x07), 1504 _INIT_DCS_CMD(0x8B, 0x07), 1505 _INIT_DCS_CMD(0x8C, 0x07), 1506 1507 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x02), 1508 _INIT_DCS_CMD(0x29, 0x3A), 1509 _INIT_DCS_CMD(0x2A, 0x3B), 1510 1511 _INIT_DCS_CMD(0x06, 0x01), 1512 _INIT_DCS_CMD(0x07, 0x01), 1513 _INIT_DCS_CMD(0x08, 0x0C), 1514 _INIT_DCS_CMD(0x09, 0x44), 1515 1516 _INIT_DCS_CMD(0x3C, 0x0A), 1517 _INIT_DCS_CMD(0x39, 0x11), 1518 _INIT_DCS_CMD(0x3D, 0x00), 1519 _INIT_DCS_CMD(0x3A, 0x0C), 1520 _INIT_DCS_CMD(0x3B, 0x44), 1521 1522 _INIT_DCS_CMD(0x53, 0x1F), 1523 _INIT_DCS_CMD(0x5E, 0x40), 1524 _INIT_DCS_CMD(0x84, 0x00), 1525 1526 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x03), 1527 _INIT_DCS_CMD(0x20, 0x01), 1528 _INIT_DCS_CMD(0x21, 0x3C), 1529 _INIT_DCS_CMD(0x22, 0xFA), 1530 1531 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x0A), 1532 _INIT_DCS_CMD(0xE0, 0x01), 1533 _INIT_DCS_CMD(0xE2, 0x01), 1534 _INIT_DCS_CMD(0xE5, 0x91), 1535 _INIT_DCS_CMD(0xE6, 0x3C), 1536 _INIT_DCS_CMD(0xE7, 0x00), 1537 _INIT_DCS_CMD(0xE8, 0xFA), 1538 1539 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x12), 1540 _INIT_DCS_CMD(0x87, 0x2C), 1541 1542 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x05), 1543 _INIT_DCS_CMD(0x73, 0xE5), 1544 _INIT_DCS_CMD(0x7F, 0x6B), 1545 _INIT_DCS_CMD(0x6D, 0xA4), 1546 _INIT_DCS_CMD(0x79, 0x54), 1547 _INIT_DCS_CMD(0x69, 0x97), 1548 _INIT_DCS_CMD(0x6A, 0x97), 1549 _INIT_DCS_CMD(0xA5, 0x3F), 1550 _INIT_DCS_CMD(0x61, 0xDA), 1551 _INIT_DCS_CMD(0xA7, 0xF1), 1552 _INIT_DCS_CMD(0x5F, 0x01), 1553 _INIT_DCS_CMD(0x62, 0x3F), 1554 _INIT_DCS_CMD(0x1D, 0x90), 1555 _INIT_DCS_CMD(0x86, 0x87), 1556 1557 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x06), 1558 _INIT_DCS_CMD(0xC0, 0x80), 1559 _INIT_DCS_CMD(0xC1, 0x07), 1560 _INIT_DCS_CMD(0xCA, 0x58), 1561 _INIT_DCS_CMD(0xCB, 0x02), 1562 _INIT_DCS_CMD(0xCE, 0x58), 1563 _INIT_DCS_CMD(0xCF, 0x02), 1564 _INIT_DCS_CMD(0x67, 0x60), 1565 _INIT_DCS_CMD(0x10, 0x00), 1566 _INIT_DCS_CMD(0x92, 0x22), 1567 _INIT_DCS_CMD(0xD3, 0x08), 1568 _INIT_DCS_CMD(0xD6, 0x55), 1569 _INIT_DCS_CMD(0xDC, 0x38), 1570 1571 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x08), 1572 _INIT_DCS_CMD(0xE0, 0x00, 0x10, 0x2A, 0x4D, 0x61, 0x56, 0x6A, 0x6E, 0x79, 0x76, 0x8F, 0x95, 0x98, 0xAE, 0xAA, 0xB2, 0xBB, 0xCE, 0xC6, 0xBD, 0xD5, 0xE2, 0xE8), 1573 _INIT_DCS_CMD(0xE1, 0x00, 0x10, 0x2A, 0x4D, 0x61, 0x56, 0x6A, 0x6E, 0x79, 0x76, 0x8F, 0x95, 0x98, 0xAE, 0xAA, 0xB2, 0xBB, 0xCE, 0xC6, 0xBD, 0xD5, 0xE2, 0xE8), 1574 1575 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x04), 1576 _INIT_DCS_CMD(0xBA, 0x81), 1577 1578 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x0C), 1579 _INIT_DCS_CMD(0x00, 0x02), 1580 _INIT_DCS_CMD(0x01, 0x00), 1581 _INIT_DCS_CMD(0x02, 0x03), 1582 _INIT_DCS_CMD(0x03, 0x01), 1583 _INIT_DCS_CMD(0x04, 0x03), 1584 _INIT_DCS_CMD(0x05, 0x02), 1585 _INIT_DCS_CMD(0x06, 0x04), 1586 _INIT_DCS_CMD(0x07, 0x03), 1587 _INIT_DCS_CMD(0x08, 0x03), 1588 _INIT_DCS_CMD(0x09, 0x04), 1589 _INIT_DCS_CMD(0x0A, 0x04), 1590 _INIT_DCS_CMD(0x0B, 0x05), 1591 _INIT_DCS_CMD(0x0C, 0x04), 1592 _INIT_DCS_CMD(0x0D, 0x06), 1593 _INIT_DCS_CMD(0x0E, 0x05), 1594 _INIT_DCS_CMD(0x0F, 0x07), 1595 _INIT_DCS_CMD(0x10, 0x04), 1596 _INIT_DCS_CMD(0x11, 0x08), 1597 _INIT_DCS_CMD(0x12, 0x05), 1598 _INIT_DCS_CMD(0x13, 0x09), 1599 _INIT_DCS_CMD(0x14, 0x05), 1600 _INIT_DCS_CMD(0x15, 0x0A), 1601 _INIT_DCS_CMD(0x16, 0x06), 1602 _INIT_DCS_CMD(0x17, 0x0B), 1603 _INIT_DCS_CMD(0x18, 0x05), 1604 _INIT_DCS_CMD(0x19, 0x0C), 1605 _INIT_DCS_CMD(0x1A, 0x06), 1606 _INIT_DCS_CMD(0x1B, 0x0D), 1607 _INIT_DCS_CMD(0x1C, 0x06), 1608 _INIT_DCS_CMD(0x1D, 0x0E), 1609 _INIT_DCS_CMD(0x1E, 0x07), 1610 _INIT_DCS_CMD(0x1F, 0x0F), 1611 _INIT_DCS_CMD(0x20, 0x06), 1612 _INIT_DCS_CMD(0x21, 0x10), 1613 _INIT_DCS_CMD(0x22, 0x07), 1614 _INIT_DCS_CMD(0x23, 0x11), 1615 _INIT_DCS_CMD(0x24, 0x07), 1616 _INIT_DCS_CMD(0x25, 0x12), 1617 _INIT_DCS_CMD(0x26, 0x08), 1618 _INIT_DCS_CMD(0x27, 0x13), 1619 _INIT_DCS_CMD(0x28, 0x07), 1620 _INIT_DCS_CMD(0x29, 0x14), 1621 _INIT_DCS_CMD(0x2A, 0x08), 1622 _INIT_DCS_CMD(0x2B, 0x15), 1623 _INIT_DCS_CMD(0x2C, 0x08), 1624 _INIT_DCS_CMD(0x2D, 0x16), 1625 _INIT_DCS_CMD(0x2E, 0x09), 1626 _INIT_DCS_CMD(0x2F, 0x17), 1627 _INIT_DCS_CMD(0x30, 0x08), 1628 _INIT_DCS_CMD(0x31, 0x18), 1629 _INIT_DCS_CMD(0x32, 0x09), 1630 _INIT_DCS_CMD(0x33, 0x19), 1631 _INIT_DCS_CMD(0x34, 0x09), 1632 _INIT_DCS_CMD(0x35, 0x1A), 1633 _INIT_DCS_CMD(0x36, 0x0A), 1634 _INIT_DCS_CMD(0x37, 0x1B), 1635 _INIT_DCS_CMD(0x38, 0x0A), 1636 _INIT_DCS_CMD(0x39, 0x1C), 1637 _INIT_DCS_CMD(0x3A, 0x0A), 1638 _INIT_DCS_CMD(0x3B, 0x1D), 1639 _INIT_DCS_CMD(0x3C, 0x0A), 1640 _INIT_DCS_CMD(0x3D, 0x1E), 1641 _INIT_DCS_CMD(0x3E, 0x0A), 1642 _INIT_DCS_CMD(0x3F, 0x1F), 1643 1644 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x04), 1645 _INIT_DCS_CMD(0xBA, 0x01), 1646 1647 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x0E), 1648 _INIT_DCS_CMD(0x02, 0x0C), 1649 _INIT_DCS_CMD(0x20, 0x10), 1650 _INIT_DCS_CMD(0x25, 0x16), 1651 _INIT_DCS_CMD(0x26, 0xE0), 1652 _INIT_DCS_CMD(0x27, 0x00), 1653 _INIT_DCS_CMD(0x29, 0x71), 1654 _INIT_DCS_CMD(0x2A, 0x46), 1655 _INIT_DCS_CMD(0x2B, 0x1F), 1656 _INIT_DCS_CMD(0x2D, 0xC7), 1657 _INIT_DCS_CMD(0x31, 0x02), 1658 _INIT_DCS_CMD(0x32, 0xDF), 1659 _INIT_DCS_CMD(0x33, 0x5A), 1660 _INIT_DCS_CMD(0x34, 0xC0), 1661 _INIT_DCS_CMD(0x35, 0x5A), 1662 _INIT_DCS_CMD(0x36, 0xC0), 1663 _INIT_DCS_CMD(0x38, 0x65), 1664 _INIT_DCS_CMD(0x80, 0x3E), 1665 _INIT_DCS_CMD(0x81, 0xA0), 1666 _INIT_DCS_CMD(0xB0, 0x01), 1667 _INIT_DCS_CMD(0xB1, 0xCC), 1668 _INIT_DCS_CMD(0xC0, 0x12), 1669 _INIT_DCS_CMD(0xC2, 0xCC), 1670 _INIT_DCS_CMD(0xC3, 0xCC), 1671 _INIT_DCS_CMD(0xC4, 0xCC), 1672 _INIT_DCS_CMD(0xC5, 0xCC), 1673 _INIT_DCS_CMD(0xC6, 0xCC), 1674 _INIT_DCS_CMD(0xC7, 0xCC), 1675 _INIT_DCS_CMD(0xC8, 0xCC), 1676 _INIT_DCS_CMD(0xC9, 0xCC), 1677 _INIT_DCS_CMD(0x30, 0x00), 1678 _INIT_DCS_CMD(0x00, 0x81), 1679 _INIT_DCS_CMD(0x08, 0x02), 1680 _INIT_DCS_CMD(0x09, 0x00), 1681 _INIT_DCS_CMD(0x07, 0x21), 1682 _INIT_DCS_CMD(0x04, 0x10), 1683 1684 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x1E), 1685 _INIT_DCS_CMD(0x60, 0x00), 1686 _INIT_DCS_CMD(0x64, 0x00), 1687 _INIT_DCS_CMD(0x6D, 0x00), 1688 1689 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x0B), 1690 _INIT_DCS_CMD(0xA6, 0x44), 1691 _INIT_DCS_CMD(0xA7, 0xB6), 1692 _INIT_DCS_CMD(0xA8, 0x03), 1693 _INIT_DCS_CMD(0xA9, 0x03), 1694 _INIT_DCS_CMD(0xAA, 0x51), 1695 _INIT_DCS_CMD(0xAB, 0x51), 1696 _INIT_DCS_CMD(0xAC, 0x04), 1697 _INIT_DCS_CMD(0xBD, 0x92), 1698 _INIT_DCS_CMD(0xBE, 0xA1), 1699 1700 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x05), 1701 _INIT_DCS_CMD(0x86, 0x87), 1702 1703 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x06), 1704 _INIT_DCS_CMD(0x92, 0x22), 1705 1706 _INIT_DCS_CMD(0xFF, 0x98, 0x82, 0x00), 1707 _INIT_DCS_CMD(0x11), 1708 _INIT_DELAY_CMD(120), 1709 _INIT_DCS_CMD(0x29), 1710 _INIT_DELAY_CMD(20), 1711 {}, 1712 }; 1713 1714 static inline struct boe_panel *to_boe_panel(struct drm_panel *panel) 1715 { 1716 return container_of(panel, struct boe_panel, base); 1717 } 1718 1719 static int boe_panel_init_dcs_cmd(struct boe_panel *boe) 1720 { 1721 struct mipi_dsi_device *dsi = boe->dsi; 1722 struct drm_panel *panel = &boe->base; 1723 int i, err = 0; 1724 1725 if (boe->desc->init_cmds) { 1726 const struct panel_init_cmd *init_cmds = boe->desc->init_cmds; 1727 1728 for (i = 0; init_cmds[i].len != 0; i++) { 1729 const struct panel_init_cmd *cmd = &init_cmds[i]; 1730 1731 switch (cmd->type) { 1732 case DELAY_CMD: 1733 msleep(cmd->data[0]); 1734 err = 0; 1735 break; 1736 1737 case INIT_DCS_CMD: 1738 err = mipi_dsi_dcs_write(dsi, cmd->data[0], 1739 cmd->len <= 1 ? NULL : 1740 &cmd->data[1], 1741 cmd->len - 1); 1742 break; 1743 1744 default: 1745 err = -EINVAL; 1746 } 1747 1748 if (err < 0) { 1749 dev_err(panel->dev, 1750 "failed to write command %u\n", i); 1751 return err; 1752 } 1753 } 1754 } 1755 return 0; 1756 } 1757 1758 static int boe_panel_enter_sleep_mode(struct boe_panel *boe) 1759 { 1760 struct mipi_dsi_device *dsi = boe->dsi; 1761 int ret; 1762 1763 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; 1764 1765 ret = mipi_dsi_dcs_set_display_off(dsi); 1766 if (ret < 0) 1767 return ret; 1768 1769 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 1770 if (ret < 0) 1771 return ret; 1772 1773 return 0; 1774 } 1775 1776 static int boe_panel_disable(struct drm_panel *panel) 1777 { 1778 struct boe_panel *boe = to_boe_panel(panel); 1779 int ret; 1780 1781 ret = boe_panel_enter_sleep_mode(boe); 1782 if (ret < 0) { 1783 dev_err(panel->dev, "failed to set panel off: %d\n", ret); 1784 return ret; 1785 } 1786 1787 msleep(150); 1788 1789 return 0; 1790 } 1791 1792 static int boe_panel_unprepare(struct drm_panel *panel) 1793 { 1794 struct boe_panel *boe = to_boe_panel(panel); 1795 1796 if (!boe->prepared) 1797 return 0; 1798 1799 if (boe->desc->discharge_on_disable) { 1800 regulator_disable(boe->avee); 1801 regulator_disable(boe->avdd); 1802 usleep_range(5000, 7000); 1803 gpiod_set_value(boe->enable_gpio, 0); 1804 usleep_range(5000, 7000); 1805 regulator_disable(boe->pp1800); 1806 regulator_disable(boe->pp3300); 1807 } else { 1808 gpiod_set_value(boe->enable_gpio, 0); 1809 usleep_range(1000, 2000); 1810 regulator_disable(boe->avee); 1811 regulator_disable(boe->avdd); 1812 usleep_range(5000, 7000); 1813 regulator_disable(boe->pp1800); 1814 regulator_disable(boe->pp3300); 1815 } 1816 1817 boe->prepared = false; 1818 1819 return 0; 1820 } 1821 1822 static int boe_panel_prepare(struct drm_panel *panel) 1823 { 1824 struct boe_panel *boe = to_boe_panel(panel); 1825 int ret; 1826 1827 if (boe->prepared) 1828 return 0; 1829 1830 gpiod_set_value(boe->enable_gpio, 0); 1831 usleep_range(1000, 1500); 1832 1833 ret = regulator_enable(boe->pp3300); 1834 if (ret < 0) 1835 return ret; 1836 1837 ret = regulator_enable(boe->pp1800); 1838 if (ret < 0) 1839 return ret; 1840 1841 usleep_range(3000, 5000); 1842 1843 ret = regulator_enable(boe->avdd); 1844 if (ret < 0) 1845 goto poweroff1v8; 1846 ret = regulator_enable(boe->avee); 1847 if (ret < 0) 1848 goto poweroffavdd; 1849 1850 usleep_range(10000, 11000); 1851 1852 if (boe->desc->lp11_before_reset) { 1853 mipi_dsi_dcs_nop(boe->dsi); 1854 usleep_range(1000, 2000); 1855 } 1856 gpiod_set_value(boe->enable_gpio, 1); 1857 usleep_range(1000, 2000); 1858 gpiod_set_value(boe->enable_gpio, 0); 1859 usleep_range(1000, 2000); 1860 gpiod_set_value(boe->enable_gpio, 1); 1861 usleep_range(6000, 10000); 1862 1863 ret = boe_panel_init_dcs_cmd(boe); 1864 if (ret < 0) { 1865 dev_err(panel->dev, "failed to init panel: %d\n", ret); 1866 goto poweroff; 1867 } 1868 1869 boe->prepared = true; 1870 1871 return 0; 1872 1873 poweroff: 1874 regulator_disable(boe->avee); 1875 poweroffavdd: 1876 regulator_disable(boe->avdd); 1877 poweroff1v8: 1878 usleep_range(5000, 7000); 1879 regulator_disable(boe->pp1800); 1880 gpiod_set_value(boe->enable_gpio, 0); 1881 1882 return ret; 1883 } 1884 1885 static int boe_panel_enable(struct drm_panel *panel) 1886 { 1887 msleep(130); 1888 return 0; 1889 } 1890 1891 static const struct drm_display_mode boe_tv110c9m_default_mode = { 1892 .clock = 166594, 1893 .hdisplay = 1200, 1894 .hsync_start = 1200 + 40, 1895 .hsync_end = 1200 + 40 + 8, 1896 .htotal = 1200 + 40 + 8 + 28, 1897 .vdisplay = 2000, 1898 .vsync_start = 2000 + 26, 1899 .vsync_end = 2000 + 26 + 2, 1900 .vtotal = 2000 + 26 + 2 + 148, 1901 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1902 }; 1903 1904 static const struct panel_desc boe_tv110c9m_desc = { 1905 .modes = &boe_tv110c9m_default_mode, 1906 .bpc = 8, 1907 .size = { 1908 .width_mm = 143, 1909 .height_mm = 238, 1910 }, 1911 .lanes = 4, 1912 .format = MIPI_DSI_FMT_RGB888, 1913 .mode_flags = MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_VIDEO 1914 | MIPI_DSI_MODE_VIDEO_HSE 1915 | MIPI_DSI_CLOCK_NON_CONTINUOUS 1916 | MIPI_DSI_MODE_VIDEO_BURST, 1917 .init_cmds = boe_tv110c9m_init_cmd, 1918 }; 1919 1920 static const struct drm_display_mode inx_hj110iz_default_mode = { 1921 .clock = 168432, 1922 .hdisplay = 1200, 1923 .hsync_start = 1200 + 40, 1924 .hsync_end = 1200 + 40 + 8, 1925 .htotal = 1200 + 40 + 8 + 28, 1926 .vdisplay = 2000, 1927 .vsync_start = 2000 + 26, 1928 .vsync_end = 2000 + 26 + 2, 1929 .vtotal = 2000 + 26 + 2 + 172, 1930 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1931 }; 1932 1933 static const struct panel_desc inx_hj110iz_desc = { 1934 .modes = &inx_hj110iz_default_mode, 1935 .bpc = 8, 1936 .size = { 1937 .width_mm = 143, 1938 .height_mm = 238, 1939 }, 1940 .lanes = 4, 1941 .format = MIPI_DSI_FMT_RGB888, 1942 .mode_flags = MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_VIDEO 1943 | MIPI_DSI_MODE_VIDEO_HSE 1944 | MIPI_DSI_CLOCK_NON_CONTINUOUS 1945 | MIPI_DSI_MODE_VIDEO_BURST, 1946 .init_cmds = inx_hj110iz_init_cmd, 1947 }; 1948 1949 static const struct drm_display_mode boe_tv101wum_nl6_default_mode = { 1950 .clock = 159425, 1951 .hdisplay = 1200, 1952 .hsync_start = 1200 + 100, 1953 .hsync_end = 1200 + 100 + 40, 1954 .htotal = 1200 + 100 + 40 + 24, 1955 .vdisplay = 1920, 1956 .vsync_start = 1920 + 10, 1957 .vsync_end = 1920 + 10 + 14, 1958 .vtotal = 1920 + 10 + 14 + 4, 1959 }; 1960 1961 static const struct panel_desc boe_tv101wum_nl6_desc = { 1962 .modes = &boe_tv101wum_nl6_default_mode, 1963 .bpc = 8, 1964 .size = { 1965 .width_mm = 135, 1966 .height_mm = 216, 1967 }, 1968 .lanes = 4, 1969 .format = MIPI_DSI_FMT_RGB888, 1970 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1971 MIPI_DSI_MODE_LPM, 1972 .init_cmds = boe_init_cmd, 1973 .discharge_on_disable = false, 1974 }; 1975 1976 static const struct drm_display_mode auo_kd101n80_45na_default_mode = { 1977 .clock = 157000, 1978 .hdisplay = 1200, 1979 .hsync_start = 1200 + 60, 1980 .hsync_end = 1200 + 60 + 24, 1981 .htotal = 1200 + 60 + 24 + 56, 1982 .vdisplay = 1920, 1983 .vsync_start = 1920 + 16, 1984 .vsync_end = 1920 + 16 + 4, 1985 .vtotal = 1920 + 16 + 4 + 16, 1986 }; 1987 1988 static const struct panel_desc auo_kd101n80_45na_desc = { 1989 .modes = &auo_kd101n80_45na_default_mode, 1990 .bpc = 8, 1991 .size = { 1992 .width_mm = 135, 1993 .height_mm = 216, 1994 }, 1995 .lanes = 4, 1996 .format = MIPI_DSI_FMT_RGB888, 1997 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1998 MIPI_DSI_MODE_LPM, 1999 .init_cmds = auo_kd101n80_45na_init_cmd, 2000 .discharge_on_disable = true, 2001 }; 2002 2003 static const struct drm_display_mode boe_tv101wum_n53_default_mode = { 2004 .clock = 159916, 2005 .hdisplay = 1200, 2006 .hsync_start = 1200 + 80, 2007 .hsync_end = 1200 + 80 + 24, 2008 .htotal = 1200 + 80 + 24 + 60, 2009 .vdisplay = 1920, 2010 .vsync_start = 1920 + 20, 2011 .vsync_end = 1920 + 20 + 4, 2012 .vtotal = 1920 + 20 + 4 + 10, 2013 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 2014 }; 2015 2016 static const struct panel_desc boe_tv101wum_n53_desc = { 2017 .modes = &boe_tv101wum_n53_default_mode, 2018 .bpc = 8, 2019 .size = { 2020 .width_mm = 135, 2021 .height_mm = 216, 2022 }, 2023 .lanes = 4, 2024 .format = MIPI_DSI_FMT_RGB888, 2025 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2026 MIPI_DSI_MODE_LPM, 2027 .init_cmds = boe_init_cmd, 2028 }; 2029 2030 static const struct drm_display_mode auo_b101uan08_3_default_mode = { 2031 .clock = 159667, 2032 .hdisplay = 1200, 2033 .hsync_start = 1200 + 60, 2034 .hsync_end = 1200 + 60 + 4, 2035 .htotal = 1200 + 60 + 4 + 80, 2036 .vdisplay = 1920, 2037 .vsync_start = 1920 + 34, 2038 .vsync_end = 1920 + 34 + 2, 2039 .vtotal = 1920 + 34 + 2 + 24, 2040 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 2041 }; 2042 2043 static const struct panel_desc auo_b101uan08_3_desc = { 2044 .modes = &auo_b101uan08_3_default_mode, 2045 .bpc = 8, 2046 .size = { 2047 .width_mm = 135, 2048 .height_mm = 216, 2049 }, 2050 .lanes = 4, 2051 .format = MIPI_DSI_FMT_RGB888, 2052 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2053 MIPI_DSI_MODE_LPM, 2054 .init_cmds = auo_b101uan08_3_init_cmd, 2055 }; 2056 2057 static const struct drm_display_mode boe_tv105wum_nw0_default_mode = { 2058 .clock = 159916, 2059 .hdisplay = 1200, 2060 .hsync_start = 1200 + 80, 2061 .hsync_end = 1200 + 80 + 24, 2062 .htotal = 1200 + 80 + 24 + 60, 2063 .vdisplay = 1920, 2064 .vsync_start = 1920 + 20, 2065 .vsync_end = 1920 + 20 + 4, 2066 .vtotal = 1920 + 20 + 4 + 10, 2067 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 2068 }; 2069 2070 static const struct panel_desc boe_tv105wum_nw0_desc = { 2071 .modes = &boe_tv105wum_nw0_default_mode, 2072 .bpc = 8, 2073 .size = { 2074 .width_mm = 141, 2075 .height_mm = 226, 2076 }, 2077 .lanes = 4, 2078 .format = MIPI_DSI_FMT_RGB888, 2079 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2080 MIPI_DSI_MODE_LPM, 2081 .init_cmds = boe_init_cmd, 2082 .lp11_before_reset = true, 2083 }; 2084 2085 static const struct drm_display_mode starry_qfh032011_53g_default_mode = { 2086 .clock = 165731, 2087 .hdisplay = 1200, 2088 .hsync_start = 1200 + 100, 2089 .hsync_end = 1200 + 100 + 10, 2090 .htotal = 1200 + 100 + 10 + 100, 2091 .vdisplay = 1920, 2092 .vsync_start = 1920 + 14, 2093 .vsync_end = 1920 + 14 + 10, 2094 .vtotal = 1920 + 14 + 10 + 15, 2095 }; 2096 2097 static const struct panel_desc starry_qfh032011_53g_desc = { 2098 .modes = &starry_qfh032011_53g_default_mode, 2099 .bpc = 8, 2100 .size = { 2101 .width_mm = 135, 2102 .height_mm = 216, 2103 }, 2104 .lanes = 4, 2105 .format = MIPI_DSI_FMT_RGB888, 2106 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2107 MIPI_DSI_MODE_LPM, 2108 .init_cmds = starry_qfh032011_53g_init_cmd, 2109 }; 2110 2111 static const struct drm_display_mode starry_himax83102_j02_default_mode = { 2112 .clock = 161600, 2113 .hdisplay = 1200, 2114 .hsync_start = 1200 + 40, 2115 .hsync_end = 1200 + 40 + 20, 2116 .htotal = 1200 + 40 + 20 + 40, 2117 .vdisplay = 1920, 2118 .vsync_start = 1920 + 116, 2119 .vsync_end = 1920 + 116 + 8, 2120 .vtotal = 1920 + 116 + 8 + 12, 2121 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 2122 }; 2123 2124 static const struct panel_desc starry_himax83102_j02_desc = { 2125 .modes = &starry_himax83102_j02_default_mode, 2126 .bpc = 8, 2127 .size = { 2128 .width_mm = 141, 2129 .height_mm = 226, 2130 }, 2131 .lanes = 4, 2132 .format = MIPI_DSI_FMT_RGB888, 2133 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2134 MIPI_DSI_MODE_LPM, 2135 .init_cmds = starry_himax83102_j02_init_cmd, 2136 .lp11_before_reset = true, 2137 }; 2138 2139 static const struct drm_display_mode starry_ili9882t_default_mode = { 2140 .clock = 165280, 2141 .hdisplay = 1200, 2142 .hsync_start = 1200 + 72, 2143 .hsync_end = 1200 + 72 + 30, 2144 .htotal = 1200 + 72 + 30 + 72, 2145 .vdisplay = 1920, 2146 .vsync_start = 1920 + 68, 2147 .vsync_end = 1920 + 68 + 2, 2148 .vtotal = 1920 + 68 + 2 + 10, 2149 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 2150 }; 2151 2152 static const struct panel_desc starry_ili9882t_desc = { 2153 .modes = &starry_ili9882t_default_mode, 2154 .bpc = 8, 2155 .size = { 2156 .width_mm = 141, 2157 .height_mm = 226, 2158 }, 2159 .lanes = 4, 2160 .format = MIPI_DSI_FMT_RGB888, 2161 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 2162 MIPI_DSI_MODE_LPM, 2163 .init_cmds = starry_ili9882t_init_cmd, 2164 .lp11_before_reset = true, 2165 }; 2166 2167 static int boe_panel_get_modes(struct drm_panel *panel, 2168 struct drm_connector *connector) 2169 { 2170 struct boe_panel *boe = to_boe_panel(panel); 2171 const struct drm_display_mode *m = boe->desc->modes; 2172 struct drm_display_mode *mode; 2173 2174 mode = drm_mode_duplicate(connector->dev, m); 2175 if (!mode) { 2176 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", 2177 m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); 2178 return -ENOMEM; 2179 } 2180 2181 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; 2182 drm_mode_set_name(mode); 2183 drm_mode_probed_add(connector, mode); 2184 2185 connector->display_info.width_mm = boe->desc->size.width_mm; 2186 connector->display_info.height_mm = boe->desc->size.height_mm; 2187 connector->display_info.bpc = boe->desc->bpc; 2188 /* 2189 * TODO: Remove once all drm drivers call 2190 * drm_connector_set_orientation_from_panel() 2191 */ 2192 drm_connector_set_panel_orientation(connector, boe->orientation); 2193 2194 return 1; 2195 } 2196 2197 static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel) 2198 { 2199 struct boe_panel *boe = to_boe_panel(panel); 2200 2201 return boe->orientation; 2202 } 2203 2204 static const struct drm_panel_funcs boe_panel_funcs = { 2205 .disable = boe_panel_disable, 2206 .unprepare = boe_panel_unprepare, 2207 .prepare = boe_panel_prepare, 2208 .enable = boe_panel_enable, 2209 .get_modes = boe_panel_get_modes, 2210 .get_orientation = boe_panel_get_orientation, 2211 }; 2212 2213 static int boe_panel_add(struct boe_panel *boe) 2214 { 2215 struct device *dev = &boe->dsi->dev; 2216 int err; 2217 2218 boe->avdd = devm_regulator_get(dev, "avdd"); 2219 if (IS_ERR(boe->avdd)) 2220 return PTR_ERR(boe->avdd); 2221 2222 boe->avee = devm_regulator_get(dev, "avee"); 2223 if (IS_ERR(boe->avee)) 2224 return PTR_ERR(boe->avee); 2225 2226 boe->pp3300 = devm_regulator_get(dev, "pp3300"); 2227 if (IS_ERR(boe->pp3300)) 2228 return PTR_ERR(boe->pp3300); 2229 2230 boe->pp1800 = devm_regulator_get(dev, "pp1800"); 2231 if (IS_ERR(boe->pp1800)) 2232 return PTR_ERR(boe->pp1800); 2233 2234 boe->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); 2235 if (IS_ERR(boe->enable_gpio)) { 2236 dev_err(dev, "cannot get reset-gpios %ld\n", 2237 PTR_ERR(boe->enable_gpio)); 2238 return PTR_ERR(boe->enable_gpio); 2239 } 2240 2241 gpiod_set_value(boe->enable_gpio, 0); 2242 2243 drm_panel_init(&boe->base, dev, &boe_panel_funcs, 2244 DRM_MODE_CONNECTOR_DSI); 2245 err = of_drm_get_panel_orientation(dev->of_node, &boe->orientation); 2246 if (err < 0) { 2247 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); 2248 return err; 2249 } 2250 2251 err = drm_panel_of_backlight(&boe->base); 2252 if (err) 2253 return err; 2254 2255 boe->base.funcs = &boe_panel_funcs; 2256 boe->base.dev = &boe->dsi->dev; 2257 2258 drm_panel_add(&boe->base); 2259 2260 return 0; 2261 } 2262 2263 static int boe_panel_probe(struct mipi_dsi_device *dsi) 2264 { 2265 struct boe_panel *boe; 2266 int ret; 2267 const struct panel_desc *desc; 2268 2269 boe = devm_kzalloc(&dsi->dev, sizeof(*boe), GFP_KERNEL); 2270 if (!boe) 2271 return -ENOMEM; 2272 2273 desc = of_device_get_match_data(&dsi->dev); 2274 dsi->lanes = desc->lanes; 2275 dsi->format = desc->format; 2276 dsi->mode_flags = desc->mode_flags; 2277 boe->desc = desc; 2278 boe->dsi = dsi; 2279 ret = boe_panel_add(boe); 2280 if (ret < 0) 2281 return ret; 2282 2283 mipi_dsi_set_drvdata(dsi, boe); 2284 2285 ret = mipi_dsi_attach(dsi); 2286 if (ret) 2287 drm_panel_remove(&boe->base); 2288 2289 return ret; 2290 } 2291 2292 static void boe_panel_shutdown(struct mipi_dsi_device *dsi) 2293 { 2294 struct boe_panel *boe = mipi_dsi_get_drvdata(dsi); 2295 2296 drm_panel_disable(&boe->base); 2297 drm_panel_unprepare(&boe->base); 2298 } 2299 2300 static void boe_panel_remove(struct mipi_dsi_device *dsi) 2301 { 2302 struct boe_panel *boe = mipi_dsi_get_drvdata(dsi); 2303 int ret; 2304 2305 boe_panel_shutdown(dsi); 2306 2307 ret = mipi_dsi_detach(dsi); 2308 if (ret < 0) 2309 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); 2310 2311 if (boe->base.dev) 2312 drm_panel_remove(&boe->base); 2313 } 2314 2315 static const struct of_device_id boe_of_match[] = { 2316 { .compatible = "boe,tv101wum-nl6", 2317 .data = &boe_tv101wum_nl6_desc 2318 }, 2319 { .compatible = "auo,kd101n80-45na", 2320 .data = &auo_kd101n80_45na_desc 2321 }, 2322 { .compatible = "boe,tv101wum-n53", 2323 .data = &boe_tv101wum_n53_desc 2324 }, 2325 { .compatible = "auo,b101uan08.3", 2326 .data = &auo_b101uan08_3_desc 2327 }, 2328 { .compatible = "boe,tv105wum-nw0", 2329 .data = &boe_tv105wum_nw0_desc 2330 }, 2331 { .compatible = "boe,tv110c9m-ll3", 2332 .data = &boe_tv110c9m_desc 2333 }, 2334 { .compatible = "innolux,hj110iz-01a", 2335 .data = &inx_hj110iz_desc 2336 }, 2337 { .compatible = "starry,2081101qfh032011-53g", 2338 .data = &starry_qfh032011_53g_desc 2339 }, 2340 { .compatible = "starry,himax83102-j02", 2341 .data = &starry_himax83102_j02_desc 2342 }, 2343 { .compatible = "starry,ili9882t", 2344 .data = &starry_ili9882t_desc 2345 }, 2346 { /* sentinel */ } 2347 }; 2348 MODULE_DEVICE_TABLE(of, boe_of_match); 2349 2350 static struct mipi_dsi_driver boe_panel_driver = { 2351 .driver = { 2352 .name = "panel-boe-tv101wum-nl6", 2353 .of_match_table = boe_of_match, 2354 }, 2355 .probe = boe_panel_probe, 2356 .remove = boe_panel_remove, 2357 .shutdown = boe_panel_shutdown, 2358 }; 2359 module_mipi_dsi_driver(boe_panel_driver); 2360 2361 MODULE_AUTHOR("Jitao Shi <jitao.shi@mediatek.com>"); 2362 MODULE_DESCRIPTION("BOE tv101wum-nl6 1200x1920 video mode panel driver"); 2363 MODULE_LICENSE("GPL v2"); 2364